Thread: [Phpfreechat-svn] SF.net SVN: phpfreechat: [586] trunk/src/commands/connect.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-15 12:24:06
|
Revision: 586 Author: kerphi Date: 2006-06-15 05:23:54 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=586&view=rev Log Message: ----------- Simplify and optimize the code Modified Paths: -------------- trunk/src/commands/connect.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-06-15 12:10:24 UTC (rev 585) +++ trunk/src/commands/connect.class.php 2006-06-15 12:23:54 UTC (rev 586) @@ -14,9 +14,8 @@ $container =& $c->getContainerInstance(); $disconnected_users = $container->removeObsoleteNick(NULL, $c->timeout); - // setup some user meta - $nickid = $container->getNickId($u->nick); + $nickid = $u->nickid; // store the user ip $container->setMeta($_SERVER["REMOTE_ADDR"], "ip", "nickname", $nickid); // store the admin flag This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-15 14:50:26
|
Revision: 590 Author: kerphi Date: 2006-06-15 07:50:17 -0700 (Thu, 15 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=590&view=rev Log Message: ----------- Now the first connected user gets automatically the server admin rights. Modified Paths: -------------- trunk/src/commands/connect.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-06-15 14:34:07 UTC (rev 589) +++ trunk/src/commands/connect.class.php 2006-06-15 14:50:17 UTC (rev 590) @@ -14,12 +14,20 @@ $container =& $c->getContainerInstance(); $disconnected_users = $container->removeObsoleteNick(NULL, $c->timeout); + $isadmin = $c->isadmin; + if (!$isadmin) + { + // check if the user is alone on the server, and give it the admin status if yes + $users = $container->getOnlineNick(NULL); + if (count($users) == 0) $isadmin = true; + } + // setup some user meta $nickid = $u->nickid; // store the user ip $container->setMeta($_SERVER["REMOTE_ADDR"], "ip", "nickname", $nickid); // store the admin flag - $container->setMeta($c->isadmin, "isadmin", "nickname", $nickid); + $container->setMeta($isadmin, "isadmin", "nickname", $nickid); // connect to the server $xml_reponse->addScript("pfc.handleResponse('connect', 'ok', '');"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-06-17 08:01:16
|
Revision: 610 Author: kerphi Date: 2006-06-17 01:01:09 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=610&view=rev Log Message: ----------- Bug fix: when this is the first connection, the u->channels is empty, to setup the oldmsg flag, c->channels must be used Modified Paths: -------------- trunk/src/commands/connect.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-06-16 21:18:38 UTC (rev 609) +++ trunk/src/commands/connect.class.php 2006-06-17 08:01:09 UTC (rev 610) @@ -16,9 +16,14 @@ // reset the message id indicator (see getnewmsg.class.php) // i.e. be ready to re-get all last posted messages require_once(dirname(__FILE__)."/join.class.php"); - foreach($u->channels as $chan) + $channels = array(); + if (count($u->channels) == 0) + $channels = $c->channels; + else + foreach($u->channels as $chan) + $channels[] = $chan["name"]; + foreach($channels as $channame) { - $channame = $chan["name"]; $chanrecip = pfcCommand_join::GetRecipient($channame); $chanid = pfcCommand_join::GetRecipientId($channame); // reset the fromid flag This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <ke...@us...> - 2007-04-17 20:19:40
|
Revision: 1017 http://svn.sourceforge.net/phpfreechat/?rev=1017&view=rev Author: kerphi Date: 2007-04-17 13:19:40 -0700 (Tue, 17 Apr 2007) Log Message: ----------- [en] Bug fix: private message tabs were lost when reloading the chat page [0h10] [fr] Bug fix : les onglets des messages priv?\195?\169s ?\195?\169taient perdus lorsque l'on rechargait le chat [0h10] Modified Paths: -------------- trunk/src/commands/connect.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2007-04-16 17:00:15 UTC (rev 1016) +++ trunk/src/commands/connect.class.php 2007-04-17 20:19:40 UTC (rev 1017) @@ -75,7 +75,7 @@ { $cmdp = array(); $cmdp["param"] = $pvlist[$i]; - $cmd =& pfcCommand::Factory( $i < count($pvlist)-1 || !$joinoldchan ? 'join2' : 'join' ); + $cmd =& pfcCommand::Factory( $i < count($pvlist)-1 || !$joinoldchan ? 'privmsg2' : 'privmsg' ); $cmd->run($xml_reponse, $cmdp); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2007-11-25 21:51:14
|
Revision: 1220 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1220&view=rev Author: kerphi Date: 2007-11-25 13:51:18 -0800 (Sun, 25 Nov 2007) Log Message: ----------- Bug fix: when max_msg value was zero, no message should be displayed at first chat loading (thanks to lnevo) Modified Paths: -------------- trunk/src/commands/connect.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2007-11-25 21:48:09 UTC (rev 1219) +++ trunk/src/commands/connect.class.php 2007-11-25 21:51:18 UTC (rev 1220) @@ -110,7 +110,7 @@ $chanid = pfcCommand_join::GetRecipientId($channame); // reset the fromid flag $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$chanid; - $from_id = $ct->getLastId($chanrecip)-$c->max_msg; + $from_id = $ct->getLastId($chanrecip)-$c->max_msg+1; $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; // reset the oldmsg flag $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$chanid; @@ -124,7 +124,7 @@ $recipient2 = $pv['recipient']; // reset the fromid flag $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$recipientid2; - $from_id = $ct->getLastId($recipient2)-$c->max_msg; + $from_id = $ct->getLastId($recipient2)-$c->max_msg+1; $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; // reset the oldmsg flag $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$recipientid2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |