if ($reg->autoOpsAll()) { $bot->op($chan_name, $user->getNumeric()); } elseif ($reg->autoVoicesAll()) { $bot->voice($chan_name, $user->getNumeric()); } $reg->setLastActivityTime(time()); if ($reg->autoTopic() && time() - $reg->getLastAutoTopicTime() >= 30 * 60) { $bot->topic($chan_name, $reg->getDefaultTopic()); $reg->setLastTopic($reg->getDefaultTopic()); $reg->setLastAutoTopicTime(time()); } } } if ($user->isLoggedIn() && ($account = $this->getAccount($user->getAccountName())) && $reg && !$kicked) { if ($lev = $this->getChannelAccess($chan_name, $user)) { $level = $lev->getLevel(); if ($level >= 100 && $account->autoOps() && $reg->autoOps() && $lev->autoOps()) { $bot->op($chan_name, $user->getNumeric()); $opped = true; } elseif ($level >= 1 && $account->autoVoices() && $reg->autoVoices() && $lev->autoVoices()) { $bot->voice($chan_name, $user->getNumeric()); $voiced = true; } if ($account->hasInfoLine() && $reg->showsInfoLines()) { $infoline = irc_sprintf('[%U] %s', $account, $account->getInfoLine()); } } if (!empty($infoline)) { $bot->message($chan_name, $infoline); } }
$new_gl = $this->addGline($gline_mask, $gline_secs, time(), CLONE_REASON); $this->enforceGline($new_gl); $gline_set = true; } if (defined('TOR_GLINE') && TOR_GLINE == true && !$gline_set && $this->isTorHost($user->getIp())) { $gline_mask = '*@' . $user->getIp(); $gline_secs = convertDuration(TOR_DURATION); $new_gl = $this->addGline($gline_mask, $gline_secs, time(), TOR_REASON); $this->enforceGline($new_gl); $gline_set = true; } if (defined('COMP_GLINE') && COMP_GLINE == true && !$gline_set && $this->isCompromisedHost($user->getIp())) { $gline_mask = '*@' . $user->getIp(); $gline_secs = convertDuration(COMP_DURATION); $new_gl = $this->addGline($gline_mask, $gline_secs, time(), COMP_REASON); $this->enforceGline($new_gl); $gline_set = true; } } // Don't log new users during the initial burst, as it could flood the log channel. if ($this->finished_burst) { if ($is_new_user) { // new user $server = $this->getServer($args[0]); $rest = irc_sprintf('%H (%s@%s) [%s]', $user, $user->getIdent(), $user->getHost(), $user->getName()); $this->reportEvent('NICK', $server, $rest); } else { // nick change $this->reportEvent('NICK', $old_nick, $new_nick); } }
function reportCommand($user, $args) { if (!defined('REPORT_COMMANDS') || !REPORT_COMMANDS || !defined('COMMAND_CHANNEL')) { return; } $command = array_shift($args); $log_msg = irc_sprintf('[%' . NICK_LEN . 'H] %s%s%s %A', $user, BOLD_START, $command, BOLD_END, $args); $this->default_bot->message(COMMAND_CHANNEL, $log_msg); }
function performGline($gline_mask, $gline_duration, $gline_reason) { if (defined('OS_GLINE') && OS_GLINE == true && defined('OS_NICK')) { $oper_service = $this->getUserByNick(OS_NICK); $gline_command = irc_sprintf('GLINE %s %s %s', $gline_mask, $gline_duration, $gline_reason); if (!$oper_service) { $pending_commands[] = $gline_command; return; } $this->default_bot->message($oper_service, $gline_command); } else { $gline_secs = convertDuration($gline_duration); $new_gl = $this->addGline($gline_mask, $gline_secs, time(), $gline_reason); $this->enforceGline($new_gl); } }