[Phpfreechat-svn] SF.net SVN: phpfreechat: [658] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-07-17 15:21:07
|
Revision: 658 Author: kerphi Date: 2006-07-17 08:20:41 -0700 (Mon, 17 Jul 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=658&view=rev Log Message: ----------- Bug fix: the /identify command was broken Modified Paths: -------------- trunk/src/commands/identify.class.php trunk/src/pfcglobalconfig.class.php Modified: trunk/src/commands/identify.class.php =================================================================== --- trunk/src/commands/identify.class.php 2006-07-17 14:57:01 UTC (rev 657) +++ trunk/src/commands/identify.class.php 2006-07-17 15:20:41 UTC (rev 658) @@ -38,14 +38,15 @@ $password = trim($param); $isadmin = false; - - // @todo simplify the search in the admins config array using a native php function (array_search?) - foreach($c->admins as $a_nick => $a_pass) - { - if ($a_nick == $sender && $a_pass == $password) - $isadmin = true; - } +// $xml_reponse->addScript("alert('sender=".$sender."');"); +// $xml_reponse->addScript("alert('password=".$password."');"); +// $xml_reponse->addScript("alert('admins=".var_export($c->admins, true)."');"); + + if( isset($c->admins[$sender]) && + $c->admins[$sender] == $password ) + $isadmin = true; + $msg = ""; if ($isadmin) { Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-07-17 14:57:01 UTC (rev 657) +++ trunk/src/pfcglobalconfig.class.php 2006-07-17 15:20:41 UTC (rev 658) @@ -35,7 +35,7 @@ // these parameters are dynamic (not cached) var $nick = ""; // the initial nickname ("" means the user will be queried) var $isadmin = false; - var $admins = array("admin" => ""); // nicknames is the key, password is the value + var $admins = array("admin" => ""); // the key is the nickname, the value is the password var $islocked = false; // set this parameter to true to lock the chat for all users var $lockurl = "http://www.phpfreechat.net"; // this is the url where the users must be redirected when the chat is locked @@ -159,7 +159,8 @@ // load dynamic parameter even if the config exists in the cache foreach ( $this->dyn_params as $dp ) - $this->$dp = $params[$dp]; + if (isset($params[$dp])) + $this->$dp = $params[$dp]; // now load or save the configuration in the cache $this->synchronizeWithCache(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |