當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dog::noPermission方法代碼示例

本文整理匯總了PHP中Dog::noPermission方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dog::noPermission方法的具體用法?PHP Dog::noPermission怎麽用?PHP Dog::noPermission使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dog的用法示例。


在下文中一共展示了Dog::noPermission方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

        }
    } else {
        if (NULL !== ($t = $serv->getTriggers())) {
            $plugin->rply('serv', array($t));
        } else {
            $plugin->rply('serv_by_bot', array(Dog_Init::getTriggers()));
        }
    }
} elseif ($argc === 1) {
    if ($chan !== false) {
        if ($argv[0] === 'default') {
            $chan->saveVar('chan_triggers', NULL);
            $plugin->rply('chan_to_default');
        } else {
            $chan->saveVar('chan_triggers', $argv[0]);
            $plugin->rply('chan_to', array($argv[0]));
        }
    } else {
        if (!Dog::hasPermission($serv, false, $user, 'i')) {
            Dog::noPermission('i');
        } elseif ($argv[0] === 'default') {
            $serv->saveVar('serv_triggers', NULL);
            $plugin->rply('serv_to_default');
        } else {
            $serv->saveVar('serv_triggers', $argv[0]);
            $plugin->rply('serv_to', array($argv[0]));
        }
    }
} else {
    $plugin->showHelp();
}
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:31,代碼來源:triggers_Ab.php

示例2: setVar

 public static function setVar(array $vars, $scope = NULL, $varname, $value)
 {
     if (false === ($var = self::getVar($vars, $varname, $scope))) {
         Dog::rply('err_unk_var');
     } elseif (!self::isValid($var->getType(), $value)) {
         Dog::rply('err_variabl', array($var->displayName(), $varname, $var->displayType()));
     } elseif (!$var->hasPermission(Dog::getServer(), Dog::getChannel(), Dog::getUser())) {
         Dog::noPermission($var->getPriv());
     } elseif (false === ($oldval = $var->getValue())) {
         Dog::err('ERR_DATABASE', array(__FILE__, __LINE__));
     } elseif (!$var->setValue($value)) {
         Dog::err('ERR_DATABASE', array(__FILE__, __LINE__));
     } else {
         Dog::rply('msg_set_var', array($var->displayName(), $varname, $oldval, $var->getValue()));
     }
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:16,代碼來源:Dog_Var.php

示例3: array

<?php

$lang = array('en' => array('help' => 'Usage: %CMD% [<channel>[!<SID>]]. Command %BOT% to leave a channel. IRCOps can utilize this across networks.', 'not_there' => 'The channel you are trying to leave ist not occupied by %BOT% at all.', 'parting' => 'I am leaving %s now, and won´t come back on my own.'), 'de' => array('help' => 'Nutze: %CMD% [<Kanal>[!<SID>]]. Befehle %BOT% einen Kanal zu verlassen. IRCOps können dies Netzwerkübergreifend erledigen.', 'not_there' => 'Der Kanal den Du verlassen möchtest wird ist %BOT% zur Zeit unbekannt.', 'parting' => 'Ich verlasse nun %s und komme auch nicht von selbst wieder.'));
$plugin = Dog::getPlugin();
$serv = Dog::getServer();
$user = Dog::getUser();
$argv = $plugin->argv();
$argc = count($argv);
if ($argc === 0) {
    if (false === ($channel = Dog::getChannel())) {
        return $plugin->showHelp();
    }
} elseif ($argc === 1) {
    if (false === ($channel = Dog::getOrLoadChannelByArg($argv[0]))) {
        return Dog::rply('err_channel');
    }
    if ($channel->getSID() !== $serv->getID()) {
        if (!Dog::hasPermission($serv, false, $user, 'i')) {
            return Dog::noPermission('i');
        }
    }
} else {
    return $plugin->showHelp();
}
# Do it!
$channel->saveOption(Dog_Channel::AUTO_JOIN, false);
$plugin->rply('parting', array($channel->displayLongName()));
$serv->partChannel($channel);
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:28,代碼來源:part_Ab.php

示例4: on_autojoin_Ac

 public function on_autojoin_Ac()
 {
     $user = Dog::getUser();
     $server = Dog::getServer();
     $argv = $this->argv();
     $argc = count($argv);
     # Invoked in channel.
     switch ($argc) {
         # .autojoin
         case 0:
             return $this->showStatus($channel);
             # .autojoin on|#channel
         # .autojoin on|#channel
         case 1:
             if (Dog_Var::isValid('b', $argv[0])) {
                 return $this->setEnabled($channel, Dog_Var::parseValue('b', $argv[0]));
             } elseif (false === ($channel = Dog::getOrLoadChannelByArg($argv[0]))) {
                 return Dog::rply('err_channel');
             } else {
                 return $this->showStatus($channel);
             }
             # .autojoin #wechall on
         # .autojoin #wechall on
         case 2:
             if (false === ($channel = Dog::getOrLoadChannelByArg($argv[0]))) {
                 return Dog::rply('err_channel');
             }
             if (!Dog::hasPermission($server, $channel, $user, 'A')) {
                 return Dog::noPermission('s');
             }
             return $this->setEnabled($channel, Dog_Var::parseValue('b', $argv[1]));
     }
     $this->showHelp('autojoin');
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:34,代碼來源:DOGMOD_AutoJoin.php


注:本文中的Dog::noPermission方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。