[Phpfreechat-svn] SF.net SVN: phpfreechat: [780] trunk
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-09-21 12:13:35
|
Revision: 780 http://svn.sourceforge.net/phpfreechat/?rev=780&view=rev Author: kerphi Date: 2006-09-21 05:13:24 -0700 (Thu, 21 Sep 2006) Log Message: ----------- Rename bad spelled parameters name : 'skip_proxys' to 'skip_proxies', 'post_proxys' to 'post_proxies', 'pre_proxys' to 'pre_proxies', 'proxys_cfg' to 'proxies_cfg', 'proxys_path' to 'proxies_path', and 'proxys_path_default' to 'proxies_path_default'. Modified Paths: -------------- trunk/demo/demo48_custom_proxy.php trunk/src/pfccommand.class.php trunk/src/pfcglobalconfig.class.php trunk/src/pfci18n.class.php trunk/src/proxies/censor.class.php trunk/src/proxies/log.class.php trunk/src/proxies/noflood.class.php Added Paths: ----------- trunk/src/proxies/ Removed Paths: ------------- trunk/src/proxys/ Modified: trunk/demo/demo48_custom_proxy.php =================================================================== --- trunk/demo/demo48_custom_proxy.php 2006-09-21 09:10:29 UTC (rev 779) +++ trunk/demo/demo48_custom_proxy.php 2006-09-21 12:13:24 UTC (rev 780) @@ -3,9 +3,9 @@ require_once dirname(__FILE__)."/../src/phpfreechat.class.php"; $params["serverid"] = md5(__FILE__); // calculate a unique id for this chat -$params["skip_proxys"] = array("censor"); // shows how to disable a proxy (try to write fuck in the chat, it should be possible) -$params["post_proxys"] = array("myproxy"); -$params["proxys_path"] = dirname(__FILE__).'/demo48_custom_proxy'; +$params["skip_proxies"] = array("censor"); // shows how to disable a proxy (try to write fuck in the chat, it should be possible) +$params["post_proxies"] = array("myproxy"); +$params["proxies_path"] = dirname(__FILE__).'/demo48_custom_proxy'; $chat = new phpFreeChat( $params ); ?> Modified: trunk/src/pfccommand.class.php =================================================================== --- trunk/src/pfccommand.class.php 2006-09-21 09:10:29 UTC (rev 779) +++ trunk/src/pfccommand.class.php 2006-09-21 12:13:24 UTC (rev 780) @@ -79,21 +79,21 @@ $cmd =& new $cmd_classname(); $cmd->name = $cmd_name; - // instanciate the proxys chaine + // instanciate the proxies chaine $firstproxy =& $cmd; - for($i = count($c->_proxys)-1; $i >= 0; $i--) + for($i = count($c->_proxies)-1; $i >= 0; $i--) { - $proxy_name = strtolower($c->_proxys[$i]); + $proxy_name = strtolower($c->_proxies[$i]); $proxy_classname = "pfcProxyCommand_" . $proxy_name; if (!class_exists($proxy_classname)) { // try to include the proxy class file from the default path or from the customized path - $proxy_filename = $c->proxys_path_default.'/'.$proxy_name.".class.php"; + $proxy_filename = $c->proxies_path_default.'/'.$proxy_name.".class.php"; if (file_exists($proxy_filename)) require_once($proxy_filename); else { - $proxy_filename = $c->proxys_path.'/'.$proxy_name.".class.php"; + $proxy_filename = $c->proxies_path.'/'.$proxy_name.".class.php"; if (file_exists($proxy_filename)) require_once($proxy_filename); } } Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-09-21 09:10:29 UTC (rev 779) +++ trunk/src/pfcglobalconfig.class.php 2006-09-21 12:13:24 UTC (rev 780) @@ -41,15 +41,15 @@ var $lockurl = "http://www.phpfreechat.net"; // this is the url where the users must be redirected when the chat is locked // these parameters are static (cached) - var $skip_proxys = array(); // these proxies will be skiped. ex: append "censor" to the list to disable words censoring - var $post_proxys = array(); // these proxies will be handled just before to process commands and just after system proxies - var $pre_proxys = array(); // these proxies will be handled before system proxies (at begining) - var $proxys_cfg = array("auth" => array(), + var $skip_proxies = array(); // these proxies will be skiped. ex: append "censor" to the list to disable words censoring + var $post_proxies = array(); // these proxies will be handled just before to process commands and just after system proxies + var $pre_proxies = array(); // these proxies will be handled before system proxies (at begining) + var $proxies_cfg = array("auth" => array(), "noflood" => array("limit"=>10,"delay"=>5), "censor" => array("words"=>array("fuck","sex","bitch"),"replaceby"=>"*"), "log" => array("path"=>"")); - var $proxys_path = ""; // a custom proxies path - var $proxys_path_default = ""; // dirname(__FILE__).'/proxys' + var $proxies_path = ""; // a custom proxies path + var $proxies_path_default = ""; // dirname(__FILE__).'/proxies' var $title = ""; // default is _pfc("My Chat") var $channels = array(); // the default joined channels when opening the chat var $frozen_channels = array(); // if empty, allows users to create there own channels @@ -109,8 +109,8 @@ var $debugxajax = false; // private parameters - var $_sys_proxys = array("lock", "checktimeout", "checknickchange", "auth", "noflood", "censor", "log"); - var $_proxys = array(); // will contains proxies to execute on each command (filled in the init step) + var $_sys_proxies = array("lock", "checktimeout", "checknickchange", "auth", "noflood", "censor", "log"); + var $_proxies = array(); // will contains proxies to execute on each command (filled in the init step) var $_dyn_params = array("nick","isadmin","islocked","admins","frozen_channels"); var $_params_type = array(); @@ -168,11 +168,11 @@ if (preg_match('/^_/',$k)) $this->errors[] = _pfc("Error: '%s' is a private parameter, you are not allowed to change it", $k); - if ($k == "proxys_cfg") + if ($k == "proxies_cfg") { // don't replace all the proxy_cfg parameters, just replace the specified ones - foreach ( $params["proxys_cfg"] as $k2 => $v2 ) - $this->proxys_cfg[$k2] = $v2; + foreach ( $params["proxies_cfg"] as $k2 => $v2 ) + $this->proxies_cfg[$k2] = $v2; } else $this->$k = $v; @@ -399,30 +399,30 @@ // calculate the proxies chaine - $this->_proxys = array(); - foreach($this->pre_proxys as $px) + $this->_proxies = array(); + foreach($this->pre_proxies as $px) { - if (!in_array($px,$this->skip_proxys) && !in_array($px,$this->_proxys)) - $this->_proxys[] = $px; + if (!in_array($px,$this->skip_proxies) && !in_array($px,$this->_proxies)) + $this->_proxies[] = $px; } - foreach($this->_sys_proxys as $px) + foreach($this->_sys_proxies as $px) { - if (!in_array($px,$this->skip_proxys) && !in_array($px,$this->_proxys)) - $this->_proxys[] = $px; + if (!in_array($px,$this->skip_proxies) && !in_array($px,$this->_proxies)) + $this->_proxies[] = $px; } - foreach($this->post_proxys as $px) + foreach($this->post_proxies as $px) { - if (!in_array($px,$this->skip_proxys) && !in_array($px,$this->_proxys)) - $this->_proxys[] = $px; + if (!in_array($px,$this->skip_proxies) && !in_array($px,$this->_proxies)) + $this->_proxies[] = $px; } // save the proxies path - $this->proxys_path_default = dirname(__FILE__).'/proxys'; + $this->proxies_path_default = dirname(__FILE__).'/proxies'; // check the customized proxies path - if ($this->proxys_path != '' && !is_dir($this->proxys_path)) - $this->errors[] = _pfc("'%s' directory doesn't exist", $this->proxys_path); + if ($this->proxies_path != '' && !is_dir($this->proxies_path)) + $this->errors[] = _pfc("'%s' directory doesn't exist", $this->proxies_path); // load smileys from file $this->loadSmileyTheme(); Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-09-21 09:10:29 UTC (rev 779) +++ trunk/src/pfci18n.class.php 2006-09-21 12:13:24 UTC (rev 780) @@ -137,7 +137,7 @@ $files = array_merge($files, glob(dirname(__FILE__)."/*.php")); $files = array_merge($files, glob(dirname(__FILE__)."/commands/*.php")); $files = array_merge($files, glob(dirname(__FILE__)."/containers/*.php")); - $files = array_merge($files, glob(dirname(__FILE__)."/proxys/*.php")); + $files = array_merge($files, glob(dirname(__FILE__)."/proxies/*.php")); $files = array_merge($files, glob(dirname(__FILE__)."/../themes/default/templates/*.php")); $res = array(); Copied: trunk/src/proxies (from rev 779, trunk/src/proxys) Modified: trunk/src/proxies/censor.class.php =================================================================== --- trunk/src/proxys/censor.class.php 2006-09-21 09:10:29 UTC (rev 779) +++ trunk/src/proxies/censor.class.php 2006-09-21 12:13:24 UTC (rev 780) @@ -44,8 +44,8 @@ $cmdtocheck = array("send", "nick", "me"); if ( in_array($this->name, $cmdtocheck) ) { - $words = $c->proxys_cfg[$this->proxyname]["words"]; - $replaceby = $c->proxys_cfg[$this->proxyname]["replaceby"]; + $words = $c->proxies_cfg[$this->proxyname]["words"]; + $replaceby = $c->proxies_cfg[$this->proxyname]["replaceby"]; $patterns = array(); $replacements = array(); Modified: trunk/src/proxies/log.class.php =================================================================== --- trunk/src/proxys/log.class.php 2006-09-21 09:10:29 UTC (rev 779) +++ trunk/src/proxies/log.class.php 2006-09-21 12:13:24 UTC (rev 780) @@ -43,8 +43,8 @@ $c =& $this->c; $u =& $this->u; - $logpath = ($c->proxys_cfg[$this->proxyname]["path"] == "" ? $c->data_private_path."/logs" : - $c->proxys_cfg[$this->proxyname]["path"]); + $logpath = ($c->proxies_cfg[$this->proxyname]["path"] == "" ? $c->data_private_path."/logs" : + $c->proxies_cfg[$this->proxyname]["path"]); $logpath .= "/".$c->getId(); if (!file_exists($logpath)) @mkdir_r($logpath); Modified: trunk/src/proxies/noflood.class.php =================================================================== --- trunk/src/proxys/noflood.class.php 2006-09-21 09:10:29 UTC (rev 779) +++ trunk/src/proxies/noflood.class.php 2006-09-21 12:13:24 UTC (rev 780) @@ -51,12 +51,12 @@ $nbflood = $container->getUserMeta($nickid, 'nbflood'); $floodtime = time(); - if ($floodtime - $lastfloodtime <= $c->proxys_cfg[$this->proxyname]["delay"]) + if ($floodtime - $lastfloodtime <= $c->proxies_cfg[$this->proxyname]["delay"]) $nbflood++; else $nbflood = 0; - if ($nbflood>$c->proxys_cfg[$this->proxyname]["limit"]) + if ($nbflood>$c->proxies_cfg[$this->proxyname]["limit"]) { // warn the flooder $msg = _pfc("Please don't post so many message, flood is not tolerated"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |