Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm)
Author Message
BobMarion
Former Admin in Good Standing



Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)

PostPosted: Thu Jul 08, 2004 6:15 pm Reply with quote

Open includes/sentinel.php in a text editor and find the function get_ip(), it is as follows:
Code:
function get_ip() {

  $client_ip = get_client_ip(); // HTTP_CLIENT_IP
  $x_forwarded = get_x_forwarded(); // HTTP_X_FORWARDED_FOR
  $remote_addr = get_remote_addr(); // REMOTE_ADDR
  if (isset($client_ip) && $client_ip != "none") {
    return $client_ip;
  } elseif (isset($x_forwarded) && $x_forwarded != "none") {
    return $x_forwarded;
  } elseif (isset($remote_addr) && $remote_addr != "none") {
    return $remote_addr;
  } else {
    return "none";
  }
}


This needs to be updated to
Code:
function get_ip() {

  $client_ip = get_client_ip(); // HTTP_CLIENT_IP
  $x_forwarded = get_x_forwarded(); // HTTP_X_FORWARDED_FOR
  $remote_addr = get_remote_addr(); // REMOTE_ADDR
  if (isset($client_ip) && !eregi("none", $client_ip) && !eregi("unknown", $client_ip)) {
    return $client_ip;
  } elseif (isset($x_forwarded) && !eregi("none", $x_forwarded) && !eregi("unknown", $x_forwarded)) {
    return $x_forwarded;
  } elseif (isset($remote_addr) && !eregi("none", $remote_addr) && !eregi("unknown", $remote_addr)) {
    return $remote_addr;
  } else {
    return "none";
  }
}


This is an IMPORTANT patch as it is not correctly reading the x_forwarded_for ip in some cases!

_________________
Bob Marion
Codito Ergo Sum
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
Nukeum66
Life Cycles Becoming CPU Cycles



Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA

PostPosted: Fri Jul 09, 2004 12:58 am Reply with quote

Thanks! Bob...... Wink .........Image

_________________
Scott Johnson MIS Ubuntu/Linux 11.10 
View user's profile Send private message Visit poster's website
SmackDaddy
Involved
Involved



Joined: Jun 02, 2004
Posts: 268
Location: Englewood, OH

PostPosted: Fri Jul 09, 2004 6:29 pm Reply with quote

Thank you Bob!
 
View user's profile Send private message Send e-mail Visit poster's website
digibeet
Regular
Regular



Joined: Jul 08, 2004
Posts: 96
Location: Amsterdam, the Netherlands

PostPosted: Mon Jul 12, 2004 4:35 am Reply with quote

Thanks, Bob. Smile

Fred

_________________
"Grasp the subject, the words will follow."
Cato the Elder (234 BC - 149 BC)
Roman orator & politician. 
View user's profile Send private message Visit poster's website
blith
Client



Joined: Jul 18, 2003
Posts: 977

PostPosted: Tue Jul 13, 2004 11:10 am Reply with quote

I think this needs to be an announcement. I just got lucky and read it... thanks for the info!
 
View user's profile Send private message Visit poster's website
BobMarion







PostPosted: Tue Jul 13, 2004 11:27 am Reply with quote

It was announced Smile on both NukeScripts and RavenPHPScripts.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel(tm)

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©