当前位置: 首页>>代码示例>>PHP>>正文


PHP core::search_nick方法代码示例

本文整理汇总了PHP中core::search_nick方法的典型用法代码示例。如果您正苦于以下问题:PHP core::search_nick方法的具体用法?PHP core::search_nick怎么用?PHP core::search_nick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core的用法示例。


在下文中一共展示了core::search_nick方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: kick

 public static function kick($nick, $user, $chan, $reason = '')
 {
     $urow = core::search_nick($user);
     if ($urow['server'] != core::$config->server->name) {
         core::alog('kick(): ' . $nick . ' kicked ' . $user . ' from ' . $chan, 'BASIC');
         // debug info
         self::send(':' . $nick . ' KICK ' . $chan . ' ' . $user . ' :' . $reason);
     }
 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:9,代码来源:inspircd11.php

示例2: unban_command

 public static function unban_command($nick, $ircdata = array())
 {
     $chan = $ircdata[0];
     $who = $ircdata[1];
     // standard data here.
     if (self::check_channel($nick, $chan, 'UNBAN') === false) {
         return false;
     }
     // check if the channel exists and stuff
     if (chanserv::check_levels($nick, $chan, array('r', 'F')) === false) {
         services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
         return false;
     }
     // do they have access?
     if (strpos($ircdata[1], '@') === false && ($user = core::search_nick($ircdata[1]))) {
         ircd::mode(core::$config->chanserv->nick, $chan, '-b *@' . $user['host']);
     } else {
         ircd::mode(core::$config->chanserv->nick, $chan, '-b ' . $ircdata[1]);
     }
     // -b
 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:21,代码来源:xcommands.cs.php

示例3: levels_command


//.........这里部分代码省略.........
         } elseif ($flag == 'a' && ircd::$protect) {
             if (chanserv::check_levels($nick, $chan, array('q', 'f', 'F')) === false) {
                 services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
                 return false;
             }
             // do they have access to alter this?
             self::set_flag($nick, $chan, $target, '-a');
             // -a the target in question
         } elseif ($flag == 'q' && ircd::$owner) {
             if (chanserv::check_levels($nick, $chan, array('f', 'F')) === false) {
                 services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
                 return false;
             }
             // do they have access to alter this?
             self::set_flag($nick, $chan, $target, '-q');
             // -q the target in question
         } elseif ($flag == 's') {
             if (chanserv::check_levels($nick, $chan, array('F')) === false) {
                 services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
                 return false;
             }
             // do they have access to alter this?
             self::set_flag($nick, $chan, $target, '-s');
             // -s the target in question
         } elseif ($flag == 'r') {
             if (chanserv::check_levels($nick, $chan, array('F')) === false) {
                 services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
                 return false;
             }
             // do they have access to alter this?
             self::set_flag($nick, $chan, $target, '-r');
             // -r the target in question
         } elseif ($flag == 'r') {
             if (chanserv::check_levels($nick, $chan, array('F')) === false) {
                 services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
                 return false;
             }
             // do they have access to alter this?
             self::set_flag($nick, $chan, $target, '-r');
             // -r the target in question
         } elseif ($flag == 'f') {
             if (chanserv::check_levels($nick, $chan, array('F')) === false) {
                 services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
                 return false;
             }
             // do they have access to alter this?
             self::set_flag($nick, $chan, $target, '-f');
             // -f the target in question
         } elseif ($flag == 't') {
             if (chanserv::check_levels($nick, $chan, array('F')) === false) {
                 services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
                 return false;
             }
             // do they have access to alter this?
             self::set_flag($nick, $chan, $target, '-t');
             // -t the target in question
         } elseif ($flag == 'F') {
             if (chanserv::check_levels($nick, $chan, array('F')) === false) {
                 services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
                 return false;
             }
             // do they have access to alter this?
             self::set_flag($nick, $chan, $target, '-F');
             // -F the target in question
         } elseif ($flag == 'b') {
             if (chanserv::check_levels($nick, $chan, array('r', 'F')) === false) {
                 services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_ACCESS_DENIED);
                 return false;
             }
             // do they have access to alter this?
             if (self::set_flag($nick, $chan, $target, '-b') !== false) {
                 if (strpos($target, '@') === false && ($user = core::search_nick($target))) {
                     ircd::mode(core::$config->chanserv->nick, $chan, '-b *@' . $user['host']);
                 } else {
                     ircd::mode(core::$config->chanserv->nick, $chan, '-b ' . $target);
                 }
                 // is the hostname in our cache? if not unban it..
             }
             // -b the target in question
         }
         // ----------- -b ----------- //
     }
     // loop through the minus flags
     if (isset(self::$set[$target])) {
         services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_LEVELS_SET, array('target' => $target, 'flag' => self::$set[$target], 'chan' => $chan));
         // who do we notice?
         unset(self::$set[$target]);
     }
     // send back the target stuff..
     if (isset(self::$already_set[$target])) {
         services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_LEVELS_ALREADY_SET, array('target' => $target, 'flag' => self::$already_set[$target], 'chan' => $chan));
         unset(self::$already_set[$target]);
     }
     // send back the target stuff..
     if (isset(self::$not_set[$target])) {
         services::communicate(core::$config->chanserv->nick, $nick, &chanserv::$help->CS_LEVELS_NOT_SET, array('target' => $target, 'flag' => self::$not_set[$target], 'chan' => $chan));
         unset(self::$not_set[$target]);
     }
     // send back the target stuff..
 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:101,代码来源:levels.cs.php

示例4: main


//.........这里部分代码省略.........
         // !mode command
         if (commands::on_fantasy_cmd(&$ircdata, 'kick', core::$config->chanserv->nick)) {
             if (chanserv::check_levels($nick, $channel->channel, array('r', 'F')) === false) {
                 return false;
             }
             // ignore if the nick doesn't have access to perform this
             if (isset($ircdata[4])) {
                 if (chanserv::check_levels($nick, $channel->channel, array('o', 'F')) && chanserv::check_levels($nick, $channel->channel, array('o', 'F')) === false) {
                     return false;
                 }
                 // check if the user kicking, has the access to kick them. that doesn't make sense, but yeah.
                 if (isset($ircdata[5])) {
                     $reason = core::get_data_after(&$ircdata, 5);
                     ircd::kick(core::$config->chanserv->nick, $ircdata[4], $chan, '(' . $nick . ') ' . ($reason != '') ? $reason : 'No reason');
                     // kick them with the reason
                 } else {
                     ircd::kick(core::$config->chanserv->nick, $ircdata[4], $chan, $nick);
                     // kick them with no reason
                 }
             }
             // make sure a parameter is issued
         }
         // !kick command
         if (commands::on_fantasy_cmd(&$ircdata, 'kickban', core::$config->chanserv->nick)) {
             if (chanserv::check_levels($nick, $channel->channel, array('r', 'F')) === false) {
                 return false;
             }
             // ignore if the nick doesn't have access to perform this
             if (isset($ircdata[4])) {
                 if (chanserv::check_levels($nick, $channel->channel, array('o', 'F')) && chanserv::check_levels($nick, $channel->channel, array('o', 'F')) === false) {
                     return false;
                 }
                 // check if the user kicking, has the access to kick them. that doesn't make sense, but yeah.
                 if ($user = core::search_nick($ircdata[4])) {
                     ircd::mode(core::$config->chanserv->nick, $chan, '+b *@' . $user['host']);
                     if (isset($ircdata[5])) {
                         $reason = core::get_data_after(&$ircdata, 5);
                         ircd::kick(core::$config->chanserv->nick, $ircdata[4], $chan, '(' . $nick . ') ' . ($reason != '') ? $reason : 'No reason');
                         // kick them with the reason
                     } else {
                         ircd::kick(core::$config->chanserv->nick, $ircdata[4], $chan, $nick);
                         // kick them with no reason
                     }
                     // check if there is a reason etc.
                 } else {
                     return false;
                 }
             }
             // make sure a parameter is issued
         }
         // !ban command
         if (commands::on_fantasy_cmd(&$ircdata, 'ban', core::$config->chanserv->nick)) {
             if (chanserv::check_levels($nick, $channel->channel, array('r', 'F')) === false) {
                 return false;
             }
             // ignore if the nick doesn't have access to perform this
             if (isset($ircdata[4])) {
                 if (chanserv::check_levels($nick, $channel->channel, array('o', 'F')) && chanserv::check_levels($nick, $channel->channel, array('o', 'F')) === false) {
                     return false;
                 }
                 // check if the user kicking, has the access to kick them. that doesn't make sense, but yeah.
                 if (strpos($ircdata[4], '@') === false && ($user = core::search_nick($ircdata[4]))) {
                     ircd::mode(core::$config->chanserv->nick, $chan, '+b *@' . $user['host']);
                 } else {
                     ircd::mode(core::$config->chanserv->nick, $chan, '+b ' . $ircdata[4]);
                 }
开发者ID:rickihastings,项目名称:acorairc,代码行数:67,代码来源:fantasy.cs.php


注:本文中的core::search_nick方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。