[Phpfreechat-svn] SF.net SVN: phpfreechat: [941] trunk/src/commands/invite.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2007-01-31 09:17:34
|
Revision: 941 http://svn.sourceforge.net/phpfreechat/?rev=941&view=rev Author: kerphi Date: 2007-01-31 01:17:33 -0800 (Wed, 31 Jan 2007) Log Message: ----------- [en] Bug fix: don't allow to invite people in a channel if the inviter is not already present in this channel [0h25] [fr] Bug fix : on n'autorise pas l'invitation dans un salon si l'inviteur n'est pas deja present dans ce salon [0h25] Modified Paths: -------------- trunk/src/commands/invite.class.php Modified: trunk/src/commands/invite.class.php =================================================================== --- trunk/src/commands/invite.class.php 2007-01-31 09:15:15 UTC (rev 940) +++ trunk/src/commands/invite.class.php 2007-01-31 09:17:33 UTC (rev 941) @@ -64,14 +64,25 @@ $cmd->run($xml_reponse, $cmdp); return; } + + // check that the inviter is already in the channeltarget + if ($ct->isNickOnline(pfcCommand_join::GetRecipient($channeltarget),$u->nickid) == -1) + { + $cmdp = $p; + $cmdp["params"] = array(); + $cmdp["param"] = _pfc("You must join %s to invite users in this channel",$channeltarget); + $cmd =& pfcCommand::Factory("error"); + $cmd->run($xml_reponse, $cmdp); + return; + } // inviting a user: just add a join command to play to the aimed user metadata. - $nickidtoinvite = $ct->getNickId($nicktoinvite); + $nicktoinvite_id = $ct->getNickId($nicktoinvite); $cmdstr = 'join2'; $cmdp = array(); $cmdp['param'] = $channeltarget; // channel target name $cmdp['params'][] = $channeltarget; // channel target name - pfcCommand::AppendCmdToPlay($nickidtoinvite, $cmdstr, $cmdp); + pfcCommand::AppendCmdToPlay($nicktoinvite_id, $cmdstr, $cmdp); // notify the aimed channel that a user has been invited $cmdp = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |