[Phpfreechat-svn] SF.net SVN: phpfreechat: [853] trunk/src/commands/redirect.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-10-29 17:22:08
|
Revision: 853 http://svn.sourceforge.net/phpfreechat/?rev=853&view=rev Author: kerphi Date: 2006-10-29 09:21:57 -0800 (Sun, 29 Oct 2006) Log Message: ----------- [en] Bug fix: add the '/redirect' command used to redirect to an url (used internaly) [10min] [fr] Bug fix : ajout de la commande '/redirect' qui permet de rediriger vers une url (utilisation interne) [10min] Added Paths: ----------- trunk/src/commands/redirect.class.php Added: trunk/src/commands/redirect.class.php =================================================================== --- trunk/src/commands/redirect.class.php (rev 0) +++ trunk/src/commands/redirect.class.php 2006-10-29 17:21:57 UTC (rev 853) @@ -0,0 +1,34 @@ +<?php + +require_once(dirname(__FILE__)."/../pfccommand.class.php"); + +class pfcCommand_redirect extends pfcCommand +{ + var $usage = "/redirect url"; + + function run(&$xml_reponse, $p) + { + $clientid = $p["clientid"]; + $param = $p["param"]; + $sender = $p["sender"]; + $recipient = $p["recipient"]; + $recipientid = $p["recipientid"]; + + $c =& $this->c; + $u =& $this->u; + if (trim($param) == '') + { + // error + $cmdp = $p; + $cmdp["param"] = _pfc("Missing parameter"); + $cmdp["param"] .= " (".$this->usage.")"; + $cmd =& pfcCommand::Factory("error"); + $cmd->run($xml_reponse, $cmdp); + return; + } + + $xml_reponse->addRedirect($param); + } +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |