1<?php
2
3require_once(dirname(__FILE__)."/../pfccommand.class.php");
4
5class pfcCommand_op extends pfcCommand
6{
7  var $usage = "/op {nickname}";
8
9  function run(&$xml_reponse, $p)
10  {
11    $clientid    = $p["clientid"];
12    $param       = $p["param"];
13    $sender      = $p["sender"];
14    $recipient   = $p["recipient"];
15    $recipientid = $p["recipientid"];
16
17    $c  =& pfcGlobalConfig::Instance();
18    $u  =& pfcUserConfig::Instance();
19    $ct =& pfcContainer::Instance();
20
21    if (trim($param) == "")
22    {
23      // error
24      $cmdp = $p;
25      $cmdp["param"] = _pfc("Missing parameter");
26      $cmdp["param"] .= " (".$this->usage.")";
27      $cmd =& pfcCommand::Factory("error");
28      $cmd->run($xml_reponse, $cmdp);
29      return;
30    }
31
32    // just change the "isadmin" meta flag
33    $nicktoop   = trim($param);
34    $nicktoopid = $ct->getNickId($nicktoop);
35    $ct->setUserMeta($nicktoopid, 'isadmin', true);
36
37    $this->forceWhoisReload($nicktoopid);
38  }
39}
40
41?>