[Phpfreechat-svn] SF.net SVN: phpfreechat: [986] trunk/src/proxies/checktimeout.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2007-03-08 14:16:31
|
Revision: 986 http://svn.sourceforge.net/phpfreechat/?rev=986&view=rev Author: kerphi Date: 2007-03-08 06:16:31 -0800 (Thu, 08 Mar 2007) Log Message: ----------- typo Modified Paths: -------------- trunk/src/proxies/checktimeout.class.php Modified: trunk/src/proxies/checktimeout.class.php =================================================================== --- trunk/src/proxies/checktimeout.class.php 2007-03-08 13:59:52 UTC (rev 985) +++ trunk/src/proxies/checktimeout.class.php 2007-03-08 14:16:31 UTC (rev 986) @@ -26,7 +26,7 @@ /** * pfcProxyCommand_checktimeout * this command disconnect obsolete users (timouted) - * an obsolete user is an user which didn't update his stats since more than 20 seconds (timeout value) + * an obsolete user is an user which didn't update his stats since more than 20 seconds (default timeout value) * @author Stephane Gully <ste...@gm...> */ class pfcProxyCommand_checktimeout extends pfcProxyCommand @@ -41,35 +41,34 @@ if ($this->name == 'update') { - $c =& pfcGlobalConfig::Instance(); - $u =& pfcUserConfig::Instance(); - $ct =& pfcContainer::Instance(); - - // disconnect users from specific channels - $disconnected_users = $ct->removeObsoleteNick($c->timeout); - for($i=0; $i<count($disconnected_users["nick"]); $i++) - { - $nick = $disconnected_users["nick"][$i]; - for($j=0; $j<count($disconnected_users["channels"][$i]); $j++) + $c =& pfcGlobalConfig::Instance(); + $u =& pfcUserConfig::Instance(); + $ct =& pfcContainer::Instance(); + + // disconnect users from channels when they timeout + $disconnected_users = $ct->removeObsoleteNick($c->timeout); + for($i=0; $i<count($disconnected_users["nick"]); $i++) { - file_put_contents('/tmp/disco',var_export($disconnected_users,true), FILE_APPEND); - $chan = $disconnected_users["channels"][$i][$j]; - $online_users = $ct->getOnlineNick($chan); - if ($chan != 'SERVER' && - count($online_users['nickid'])) + $nick = $disconnected_users["nick"][$i]; + for($j=0; $j<count($disconnected_users["channels"][$i]); $j++) { - $cmdp = $p; - $cmdp["param"] = _pfc("%s quit (timeout)", $nick); - $cmdp["flag"] = 2; - $cmdp["recipient"] = $chan; - $cmdp["recipientid"] = md5($chan); // @todo: clean the recipient/recipientid notion - $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $cmdp); - } - } + $chan = $disconnected_users["channels"][$i][$j]; + $online_users = $ct->getOnlineNick($chan); + if ($chan != 'SERVER' && + count($online_users['nickid'])) + { + $cmdp = $p; + $cmdp["param"] = _pfc("%s quit (timeout)", $nick); + $cmdp["flag"] = 2; + $cmdp["recipient"] = $chan; + $cmdp["recipientid"] = md5($chan); // @todo: clean the recipient/recipientid notion + $cmd =& pfcCommand::Factory("notice"); + $cmd->run($xml_reponse, $cmdp); + } + } + } } - } - + // forward the command to the next proxy or to the final command $this->next->run($xml_reponse, $p); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |