[Phpfreechat-svn] SF.net SVN: phpfreechat: [1012] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2007-04-01 11:01:51
|
Revision: 1012 http://svn.sourceforge.net/phpfreechat/?rev=1012&view=rev Author: kerphi Date: 2007-04-01 04:01:46 -0700 (Sun, 01 Apr 2007) Log Message: ----------- [en] Bug fix: add get_ip_from_xforwardedfor parameter which can be used to get ip from HTTP_X_FORWARDED_FOR when the chat is behind a reverse proxy (thanks to datacompboy) [0h15] [fr] Bug fix : ajout du parametre get_ip_from_xforwardedfor qui peut ?\195?\170tre utilis?\195?\169 pour r?\195?\169cup?\195?\169rer l'ip des client depuis l'ent?\195?\170te http HTTP_X_FORWARDED_FOR lorsque le chat est derri?\195?\168re un reverse proxy (merci ?\195?\160 datacompboy) [0h15] Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/pfcglobalconfig.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2007-03-29 08:29:05 UTC (rev 1011) +++ trunk/src/commands/connect.class.php 2007-04-01 11:01:46 UTC (rev 1012) @@ -43,7 +43,9 @@ $nickid = $u->nickid; $ct->joinChan($nickid, NULL); // join the server // store the user ip - $ip = isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"]; + $ip = ( $c->get_ip_from_xforwardedfor && 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 Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2007-03-29 08:29:05 UTC (rev 1011) +++ trunk/src/pfcglobalconfig.class.php 2007-04-01 11:01:46 UTC (rev 1012) @@ -131,6 +131,14 @@ var $debugurl = ""; var $debug = false; var $debugxajax = false; + + /** + * This parameter is useful when your chat server is behind a reverse proxy that + * forward client ip address in HTTP_X_FORWARDED_FOR http header. + * see : http://www.phpfreechat.net/forum/viewtopic.php?id=1344 + */ + var $get_ip_from_xforwardedfor = false; + // private parameters var $_sys_proxies = array("lock", "checktimeout", "checknickchange", "auth", "noflood", "censor", "log"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |