[Phpfreechat-svn] SF.net SVN: phpfreechat: [653] trunk/src/pfcglobalconfig.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-07-12 11:50:59
|
Revision: 653 Author: kerphi Date: 2006-07-12 04:50:50 -0700 (Wed, 12 Jul 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=653&view=rev Log Message: ----------- Bug fix: the 'admins' parameter in now dynamic Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-07-07 11:45:12 UTC (rev 652) +++ trunk/src/pfcglobalconfig.class.php 2006-07-12 11:50:50 UTC (rev 653) @@ -340,6 +340,11 @@ // load debug url $this->debugurl = relativePath($this->client_script_path, dirname(__FILE__)."/../debug"); + + // check the frozen_nick parameter is used with a none empty nickname + if ($this->frozen_nick && $this->nick == "") + $this->errors[] = _pfc("frozen_nick can't be used with a empty nick"); + // check if channels parameter is a strings array if (!is_array($this->channels)) $this->errors[] = _pfc("'%s' parameter must be an array", "channels"); @@ -459,13 +464,12 @@ // if a cache file exists, remove the lock file because config has been succesfully stored if (file_exists($cachefile_lock)) @unlink($cachefile_lock); + $dyn_params = array("nick","isadmin","islocked","admins"); $pfc_configvar = unserialize(file_get_contents($cachefile)); foreach($pfc_configvar as $key => $val) { - // the 'nick', 'isadmin', and 'islocked' are dynamic parameters, it must not be cached - if ($key != "nick" && - $key != "isadmin" && - $key != "islocked" ) + // the dynamics parameters must not be cached + if (!in_array($key,$dyn_params)) $this->$key = $val; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |