Previous Thread
Next Thread
Print Thread
Hop To
#236840 05/12/2010 6:28 PM
Joined: May 2008
Posts: 753
Likes: 1
Old Hand
Old Hand
Joined: May 2008
Posts: 753
Likes: 1
I need to change REMOTE_ADDR in my scripts to HTTP_CF_CONNECTING_IP

how many scripts do I have to edit and which ones?


"No matter where you go, there you are."
"If you can't do something smart, Do something right"
"There are three kinds of people in the world, those who can count, and those who can't"
Bad Frog #236841 05/12/2010 6:47 PM
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
i googled that HTTP_CF_CONNECTING_IP and find nothing about it..

you sure you have that typed right?

http://www.php.net/manual/en/reserved.variables.server.php <-- reference to $_SERVER variables used in php..

Bad Frog #236842 05/12/2010 6:47 PM
Joined: Jun 2006
Posts: 16,300
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,300
Likes: 116
Not sure offhand, we had some issues previously with REMOTE_ADDR on some servers, I'd imagine you could surf through search results for them... I think it'd have the previous pages if you can find it


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Gizmo #236844 05/12/2010 6:54 PM
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
Code
libs\captcha.inc.php':
libs\html.inc.php':
libs\includepoll.inc.php':
libs\mysql.inc.php':
libs\ubbthreads.inc.php':
libs\user.inc.php':
scripts\addpost.inc.php':
scripts\adduser.inc.php':
scripts\captcha.inc.php':
scripts\dopoll.inc.php':
scripts\profile_comment.inc.php':
scripts\shoutit.inc.php':
scripts\start_page.inc.php':

just using grep shows these files, if you really NEED to wink

SD #236845 05/12/2010 7:00 PM
Joined: May 2008
Posts: 753
Likes: 1
Old Hand
Old Hand
Joined: May 2008
Posts: 753
Likes: 1
with this cloudflare thing I am trying out, all IPs show as being a cloudflare IP. HTTP_CF_CONNECTING_IP is a forwarded value that shows the correct IP.

because my site is on a shared virtual server, they can't/won't make global changes to the httpd.conf file as it will trash everyone elses stuff.
they did make some changes so that my logs are showing up correctly, etc, but right now every user on my site is showing up from the same IP


"No matter where you go, there you are."
"If you can't do something smart, Do something right"
"There are three kinds of people in the world, those who can count, and those who can't"
Bad Frog #236846 05/12/2010 7:03 PM
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
well, with an editor like Ultraedit or similar, it's a very easy 1 click change...

"replace in files" *.php, including subdirs..

see if it works... smile

you can always revert back with the reverse replacement wink

this assumes that it's a php accessible $_SERVER variable, which i don't find on php.net @ 1st glance..

SD #236847 05/12/2010 7:21 PM
Joined: May 2008
Posts: 753
Likes: 1
Old Hand
Old Hand
Joined: May 2008
Posts: 753
Likes: 1
thanx SD
changing it in those files now has the correct IP showing up on posts and new registrations, etc.. and I'm not getting spammed with a million multiple login from same IP messages!


"No matter where you go, there you are."
"If you can't do something smart, Do something right"
"There are three kinds of people in the world, those who can count, and those who can't"
Bad Frog #236850 05/12/2010 8:54 PM
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
well, i must say i learned something today then laugh

SD #236863 05/13/2010 9:52 AM
Joined: May 2008
Posts: 753
Likes: 1
Old Hand
Old Hand
Joined: May 2008
Posts: 753
Likes: 1
when someone trips a 404, or other error, I get an email like this..
Code

Error 404 "Document Not Found" occurred for:
	http://vannin.com/fiz

Responded with error template 'error_404.txt'.

The error was caused by a visitor from: cf-204-93-173-22.cloudflare.com This visitor has caused a 404 error 2 time(s).
The error time was: 2010-05-12 17:52:42

No referring URL was associated with this visit.

NOTE: This email message was generated by an automated script:
      URL: http://vannin.com/guardian/ag-admin.pl
   server: vannin.com
   script: ag.pl
  address: error@vannin.com
_____________________________________________________________________________

Environment Variables:

AG_ERROR_CODE: 404
AG_ERROR_COUNT: 2
AG_ERROR_URL: http://vannin.com/fiz
DOCUMENT_ROOT: /var/www/virtual/v/a/vannin.com/www
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.3
HTTP_ACCEPT_ENCODING: gzip
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_CACHE_CONTROL: max-age=0
HTTP_CF_CONNECTING_IP: 173.162.162.82
HTTP_CF_IDENTIFY_BOT: 0
HTTP_CF_IPCOUNTRY: US
HTTP_CF_IPTYPE: CLEAN
HTTP_CF_USE_OB: 0
HTTP_CONNECTION: close
HTTP_COOKIE: 0wibiya32798_unique_user=1; __utmz=86733087.1273614104.110.5.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=http://vannin.com/; Error404=1; __utma=86733087.792751327.1263520286.1273659196.1273699890.113; __utmc=86733087; __utmb=86733087.8.10.1273699890; web_auth_cp=pmjzskvveiyykync
HTTP_FL_SERVER: 1n1f1
HTTP_HOST: vannin.com
HTTP_USER_AGENT: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.29 Safari/533.4
HTTP_X_FORWARDED_FOR: 173.162.162.82
PATH: /usr/local/bin:/usr/bin:/bin
QUERY_STRING: 404
REDIRECT_STATUS: 404
REDIRECT_URL: /fiz
REMOTE_ADDR: 204.93.173.22
REMOTE_HOST: cf-204-93-173-22.cloudflare.com
REMOTE_PORT: 37164
REQUEST_METHOD: GET
REQUEST_URI: /fiz
SCRIPT_FILENAME: /var/www/virtual/v/a/vannin.com/www/guardian/ag.pl
SCRIPT_NAME: /guardian/ag.pl
SCRIPT_URI: http://vannin.com/fiz
SCRIPT_URL: /fiz
SERVER_ADDR: 10.1.5.81
SERVER_ADMIN: root@localhost
SERVER_NAME: vannin.com
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.0
SERVER_SIGNATURE: &lt;address&gt;Apache/2.2.3 (Red Hat) Server at vannin.com Port 80&lt;/address&gt;

SERVER_SOFTWARE: Apache/2.2.3 (Red Hat)

this one was before I changed REMOTE_ADDR in my scripts to HTTP_CF_CONNECTING_IP, and you can see where it thinks the visitor is from cloudflare. all the posts on my forums, all the new users, etc, were all showing from that IP address.

by making that change, I am seeing their IP, and not the cloudflare IP


"No matter where you go, there you are."
"If you can't do something smart, Do something right"
"There are three kinds of people in the world, those who can count, and those who can't"
Bad Frog #236865 05/13/2010 10:02 AM
Joined: Mar 2007
Posts: 522
Addict
Addict
Joined: Mar 2007
Posts: 522
I wonder how many emails I'd get in a day!


Steve

UBB.classic from 2000-2003
UBB.threads from 2003-present!
SteveS #236880 05/13/2010 5:48 PM
Joined: May 2008
Posts: 753
Likes: 1
Old Hand
Old Hand
Joined: May 2008
Posts: 753
Likes: 1
I don't get that many actually... I have it set to ignore certain patterns, others it blocks the user completely if they are probing where they shouldn't be.. it makes it easy to keep track and fix broken links etc


"No matter where you go, there you are."
"If you can't do something smart, Do something right"
"There are three kinds of people in the world, those who can count, and those who can't"
Bad Frog #236882 05/13/2010 7:37 PM
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
inbox filters :ftw:

SD #236884 05/13/2010 8:55 PM
Joined: May 2008
Posts: 753
Likes: 1
Old Hand
Old Hand
Joined: May 2008
Posts: 753
Likes: 1
well, i have everything from that filtered to it's own folder, same thing for all my honeypot notifications, like to keep the inbox somewhat clean.


"No matter where you go, there you are."
"If you can't do something smart, Do something right"
"There are three kinds of people in the world, those who can count, and those who can't"

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Version 7.7.5 Images suddenly not displaying
by Stovebolt - 05/04/2024 11:19 AM
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Who's Online Now
3 members (Ruben, Nightcrawler, ahmed047), 837 guests, and 130 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240505)