[Phpfreechat-svn] SF.net SVN: phpfreechat: [1003] trunk/src/commands/connect.class.php
Status: Beta
Brought to you by:
kerphi
|
From: <ke...@us...> - 2007-03-20 08:48:21
|
Revision: 1003
http://svn.sourceforge.net/phpfreechat/?rev=1003&view=rev
Author: kerphi
Date: 2007-03-20 01:48:20 -0700 (Tue, 20 Mar 2007)
Log Message:
-----------
give the right ip when the chat is behind a reverse proxy
Modified Paths:
--------------
trunk/src/commands/connect.class.php
Modified: trunk/src/commands/connect.class.php
===================================================================
--- trunk/src/commands/connect.class.php 2007-03-19 19:23:11 UTC (rev 1002)
+++ trunk/src/commands/connect.class.php 2007-03-20 08:48:20 UTC (rev 1003)
@@ -85,7 +85,7 @@
// $u->saveInCache();
// store the user ip
- $ip = $_SERVER["REMOTE_ADDR"];
+ $ip = isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"];
if ($ip == "::1") $ip = "127.0.0.1"; // fix for konqueror & localhost
$ct->setUserMeta($nickid, 'ip', $ip);
// store the admin flag
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|