public function priv_admin($line, $args) { if ($args['nargs'] < 2) { return; } if ($this->ircClass->getClientConf('dccadminpass') == "") { return; } if (md5($args['arg1']) != $this->ircClass->getClientConf('dccadminpass')) { return; } $query = substr($args['query'], strlen($args['arg1']) + 1); $myArgs = parser::createLine($query); switch ($args['arg2']) { case "chatme": $port = $this->dccClass->addChat($line['fromNick'], null, null, true, null); if ($port === false) { $this->ircClass->notice($line['fromNick'], "Error starting chat, please try again.", 1); } break; default: $chat = new chat_wrapper($line['fromNick'], $this->ircClass); $cmdList = $this->parserClass->getCmdList(); $cmdLower = $myArgs['cmd']; if (isset($cmdList['dcc'][$cmdLower])) { if ($myArgs['nargs'] < $cmdList['dcc'][$cmdLower]['numArgs']) { $chat->dccSend("Usage: " . $cmdLower . " " . $cmdList['dcc'][$cmdLower]['usage']); break; } $module = $cmdList['dcc'][$cmdLower]['module']; $class = $cmdList['file'][$module]['class']; $func = $cmdList['dcc'][$cmdLower]['function']; $class->{$func}($chat, $myArgs); $chat->dccSend("ADMIN " . irc::myStrToUpper($cmdLower) . " Requested"); } else { $chat->dccSend("Invalid Command: " . $myArgs['cmd']); } break; } }
private function doCallback() { if ($this->line != null && is_array($this->line) && isset($this->line['text'])) { $lineArgs = parser::createLine($this->line['text']); } else { $lineArgs = array(); } $func = $this->function; $this->class->{$func}($this->line, $lineArgs, $this->type, $this->response); }