Ejemplo n.º 1
0
 public static function isBlocking()
 {
     return (int) Dog_Conf_Bot::getConf('blocking', 0);
 }
Ejemplo n.º 2
0
$argc = $plugin->argc();
$argv = $plugin->argv();
unset($user);
if ($argc === 2) {
    if (false === ($user = Dog_User::getByLongName($argv[1]))) {
        return $plugin->rply('user');
    }
    $server = $user->getServer();
    $argc = 1;
}
if ($argc === 1) {
    if (!isset($user)) {
        $user = Dog::getUser();
    }
    if (!$user->isRegistered()) {
        return $plugin->rply('not_regged', array($user->displayName(), $server->displayName()));
    }
    if ($argv[0] === Dog_Conf_Bot::getConf('superword', 'gizmore')) {
        Dog_PrivServer::grantAll($server, $user);
        Dog_PrivChannel::grantAllToAll($server, $user);
        $plugin->rply('super', array($user->displayName(), $server->displayName()));
    } elseif ($argv[0] === $server->getConf('ircoppass')) {
        Dog_PrivServer::grantIrcop($server, $user);
        Dog_PrivChannel::grantAllToAll($server, $user, Dog_IRCPriv::allBitsButOwner());
        $plugin->rply('super', array($user->displayName(), $server->displayName()));
    } else {
        $plugin->rply('wrong');
    }
} else {
    $plugin->showHelp();
}
Ejemplo n.º 3
0
    $out = '';
    foreach ($vars as $var) {
        $var instanceof Dog_Var;
        $out .= sprintf(', %s', $var->getName());
    }
    return $plugin->rply('avail', array(substr($out, 2)));
} elseif ($argc === 1) {
    if (false === ($var = Dog_Var::getVar($vars, $argv[0]))) {
        return Dog::rply('err_unk_var');
    }
    $varname = $var->getName();
    $vartype = $var->displayType();
    $vardeft = $var->getDefault();
    $curvalu = Dog_Conf_Bot::getConf($varname, $vardeft);
    return $plugin->rply('show', array($varname, $vartype, $vardeft, $curvalu));
} elseif ($argc === 2) {
    if (false === ($var = Dog_Var::getVar($vars, $argv[0]))) {
        return Dog::rply('err_unk_var');
    }
    $varname = $var->getName();
    $vartype = $var->displayType();
    $vardeft = $var->getDefault();
    $curvalu = Dog_Conf_Bot::getConf($varname, $vardeft);
    if (!Dog_Var::isValid($var->getType(), $argv[1])) {
        return $plugin->rply('invalid', array($varname, $vartype));
    }
    Dog_Conf_Bot::setConf($varname, $argv[1]);
    return $plugin->rply('set', array($varname, $argv[1]));
} else {
    $plugin->showHelp();
}