[Phpfreechat-svn] SF.net SVN: phpfreechat: [553] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-07 20:07:33
|
Revision: 553 Author: kerphi Date: 2006-06-06 10:34:11 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=553&view=rev Log Message: ----------- New feature: add a new parameter "frozen_channels" which is a list of channels users are allowed to join. Modified Paths: -------------- trunk/i18n/en_US/main.php trunk/i18n/fr_FR/main.php trunk/src/pfcglobalconfig.class.php trunk/src/proxys/auth.class.php trunk/themes/default/templates/pfcclient.js.tpl.php Modified: trunk/i18n/en_US/main.php =================================================================== --- trunk/i18n/en_US/main.php 2006-06-06 17:21:08 UTC (rev 552) +++ trunk/i18n/en_US/main.php 2006-06-06 17:34:11 UTC (rev 553) @@ -234,4 +234,7 @@ // line 79 in auth.class.php $GLOBALS["i18n"]["You are not allowed to change your nickname"] = "You are not allowed to change your nickname"; +// line 76 in auth.class.php +$GLOBALS["i18n"]["Can't join %s because the channels list is restricted"] = "Can't join %s because the channels list is restricted"; + ?> \ No newline at end of file Modified: trunk/i18n/fr_FR/main.php =================================================================== --- trunk/i18n/fr_FR/main.php 2006-06-06 17:21:08 UTC (rev 552) +++ trunk/i18n/fr_FR/main.php 2006-06-06 17:34:11 UTC (rev 553) @@ -234,4 +234,7 @@ // line 79 in auth.class.php $GLOBALS["i18n"]["You are not allowed to change your nickname"] = "Vous n'êtes pas autorisé à changer votre pseudonyme"; +// line 76 in auth.class.php +$GLOBALS["i18n"]["Can't join %s because the channels list is restricted"] = "Vous ne pouvez pas rejoindre %s car il n'est pas dans la liste des salons autorisés"; + ?> \ No newline at end of file Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-06-06 17:21:08 UTC (rev 552) +++ trunk/src/pfcglobalconfig.class.php 2006-06-06 17:34:11 UTC (rev 553) @@ -40,7 +40,7 @@ var $proxys = array("auth"); var $title = ""; // default is _pfc("My Chat") var $channels = array(); // the default joined channels when opening the chat - var $privmsg = array(); // the default privmsg chat to lauch when opening the chat + var $frozen_channels = array(); // by default allow users to create there own channels var $frozen_nick = false; var $max_nick_len = 15; var $max_text_len = 400; Modified: trunk/src/proxys/auth.class.php =================================================================== --- trunk/src/proxys/auth.class.php 2006-06-06 17:21:08 UTC (rev 552) +++ trunk/src/proxys/auth.class.php 2006-06-06 17:34:11 UTC (rev 553) @@ -49,25 +49,35 @@ } } - // protect channel from the banished users + // channels protection if ($this->name == "join") { - // check the user is not listed in the banished channel list $container =& $c->getContainerInstance(); $channame = $param; + + // check the user is not listed in the banished channel list $chanid = pfcCommand_join::GetRecipientId($channame); $banlist = $container->getMeta("banlist_nickid", "channel", $chanid); if ($banlist == NULL) $banlist = array(); else $banlist = unserialize($banlist); - $nickid = $container->getNickId($u->nick); if (in_array($nickid,$banlist)) { - // the user is banished, show a message and don't forward the /join command $msg = _pfc("Can't join %s because you are banished", $param); $xml_reponse->addScript("pfc.handleResponse('".$this->proxyname."', 'ban', '".addslashes($msg)."');"); return; } + + if (count($c->frozen_channels)>0) + { + if (!in_array($channame,$c->frozen_channels)) + { + // the user is banished, show a message and don't forward the /join command + $msg = _pfc("Can't join %s because the channels list is restricted", $param); + $xml_reponse->addScript("pfc.handleResponse('".$this->proxyname."', 'frozen', '".addslashes($msg)."');"); + return; + } + } } // disallow to change nickname if frozen_nick is true Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-06 17:21:08 UTC (rev 552) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-06 17:34:11 UTC (rev 553) @@ -388,6 +388,10 @@ { alert(param); } + if (resp == "frozen") + { + alert(param); + } else if (resp == "nick") { this.displayMsg( cmd, param ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |