[Phpfreechat-svn] SF.net SVN: phpfreechat: [617] trunk/src/commands
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-17 18:20:30
|
Revision: 617 Author: kerphi Date: 2006-06-17 11:20:22 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=617&view=rev Log Message: ----------- fix warnings Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/getonlinenick.class.php trunk/src/commands/nick.class.php trunk/src/containers/file.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-06-17 12:33:51 UTC (rev 616) +++ trunk/src/commands/connect.class.php 2006-06-17 18:20:22 UTC (rev 617) @@ -40,7 +40,8 @@ if (!$isadmin) { $users = $container->getOnlineNick(NULL); - if (count($users["nickid"]) == 0) $isadmin = true; + if (isset($users["nickid"]) && + count($users["nickid"]) == 0) $isadmin = true; } // setup some user meta Modified: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-06-17 12:33:51 UTC (rev 616) +++ trunk/src/commands/getonlinenick.class.php 2006-06-17 18:20:22 UTC (rev 617) @@ -11,11 +11,12 @@ // take care to disconnect timeouted users on this channel $disconnected_users = $container->removeObsoleteNick($recipient,$c->timeout); - foreach ($disconnected_users["nick"] as $n) - { - $cmd =& pfcCommand::Factory("notice"); - $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)", $n), $sender, $recipient, $recipientid, 2); - } + if (isset($disconnected_users["nick"])) + foreach ($disconnected_users["nick"] as $n) + { + $cmd =& pfcCommand::Factory("notice"); + $cmd->run($xml_reponse, $clientid, _pfc("%s quit (timeout)", $n), $sender, $recipient, $recipientid, 2); + } // get the cached nickname list $nicklist_sid = $c->prefix."nicklist_".$c->getId()."_".$clientid."_".$recipientid; @@ -35,8 +36,8 @@ if ($c->debug) { - $nicklist = implode(",",$nicklist); - pxlog("/getonlinenick (nicklist updated - nicklist=".$nicklist.")", "chat", $c->getId()); + $nicklist2 = implode(",",$nicklist); + pxlog("/getonlinenick (nicklist updated - nicklist=".$nicklist2.")", "chat", $c->getId()); } // build and send the nickname list Modified: trunk/src/commands/nick.class.php =================================================================== --- trunk/src/commands/nick.class.php 2006-06-17 12:33:51 UTC (rev 616) +++ trunk/src/commands/nick.class.php 2006-06-17 18:20:22 UTC (rev 617) @@ -34,16 +34,17 @@ // 'BoB' and 'bob' must be considered same nicknames $nick_in_use = false; $online_users = $container->getOnlineNick(NULL); - foreach($online_users["nickid"] as $nid) - { - if (preg_match("/^".preg_quote($container->getNickname($nid))."$/i",$newnick)) + if (isset($online_users["nickid"])) + foreach($online_users["nickid"] as $nid) { - // the nick match - // just allow the owner to change his capitalised letters - if ($nid != $oldnickid) - $nick_in_use = true; + if (preg_match("/^".preg_quote($container->getNickname($nid))."$/i",$newnick)) + { + // the nick match + // just allow the owner to change his capitalised letters + if ($nid != $oldnickid) + $nick_in_use = true; + } } - } if ( $newnickid == "undefined" && !$nick_in_use ) { Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-06-17 12:33:51 UTC (rev 616) +++ trunk/src/containers/file.class.php 2006-06-17 18:20:22 UTC (rev 617) @@ -112,7 +112,7 @@ // check the if the file exists only in debug mode! if ($c->debug) { - if (file_exists($nick_filename)) + if (file_exists($nickid_filename)) pxlog("createNick(".$nick.", ".$nickid.") - Error: another nickname data file exists, we are overwriting it (nickname takeover)!", "chat", $c->getId()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |