本文整理汇总了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);
}
}
示例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
}
示例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..
}
示例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]);
}