1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 07:25:42 +02:00

Added a new logging system

This commit is contained in:
Adam
2010-08-27 20:56:28 -04:00
parent 73fb94c553
commit c2ddecc2b1
119 changed files with 1516 additions and 1222 deletions
+75 -37
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -11,6 +11,7 @@ opertype:commands added nickserv/saset/* and chanserv/saset/*
options:socketengine added to choose what socket engine to use
module:cs_set_misc and module:ns_set_misc added to replace the old set url/icq/email modules
options:hideprivilegedcommands added to hide privileged commands from normal users
log block added to customize logging
** MODIFIED CONFIGURATION DIRECTIVES **
opertype:commands changed operserv/sgline to opserv/snline
@@ -21,6 +22,7 @@ operserv:notifications ossgline changed ossnline
** DELETED CONFIGURATION DIRECTIVES **
serverinfo:helpchannel removed because it has been readded in m_helpchan
networkinfo:logchannel, logbot, logusers, logmaxusers, and logchannel removed because of the log block
Anope Version 1.9.2
--------------------
+2
View File
@@ -23,6 +23,8 @@ enum BotFlag
{
BI_BEGIN,
/* This bot is a core bot. NickServ, ChanServ, etc */
BI_CORE,
/* This bot can only be assigned by IRCops */
BI_PRIVATE,
+3 -1
View File
@@ -57,7 +57,9 @@ enum ChannelFlags
/* Channel still exists when emptied */
CH_PERSIST,
/* If set the channel is syncing users (channel was just created) and it should not be deleted */
CH_SYNCING
CH_SYNCING,
/* Is a services log channel */
CH_LOGCHAN
};
class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
+5 -8
View File
@@ -465,8 +465,6 @@ class ServerConfig
/* The hostname if services clients */
Anope::string ServiceHost;
/* Log channel */
Anope::string LogChannel;
/* Name of the network were on */
Anope::string NetworkName;
/* The max legnth of nicks */
@@ -544,8 +542,6 @@ class ServerConfig
bool UseStrictPrivMsg;
/* Dump a core file if we crash */
bool DumpCore;
/* Log users connecting/existing/changing nicks */
bool LogUsers;
/* Number of seconds between consecutive uses of the REGISTER command
* Not to be confused with NSRegDelay */
unsigned NickRegDelay;
@@ -555,6 +551,8 @@ class ServerConfig
Anope::string MLock;
/* Default botmodes on channels, defaults to ao */
Anope::string BotModes;
/* THe actual modes */
std::vector<ChannelModeStatus *> BotModeList;
/* How many times to try and reconnect to the uplink before giving up */
unsigned MaxRetries;
/* How long to wait between connection attempts */
@@ -562,6 +560,9 @@ class ServerConfig
/* If services should hide unprivileged commands */
bool HidePrivilegedCommands;
/* A vector of our logfile options */
std::vector<LogInfo *> LogInfos;
/* Services can use email */
bool UseMail;
/* Path to the sendmail executable */
@@ -684,10 +685,6 @@ class ServerConfig
Anope::string GlobalOnCycleUP;
/* Super admin is allowed */
bool SuperAdmin;
/* Log things said through ACT/SAY */
bool LogBot;
/* Log when new user max is reached */
bool LogMaxUsers;
/* Default expiry time for akills */
time_t AutokillExpiry;
/* Default expiry time for chan kills */
+3 -12
View File
@@ -153,8 +153,7 @@ E void hostserv_init();
E void introduce_user(const Anope::string &user);
E bool GetCommandLineArgument(const Anope::string &name, char shortname = 0);
E bool GetCommandLineArgument(const Anope::string &name, char shortname, Anope::string &param);
E int init_primary(int ac, char **av);
E int init_secondary(int ac, char **av);
E void Init(int ac, char **av);
E Uplink *uplink_server;
/**** ircd.c ****/
@@ -177,13 +176,8 @@ E const char *getstring(const NickCore *nc, int index);
E const char *getstring(const User *nc, int index);
E const char *getstring(int index);
/**** log.c ****/
E int open_log();
E void close_log();
E void log_perror(const char *fmt, ...) FORMAT(printf, 1, 2);
E void fatal(const char *fmt, ...) FORMAT(printf, 1, 2);
E void fatal_perror(const char *fmt, ...) FORMAT(printf, 1, 2);
/*** logger.cpp ***/
E void InitLogChannels(ServerConfig *);
/**** main.c ****/
@@ -193,7 +187,6 @@ E Anope::string services_dir;
E Anope::string log_filename;
E int debug;
E bool readonly;
E bool LogChan;
E bool nofork;
E bool nothird;
E bool noexpire;
@@ -297,8 +290,6 @@ E unsigned GenericChannelModes, GenericUserModes;
E Flags<ChannelModeName> DefMLockOn;
E Flags<ChannelModeName> DefMLockOff;
E std::map<ChannelModeName, Anope::string> DefMLockParams;
/* Modes to set on bots when they join the channel */
E std::list<ChannelModeStatus *> BotModes;
E void SetDefaultMLock(ServerConfig *config);
/**** nickserv.c ****/
+100
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -66,7 +66,7 @@ if (true) \
} \
catch (const ModuleException &modexcept) \
{ \
Alog() << "Exception caught: " << modexcept.GetReason(); \
Log() << "Exception caught: " << modexcept.GetReason(); \
} \
_i = safei; \
} \
@@ -98,7 +98,7 @@ if (true) \
} \
catch (const ModuleException &modexcept) \
{ \
Alog() << "Exception caught: " << modexcept.GetReason(); \
Log() << "Exception caught: " << modexcept.GetReason(); \
} \
_i = safei; \
} \
+10 -31
View File
@@ -181,6 +181,7 @@ extern "C" void __pfnBkCheck() {}
/* Pull in the various bits of STL */
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <map>
@@ -253,6 +254,14 @@ class CoreException : public std::exception
}
};
class FatalException : public CoreException
{
public:
FatalException(const Anope::string &reason = "") : CoreException(reason) { }
virtual ~FatalException() throw() { }
};
class ModuleException : public CoreException
{
public:
@@ -939,6 +948,7 @@ class ServerConfig;
#include "operserv.h"
#include "mail.h"
#include "servers.h"
#include "logger.h"
#include "config.h"
class CoreExport IRCDProto
@@ -1039,10 +1049,6 @@ class CoreExport IRCDProto
virtual void SetAutoIdentificationToken(User *u) { }
};
class IRCDTS6Proto : public IRCDProto
{
};
/*************************************************************************/
struct Uplink
@@ -1055,33 +1061,6 @@ struct Uplink
Uplink(const Anope::string &_host, int _port, const Anope::string &_password, bool _ipv6) : host(_host), port(_port), password(_password), ipv6(_ipv6) { }
};
enum LogLevel
{
LOG_NORMAL,
LOG_TERMINAL,
LOG_DEBUG,
LOG_DEBUG_2,
LOG_DEBUG_3,
LOG_DEBUG_4
};
class CoreExport Alog
{
private:
std::stringstream buf;
LogLevel Level;
public:
Alog(LogLevel val = LOG_NORMAL);
~Alog();
template<typename T> Alog &operator<<(T val)
{
buf << val;
return *this;
}
};
/*************************************************************************/
#include "timers.h"
/** Timer for colliding nicks to force people off of nicknames
+5 -3
View File
@@ -76,10 +76,12 @@ class CoreExport User : public Extensible
/** Create a new user object, initialising necessary fields and
* adds it to the hash
*
* @param nick The nickname of the user.
* @param uid The unique identifier of the user.
* @param snick The nickname of the user.
* @param sident The username of the user
* @param shost The hostname of the user
* @param suid The unique identifier of the user.
*/
User(const Anope::string &nick, const Anope::string &uid);
User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &suid);
/** Destroy a user.
*/
+4 -2
View File
@@ -49,8 +49,10 @@ class CommandBSAct : public Command
ircdproto->SendAction(ci->bi, ci->name, "%s", message.c_str());
ci->bi->lastmsg = time(NULL);
if (Config->LogBot && !Config->LogChannel.empty() && LogChan && !debug && findchan(Config->LogChannel))
ircdproto->SendPrivmsg(ci->bi, Config->LogChannel, "ACT %s %s %s", u->nick.c_str(), ci->name.c_str(), message.c_str());
// XXX Need to be able to find if someone is overriding this.
Log(LOG_COMMAND, u, this, ci) << message;
return MOD_CONT;
}
+3
View File
@@ -59,6 +59,9 @@ class CommandBSAssign : public Command
return MOD_CONT;
}
bool override = !check_access(u, ci, CA_ASSIGN);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "for " << bi->nick;
bi->Assign(u, ci);
notice_lang(Config->s_BotServ, u, BOT_ASSIGN_ASSIGNED, bi->nick.c_str(), ci->name.c_str());
return MOD_CONT;
+17 -2
View File
@@ -53,10 +53,14 @@ class BadwordsDelCallback : public NumberList
{
User *u;
ChannelInfo *ci;
Command *c;
unsigned Deleted;
bool override;
public:
BadwordsDelCallback(User *_u, ChannelInfo *_ci, const Anope::string &list) : NumberList(list, true), u(_u), ci(_ci), Deleted(0)
BadwordsDelCallback(User *_u, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), u(_u), ci(_ci), c(_c), Deleted(0), override(false)
{
if (!check_access(u, ci, CA_BADWORDS) && u->Account()->HasPriv("botserv/administration"))
this->override = true;
}
~BadwordsDelCallback()
@@ -74,6 +78,7 @@ class BadwordsDelCallback : public NumberList
if (Number > ci->GetBadWordCount())
return;
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, c, ci) << "DEL " << ci->GetBadWord(Number -1 )->word;
++Deleted;
ci->EraseBadWord(Number - 1);
}
@@ -84,6 +89,9 @@ class CommandBSBadwords : public Command
private:
CommandReturn DoList(User *u, ChannelInfo *ci, const Anope::string &word)
{
bool override = !check_access(u, ci, CA_BADWORDS);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "LIST";
if (!ci->GetBadWordCount())
notice_lang(Config->s_BotServ, u, BOT_BADWORDS_LIST_EMPTY, ci->name.c_str());
else if (!word.empty() && word.find_first_not_of("1234567890,-") == Anope::string::npos)
@@ -156,6 +164,8 @@ class CommandBSBadwords : public Command
}
}
bool override = !check_access(u, ci, CA_BADWORDS);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ADD " << realword;
ci->AddBadWord(realword, type);
notice_lang(Config->s_BotServ, u, BOT_BADWORDS_ADDED, realword.c_str(), ci->name.c_str());
@@ -168,7 +178,7 @@ class CommandBSBadwords : public Command
/* Special case: is it a number/list? Only do search if it isn't. */
if (!word.empty() && isdigit(word[0]) && word.find_first_not_of("1234567890,-") == Anope::string::npos)
{
BadwordsDelCallback list(u, ci, word);
BadwordsDelCallback list(u, ci, this, word);
list.Process();
}
else
@@ -190,6 +200,8 @@ class CommandBSBadwords : public Command
return MOD_CONT;
}
bool override = !check_access(u, ci, CA_BADWORDS);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DEL " << badword->word;
ci->EraseBadWord(i);
notice_lang(Config->s_BotServ, u, BOT_BADWORDS_DELETED, badword->word.c_str(), ci->name.c_str());
@@ -200,6 +212,9 @@ class CommandBSBadwords : public Command
CommandReturn DoClear(User *u, ChannelInfo *ci)
{
bool override = !check_access(u, ci, CA_BADWORDS);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "CLEAR";
ci->ClearBadWords();
notice_lang(Config->s_BotServ, u, BOT_BADWORDS_CLEAR);
return MOD_CONT;
+6
View File
@@ -95,10 +95,13 @@ class CommandBSBot : public Command
if (!(bi = new BotInfo(nick, user, host, real)))
{
// XXX this cant happen?
notice_lang(Config->s_BotServ, u, BOT_BOT_CREATION_FAILED);
return MOD_CONT;
}
Log(LOG_ADMIN, u, this) << "ADD " << bi->GetMask() << " " << bi->realname;
notice_lang(Config->s_BotServ, u, BOT_BOT_ADDED, bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
FOREACH_MOD(I_OnBotCreate, OnBotCreate(bi));
@@ -260,6 +263,7 @@ class CommandBSBot : public Command
}
notice_lang(Config->s_BotServ, u, BOT_BOT_CHANGED, oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
Log(LOG_ADMIN, u, this) << "CHANGE " << oldnick << " to " << bi->GetMask() << " " << bi->realname;
FOREACH_MOD(I_OnBotChange, OnBotChange(bi));
return MOD_CONT;
@@ -294,6 +298,8 @@ class CommandBSBot : public Command
XLine x(bi->nick);
ircdproto->SendSQLineDel(&x);
Log(LOG_ADMIN, u, this) << "DEL " << bi->nick;
delete bi;
notice_lang(Config->s_BotServ, u, BOT_BOT_DELETED, nick.c_str());
return MOD_CONT;
+12 -9
View File
@@ -42,6 +42,9 @@ class CommandBSKick : public Command
notice_help(Config->s_BotServ, u, BOT_NOT_ASSIGNED);
else
{
bool override = !check_access(u, ci, CA_SET);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << option << " " << value;
if (option.equals_ci("BADWORDS"))
{
if (value.equals_ci("ON"))
@@ -54,7 +57,7 @@ class CommandBSKick : public Command
if (!error.empty() || ci->ttb[TTB_BADWORDS] < 0)
{
/* leaving the debug behind since we might want to know what these are */
Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BADWORDS];
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BADWORDS];
/* reset the value back to 0 - TSL */
ci->ttb[TTB_BADWORDS] = 0;
notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
@@ -85,7 +88,7 @@ class CommandBSKick : public Command
ci->ttb[TTB_BOLDS] = convertTo<int16>(ttb, error, false);
if (!error.empty() || ci->ttb[TTB_BOLDS] < 0)
{
Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BOLDS];
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BOLDS];
ci->ttb[TTB_BOLDS] = 0;
notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
return MOD_CONT;
@@ -118,7 +121,7 @@ class CommandBSKick : public Command
ci->ttb[TTB_CAPS] = convertTo<int16>(ttb, error, false);
if (!error.empty() || ci->ttb[TTB_CAPS] < 0)
{
Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_CAPS];
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_CAPS];
ci->ttb[TTB_CAPS] = 0;
notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
return MOD_CONT;
@@ -163,7 +166,7 @@ class CommandBSKick : public Command
ci->ttb[TTB_COLORS] = convertTo<int16>(ttb, error, false);
if (!error.empty() || ci->ttb[TTB_COLORS] < 0)
{
Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_COLORS];
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_COLORS];
ci->ttb[TTB_COLORS] = 0;
notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
return MOD_CONT;
@@ -196,7 +199,7 @@ class CommandBSKick : public Command
ci->ttb[TTB_FLOOD] = convertTo<int16>(ttb, error, false);
if (!error.empty() || ci->ttb[TTB_FLOOD] < 0)
{
Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_FLOOD];
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_FLOOD];
ci->ttb[TTB_FLOOD] = 0;
notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
return MOD_CONT;
@@ -243,7 +246,7 @@ class CommandBSKick : public Command
ci->ttb[TTB_REPEAT] = convertTo<int16>(ttb, error, false);
if (!error.empty() || ci->ttb[TTB_REPEAT] < 0)
{
Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REPEAT];
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REPEAT];
ci->ttb[TTB_REPEAT] = 0;
notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
return MOD_CONT;
@@ -281,7 +284,7 @@ class CommandBSKick : public Command
ci->ttb[TTB_REVERSES] = convertTo<int16>(ttb, error, false);
if (!error.empty() || ci->ttb[TTB_REVERSES] < 0)
{
Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REVERSES];
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REVERSES];
ci->ttb[TTB_REVERSES] = 0;
notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
return MOD_CONT;
@@ -311,7 +314,7 @@ class CommandBSKick : public Command
ci->ttb[TTB_UNDERLINES] = convertTo<int16>(ttb, error, false);
if (!error.empty() || ci->ttb[TTB_UNDERLINES] < 0)
{
Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_UNDERLINES];
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_UNDERLINES];
ci->ttb[TTB_UNDERLINES] = 0;
notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
return MOD_CONT;
@@ -341,7 +344,7 @@ class CommandBSKick : public Command
ci->ttb[TTB_ITALICS] = convertTo<int16>(ttb, error, false);
if (!error.empty() || ci->ttb[TTB_ITALICS] < 0)
{
Alog(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_ITALICS];
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_ITALICS];
ci->ttb[TTB_ITALICS] = 0;
notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str());
return MOD_CONT;
+4 -2
View File
@@ -55,8 +55,10 @@ class CommandBSSay : public Command
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", text.c_str());
ci->bi->lastmsg = time(NULL);
if (Config->LogBot && !Config->LogChannel.empty() && LogChan && !debug && findchan(Config->LogChannel))
ircdproto->SendPrivmsg(ci->bi, Config->LogChannel, "SAY %s %s %s", u->nick.c_str(), ci->name.c_str(), text.c_str());
// XXX need a way to find if someone is overriding this
Log(LOG_COMMAND, u, this, ci) << text;
return MOD_CONT;
}
+3
View File
@@ -64,6 +64,9 @@ class CommandBSSet : public Command
notice_lang(Config->s_BotServ, u, ACCESS_DENIED);
else
{
bool override = !check_access(u, ci, CA_SET);
Log(override ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << option << value;
if (option.equals_ci("DONTKICKOPS"))
{
if (value.equals_ci("ON"))
+3
View File
@@ -36,6 +36,9 @@ class CommandBSUnassign : public Command
notice_help(Config->s_BotServ, u, BOT_UNASSIGN_PERSISTANT_CHAN);
else
{
bool override = !check_access(u, ci, CA_ASSIGN);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "for " << ci->bi->nick;
ci->bi->UnAssign(u, ci);
notice_lang(Config->s_BotServ, u, BOT_UNASSIGN_UNASSIGNED, ci->name.c_str());
}
File diff suppressed because it is too large Load Diff
+30 -2
View File
@@ -138,14 +138,18 @@ class AkickDelCallback : public NumberList
{
User *u;
ChannelInfo *ci;
Command *c;
unsigned Deleted;
public:
AkickDelCallback(User *_u, ChannelInfo *_ci, const Anope::string &list) : NumberList(list, true), u(_u), ci(_ci), Deleted(0)
AkickDelCallback(User *_u, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), u(_u), ci(_ci), c(_c), Deleted(0)
{
}
~AkickDelCallback()
{
bool override = !check_access(u, ci, CA_AKICK);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, c, ci) << "DEL on " << Deleted << " users";
if (!Deleted)
notice_lang(Config->s_ChanServ, u, CHAN_AKICK_NO_MATCH, ci->name.c_str());
else if (Deleted == 1)
@@ -266,6 +270,9 @@ class CommandCSAKick : public Command
else
akick = ci->AddAkick(u->nick, mask, reason);
bool override = !check_access(u, ci, CA_AKICK);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ADD " << mask << ": " << reason;
FOREACH_MOD(I_OnAkickAdd, OnAkickAdd(u, ci, akick));
notice_lang(Config->s_ChanServ, u, CHAN_AKICK_ADDED, mask.c_str(), ci->name.c_str());
@@ -306,6 +313,9 @@ class CommandCSAKick : public Command
return;
}
bool override = !check_access(u, ci, CA_AKICK);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "STICK " << akick->mask;
akick->SetFlag(AK_STUCK);
notice_lang(Config->s_ChanServ, u, CHAN_AKICK_STUCK, akick->mask.c_str(), ci->name.c_str());
@@ -346,6 +356,9 @@ class CommandCSAKick : public Command
return;
}
bool override = !check_access(u, ci, CA_AKICK);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "UNSTICK " << akick->mask;
akick->UnsetFlag(AK_STUCK);
notice_lang(Config->s_ChanServ, u, CHAN_AKICK_UNSTUCK, akick->mask.c_str(), ci->name.c_str());
}
@@ -365,7 +378,7 @@ class CommandCSAKick : public Command
/* Special case: is it a number/list? Only do search if it isn't. */
if (isdigit(mask[0]) && mask.find_first_not_of("1234567890,-") == Anope::string::npos)
{
AkickDelCallback list(u, ci, mask);
AkickDelCallback list(u, ci, this, mask);
list.Process();
}
else
@@ -387,6 +400,9 @@ class CommandCSAKick : public Command
return;
}
bool override = !check_access(u, ci, CA_AKICK);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DEL " << mask;
ci->EraseAkick(i);
notice_lang(Config->s_ChanServ, u, CHAN_AKICK_DELETED, mask.c_str(), ci->name.c_str());
@@ -397,6 +413,9 @@ class CommandCSAKick : public Command
{
Anope::string mask = params.size() > 2 ? params[2] : "";
bool override = !check_access(u, ci, CA_AKICK);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "LIST";
if (!ci->GetAkickCount())
{
notice_lang(Config->s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name.c_str());
@@ -442,6 +461,9 @@ class CommandCSAKick : public Command
{
Anope::string mask = params.size() > 2 ? params[2] : "";
bool override = !check_access(u, ci, CA_AKICK);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "VIEW";
if (!ci->GetAkickCount())
{
notice_lang(Config->s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name.c_str());
@@ -502,11 +524,17 @@ class CommandCSAKick : public Command
++count;
}
bool override = !check_access(u, ci, CA_AKICK);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ENFORCE, affects " << count << " users";
notice_lang(Config->s_ChanServ, u, CHAN_AKICK_ENFORCE_DONE, ci->name.c_str(), count);
}
void DoClear(User *u, ChannelInfo *ci)
{
bool override = !check_access(u, ci, CA_AKICK);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "CLEAR";
ci->ClearAkick();
notice_lang(Config->s_ChanServ, u, CHAN_AKICK_CLEAR, ci->name.c_str());
}
+4 -1
View File
@@ -56,8 +56,11 @@ class CommandCSBan : public Command
else
{
Anope::string mask;
get_idealban(ci, u2, mask);
// XXX need a way to detect if someone is overriding
Log(LOG_COMMAND, u, this, ci) << "for " << mask;
c->SetMode(NULL, CMODE_BAN, mask);
/* We still allow host banning while not allowing to kick */
+5 -1
View File
@@ -34,9 +34,13 @@ class CommandCSClear : public Command
ChannelMode *halfop = ModeManager::FindChannelModeByName(CMODE_HALFOP);
ChannelMode *voice = ModeManager::FindChannelModeByName(CMODE_VOICE);
if (c)
// XXX
Log(LOG_COMMAND, u, this, ci) << what;
if (!c)
notice_lang(Config->s_ChanServ, u, CHAN_X_NOT_IN_USE, chan.c_str());
else if (!u || !check_access(u, ci, CA_CLEAR))
else if (!check_access(u, ci, CA_CLEAR))
notice_lang(Config->s_ChanServ, u, ACCESS_DENIED);
else if (what.equals_ci("bans"))
{
+4 -9
View File
@@ -53,8 +53,6 @@ class CommandCSDrop : public Command
return MOD_CONT;
}
int level = get_access(u, ci);
if (ci->c && ModeManager::FindChannelModeByName(CMODE_REGISTERED))
ci->c->RemoveMode(NULL, CMODE_REGISTERED, "", false);
@@ -64,16 +62,13 @@ class CommandCSDrop : public Command
ircdproto->SendSQLineDel(&x);
}
Alog() << Config->s_ChanServ << ": Channel " << ci->name << " dropped by " << u->GetMask() << " (founder: " << (ci->founder ? ci->founder->display : "(none)") << ")";
bool override = (ci->HasFlag(CI_SECUREFOUNDER) ? !IsFounder(u, ci) : !check_access(u, ci, CA_FOUNDER));
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "founder: " << (ci->founder ? ci->founder->display : "none");
if (override)
ircdproto->SendGlobops(ChanServ, "\2%s\2 used DROP on channel \2%s\2", u->nick.c_str(), ci->name.c_str());
delete ci;
/* We must make sure that the Services admin has not normally the right to
* drop the channel before issuing the wallops.
*/
if (Config->WallDrop && (level < ACCESS_FOUNDER || (!IsFounder(u, ci) && ci->HasFlag(CI_SECUREFOUNDER))))
ircdproto->SendGlobops(ChanServ, "\2%s\2 used DROP on channel \2%s\2", u->nick.c_str(), chan.c_str());
notice_lang(Config->s_ChanServ, u, CHAN_DROPPED, chan.c_str());
FOREACH_MOD(I_OnChanDrop, OnChanDrop(chan));
+6 -5
View File
@@ -53,7 +53,8 @@ class CommandCSForbid : public Command
ci = new ChannelInfo(chan);
if (!ci)
{
Alog() << Config->s_ChanServ << ": Valid FORBID for " << ci->name << " by " << u->nick << " failed";
// this cant happen?
//Alog() << Config->s_ChanServ << ": Valid FORBID for " << ci->name << " by " << u->nick << " failed";
notice_lang(Config->s_ChanServ, u, CHAN_FORBID_FAILED, chan.c_str());
return MOD_CONT;
}
@@ -80,16 +81,16 @@ class CommandCSForbid : public Command
}
}
if (Config->WallForbid)
ircdproto->SendGlobops(ChanServ, "\2%s\2 used FORBID on channel \2%s\2", u->nick.c_str(), ci->name.c_str());
if (ircd->chansqline)
{
XLine x(chan, "Forbidden");
ircdproto->SendSQLine(&x);
}
Alog() << Config->s_ChanServ << ": " << u->nick << " set FORBID for channel " << ci->name;
if (Config->WallForbid)
ircdproto->SendGlobops(ChanServ, "\2%s\2 used FORBID on channel \2%s\2", u->nick.c_str(), ci->name.c_str());
Log(LOG_ADMIN, u, this, ci) << (!ci->forbidreason.empty() ? ci->forbidreason : "No reason");
notice_lang(Config->s_ChanServ, u, CHAN_FORBID_SUCCEEDED, chan.c_str());
FOREACH_MOD(I_OnChanForbidden, OnChanForbidden(ci));
+3
View File
@@ -40,6 +40,9 @@ class CommandCSGetKey : public Command
return MOD_CONT;
}
bool override = !check_access(u, ci, CA_GETKEY);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci);
notice_lang(Config->s_ChanServ, u, CHAN_GETKEY_KEY, chan.c_str(), key.c_str());
return MOD_CONT;
}
+4 -1
View File
@@ -35,7 +35,7 @@ class CommandCSInvite : public Command
ci = c->ci;
if (!u || !check_access(u, ci, CA_INVITE))
if (!check_access(u, ci, CA_INVITE))
{
notice_lang(Config->s_ChanServ, u, ACCESS_DENIED);
return MOD_CONT;
@@ -52,6 +52,9 @@ class CommandCSInvite : public Command
}
}
// XXX need a check for override...
Log(LOG_COMMAND, u, this, ci) << "for " << u2->nick;
if (c->FindUser(u2))
notice_lang(Config->s_ChanServ, u, CHAN_INVITE_ALREADY_IN, c->name.c_str());
else
+3
View File
@@ -51,6 +51,9 @@ class CommandCSKick : public Command
notice_lang(Config->s_ChanServ, u, NICK_X_NOT_ON_CHAN, u2->nick.c_str(), c->name.c_str());
else
{
// XXX
Log(LOG_COMMAND, u, this, ci) << "for " << u2->nick;
if (ci->HasFlag(CI_SIGNKICK) || (ci->HasFlag(CI_SIGNKICK_LEVEL) && !check_access(u, ci, CA_SIGNKICK)))
ci->c->Kick(whosends(ci), u2, "%s (%s)", reason.c_str(), u->nick.c_str());
else
File diff suppressed because it is too large Load Diff
+3 -7
View File
@@ -49,16 +49,12 @@ class CommandCSRegister : public Command
notice_lang(Config->s_ChanServ, u, u->Account()->channelcount > Config->CSMaxReg ? CHAN_EXCEEDED_CHANNEL_LIMIT : CHAN_REACHED_CHANNEL_LIMIT, Config->CSMaxReg);
else if (!(ci = new ChannelInfo(chan)))
{
Alog() << Config->s_ChanServ << ": makechan() failed for REGISTER " << chan;
// not possible ?
//Alog() << Config->s_ChanServ << ": makechan() failed for REGISTER " << chan;
notice_lang(Config->s_ChanServ, u, CHAN_REGISTRATION_FAILED);
}
else
{
if (c)
{
c->ci = ci;
ci->c = c;
}
ci->founder = u->Account();
ci->desc = desc;
@@ -73,7 +69,7 @@ class CommandCSRegister : public Command
ci->bi = NULL;
++ci->founder->channelcount;
Alog() << Config->s_ChanServ << ": Channel '" << chan << "' registered by " << u->GetMask();
Log(LOG_COMMAND, u, this, ci);
notice_lang(Config->s_ChanServ, u, CHAN_REGISTERED, chan.c_str(), u->nick.c_str());
/* Implement new mode lock */
+3 -1
View File
@@ -40,9 +40,11 @@ class CommandCSSASet : public Command
if (c)
{
Anope::string cmdparams = cs_findchan(params[0])->name;
ChannelInfo *ci = cs_findchan(params[0]);
Anope::string cmdparams = ci->name;
for (std::vector<Anope::string>::const_iterator it = params.begin() + 2, it_end = params.end(); it != it_end; ++it)
cmdparams += " " + *it;
Log(LOG_ADMIN, u, this, ci) << params[1] << " " << cmdparams;
mod_run_cmd(ChanServ, u, c, params[1], cmdparams);
}
else
+2 -1
View File
@@ -45,7 +45,8 @@ class CommandCSSet : public Command
if (c)
{
Anope::string cmdparams = cs_findchan(params[0])->name;
ChannelInfo *ci = cs_findchan(params[0]);
Anope::string cmdparams = ci->name;
for (std::vector<Anope::string>::const_iterator it = params.begin() + 2, it_end = params.end(); it != it_end; ++it)
cmdparams += " " + *it;
mod_run_cmd(ChanServ, u, c, params[1], cmdparams);
+1 -1
View File
@@ -53,7 +53,7 @@ class CommandCSSetFounder : public Command
return MOD_CONT;
}
Alog() << Config->s_ChanServ << ": Changing founder of " << ci->name << " from " << ci->founder->display << " to " << nc->display << " by " << u->GetMask();
Log(!this->permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the founder to " << nc->display;
/* Founder and successor must not be the same group */
if (nc == ci->successor)
+1 -1
View File
@@ -58,7 +58,7 @@ class CommandCSSetSuccessor : public Command
else
nc = NULL;
Alog() << Config->s_ChanServ << ": Changing successor of " << ci->name << " from " << (ci->successor ? ci->successor->display : "none") << " to " << (nc ? nc->display : "none") << " by " << u->GetMask();
Log(!this->permission.empty() ? LOG_ADMIN : LOG_COMMAND, u, this, ci) << "to change the successor from " << (ci->successor ? ci->successor->display : "none") << " to " << (nc ? nc->display : "none");
ci->successor = nc;
+2 -2
View File
@@ -64,14 +64,14 @@ class CommandCSSetXOP : public Command
ci->SetFlag(CI_XOP);
}
Alog() << Config->s_ChanServ << ": " << u->GetMask() << " enabled XOP for " << ci->name;
Log(LOG_COMMAND, u, this, ci) << "to enable XOP";
notice_lang(Config->s_ChanServ, u, CHAN_SET_XOP_ON, ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_XOP);
Alog() << Config->s_ChanServ << ": " << u->GetMask() << " disabled XOP for " << ci->name;
Log(LOG_COMMAND, u, this, ci) << "to disable XOP";
notice_lang(Config->s_ChanServ, u, CHAN_SET_XOP_OFF, ci->name.c_str());
}
else
+7 -4
View File
@@ -74,14 +74,15 @@ class CommandCSSuspend : public Command
if (Config->WallForbid)
ircdproto->SendGlobops(ChanServ, "\2%s\2 used SUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str());
Alog() << Config->s_ChanServ << ": " << u->GetMask() << " set SUSPEND for channel " << ci->name;
Log(LOG_ADMIN, u, this, ci) << (!reason.empty() ? reason : "No reason");
notice_lang(Config->s_ChanServ, u, CHAN_SUSPEND_SUCCEEDED, chan.c_str());
FOREACH_MOD(I_OnChanSuspend, OnChanSuspend(ci));
}
else
{
Alog() << Config->s_ChanServ << ": Valid SUSPEND for " << ci->name << " by " << u->GetMask() << " failed";
// cant happen?
//Alog() << Config->s_ChanServ << ": Valid SUSPEND for " << ci->name << " by " << u->GetMask() << " failed";
notice_lang(Config->s_ChanServ, u, CHAN_SUSPEND_FAILED, chan.c_str());
}
return MOD_CONT;
@@ -134,6 +135,8 @@ class CommandCSUnSuspend : public Command
if (ci)
{
Log(LOG_ADMIN, u, this, ci) << " was suspended for: " << (!ci->forbidreason.empty() ? ci->forbidreason : "No reason");
ci->UnsetFlag(CI_SUSPENDED);
ci->forbidreason.clear();
ci->forbidby.clear();
@@ -141,14 +144,14 @@ class CommandCSUnSuspend : public Command
if (Config->WallForbid)
ircdproto->SendGlobops(ChanServ, "\2%s\2 used UNSUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str());
Alog() << Config->s_ChanServ << ": " << u->GetMask() << " set UNSUSPEND for channel " << ci->name;
notice_lang(Config->s_ChanServ, u, CHAN_UNSUSPEND_SUCCEEDED, chan.c_str());
FOREACH_MOD(I_OnChanUnsuspend, OnChanUnsuspend(ci));
}
else
{
Alog() << Config->s_ChanServ << ": Valid UNSUSPEND for " << chan << " by " << u->nick << " failed";
// cant happen ?
//Alog() << Config->s_ChanServ << ": Valid UNSUSPEND for " << chan << " by " << u->nick << " failed";
notice_lang(Config->s_ChanServ, u, CHAN_UNSUSPEND_FAILED, chan.c_str());
}
return MOD_CONT;
+6 -8
View File
@@ -25,11 +25,8 @@ class CommandCSTopic : public Command
Anope::string chan = params[0];
Anope::string topic = params.size() > 1 ? params[1] : "";
Channel *c;
ChannelInfo *ci;
if ((c = findchan(chan)))
ci = c->ci;
ChannelInfo *ci = cs_findchan(params[0]);
Channel *c = ci->c;
if (!c)
notice_lang(Config->s_ChanServ, u, CHAN_X_NOT_IN_USE, chan.c_str());
@@ -48,9 +45,10 @@ class CommandCSTopic : public Command
else
c->topic_time = ci->last_topic_time;
if (!check_access(u, ci, CA_TOPIC))
Alog() << Config->s_NickServ << ": " << u->GetMask() << " changed topic of " << c->name << " as services admin.";
if (ircd->join2set && whosends(ci) == ChanServ)
bool override = !check_access(u, ci, CA_TOPIC);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to change the topic to " << (!topic.empty() ? topic : "No topic");
if (ircd->join2set && whosends(ci) == ChanServ) // XXX what if the service bot is chanserv?
{
ChanServ->Join(c);
ircdproto->SendMode(NULL, c, "+o %s", Config->s_ChanServ.c_str()); // XXX
+16 -6
View File
@@ -150,11 +150,13 @@ class XOPDelCallback : public NumberList
{
User *u;
ChannelInfo *ci;
Command *c;
int *messages;
unsigned Deleted;
Anope::string Nicks;
bool override;
public:
XOPDelCallback(User *_u, ChannelInfo *_ci, int *_messages, const Anope::string &numlist) : NumberList(numlist, true), u(_u), ci(_ci), messages(_messages), Deleted(0)
XOPDelCallback(User *_u, Command *_c, ChannelInfo *_ci, int *_messages, bool _override, const Anope::string &numlist) : NumberList(numlist, true), u(_u), ci(_ci), c(_c), messages(_messages), Deleted(0), override(_override)
{
}
@@ -164,7 +166,7 @@ class XOPDelCallback : public NumberList
notice_lang(Config->s_ChanServ, u, messages[XOP_NO_MATCH], ci->name.c_str());
else
{
Alog() << Config->s_ChanServ << ": " << u->GetMask() << " (level " << get_access(u, ci) << ") deleted access of users " << Nicks << " on " << ci->name;
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, c, ci) << "deleted access of users " << Nicks;
if (Deleted == 1)
notice_lang(Config->s_ChanServ, u, messages[XOP_DELETED_ONE], ci->name.c_str());
@@ -263,7 +265,8 @@ class XOPBase : public Command
access->creator = u->nick;
}
Alog() << Config->s_ChanServ << ": " << u->GetMask() << " (level " << ulev << ") " << (change ? "changed" : "set") << " access level " << level << " to " << na->nick << " (group " << nc->display << ") on channel " << ci->name;
bool override = (level >= ulev || ulev < ACCESS_AOP || (access && access->level > ulev));
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ADD " << na->nick << " (group: " << nc->display << ") as level " << level;
if (!change)
{
@@ -313,7 +316,8 @@ class XOPBase : public Command
/* Special case: is it a number/list? Only do search if it isn't. */
if (isdigit(nick[0]) && nick.find_first_not_of("1234567890,-") == Anope::string::npos)
{
XOPDelCallback list(u, ci, messages, nick);
bool override = level >= ulev || ulev < ACCESS_AOP;
XOPDelCallback list(u, this, ci, messages, override, nick);
list.Process();
}
else
@@ -325,7 +329,6 @@ class XOPBase : public Command
return MOD_CONT;
}
NickCore *nc = na->nc;
unsigned i, end;
for (i = 0, end = ci->GetAccessCount(); i < end; ++i)
{
@@ -345,7 +348,8 @@ class XOPBase : public Command
notice_lang(Config->s_ChanServ, u, ACCESS_DENIED);
else
{
Alog() << Config->s_ChanServ << ": " << u->GetMask() << " (level " << get_access(u, ci) << ") deleted access of user " << access->nc->display << " on " << ci->name;
bool override = ulev <= access->level;
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DEL " << access->nc->display;
notice_lang(Config->s_ChanServ, u, messages[XOP_DELETED], access->nc->display.c_str(), ci->name.c_str());
@@ -368,6 +372,9 @@ class XOPBase : public Command
return MOD_CONT;
}
bool override = !get_access(u, ci);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci);
if (!ci->GetAccessCount())
{
notice_lang(Config->s_ChanServ, u, messages[XOP_LIST_EMPTY], ci->name.c_str());
@@ -426,6 +433,9 @@ class XOPBase : public Command
return MOD_CONT;
}
bool override = !check_access(u, ci, CA_FOUNDER);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "CLEAR level " << level;
for (unsigned i = ci->GetAccessCount(); i > 0; --i)
{
ChanAccess *access = ci->GetAccess(i - 1);
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -336,7 +336,7 @@ class EMD5 : public Module
MD5Final(reinterpret_cast<unsigned char *>(digest), &context);
buf += Anope::Hex(digest, 16);
Alog(LOG_DEBUG_2) << "(enc_md5) hashed password from [" << src << "] to [" << buf << "]";
Log(LOG_DEBUG_2) << "(enc_md5) hashed password from [" << src << "] to [" << buf << "]";
dest = buf;
return EVENT_ALLOW;
}
+1 -1
View File
@@ -28,7 +28,7 @@ class ENone : public Module
Anope::string cpass;
b64_encode(src, cpass);
buf += cpass;
Alog(LOG_DEBUG_2) << "(enc_none) hashed password from [" << src << "] to [" << buf << "]";
Log(LOG_DEBUG_2) << "(enc_none) hashed password from [" << src << "] to [" << buf << "]";
dest = buf;
return EVENT_ALLOW;
}
+1 -1
View File
@@ -346,7 +346,7 @@ class EOld : public Module
digest2[i / 2] = XTOI(digest[i]) << 4 | XTOI(digest[i + 1]);
buf += Anope::Hex(digest2, 16);
Alog(LOG_DEBUG_2) << "(enc_old) hashed password from [" << src << "] to [" << buf << "]";
Log(LOG_DEBUG_2) << "(enc_old) hashed password from [" << src << "] to [" << buf << "]";
dest = buf;
return EVENT_ALLOW;
}
+1 -1
View File
@@ -190,7 +190,7 @@ class ESHA1 : public Module
SHA1Final(reinterpret_cast<unsigned char *>(digest), &context);
buf += Anope::Hex(digest, 20);
Alog(LOG_DEBUG_2) << "(enc_sha1) hashed password from [" << src << "] to [" << buf << "]";
Log(LOG_DEBUG_2) << "(enc_sha1) hashed password from [" << src << "] to [" << buf << "]";
dest = buf;
return EVENT_ALLOW;
}
+1 -1
View File
@@ -275,7 +275,7 @@ class ESHA256 : public Module
SHA256Final(&ctx, reinterpret_cast<unsigned char *>(digest));
digest[SHA256_DIGEST_SIZE] = '\0';
buf << "sha256:" << Anope::Hex(digest, SHA256_DIGEST_SIZE) << ":" << GetIVString();
Alog(LOG_DEBUG_2) << "(enc_sha256) hashed password from [" << src << "] to [" << buf.str() << " ]";
Log(LOG_DEBUG_2) << "(enc_sha256) hashed password from [" << src << "] to [" << buf.str() << " ]";
dest = buf.str();
return EVENT_ALLOW;
}
+1 -1
View File
@@ -31,7 +31,7 @@ class CommandHSDel : public Command
notice_lang(Config->s_HostServ, u, NICK_X_FORBIDDEN, nick.c_str());
return MOD_CONT;
}
Alog() << "vHost for user \2" << nick << "\2 deleted by oper \2" << u->nick << "\2";
Log(LOG_ADMIN, u, this) << "for user " << na->nick;
FOREACH_MOD(I_OnDeleteVhost, OnDeleteVhost(na));
na->hostinfo.RemoveVhost();
notice_lang(Config->s_HostServ, u, HOST_DEL, nick.c_str());
+1 -1
View File
@@ -38,7 +38,7 @@ class CommandHSDelAll : public Command
na = *it;
na->hostinfo.RemoveVhost();
}
Alog() << "vHosts for all nicks in group \2" << nc->display << "\2 deleted by oper \2" << u->nick << "\2";
Log(LOG_ADMIN, u, this) << "for all nicks in group " << nc->display;
notice_lang(Config->s_HostServ, u, HOST_DELALL, nc->display.c_str());
}
else
+1
View File
@@ -29,6 +29,7 @@ class CommandHSOff : public Command
else
{
ircdproto->SendVhostDel(u);
Log(LOG_COMMAND, u, this) << "to disable their vhost";
notice_lang(Config->s_HostServ, u, HOST_OFF);
}
+1
View File
@@ -29,6 +29,7 @@ class CommandHSOn : public Command
notice_lang(Config->s_HostServ, u, HOST_IDENT_ACTIVATED, na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str());
else
notice_lang(Config->s_HostServ, u, HOST_ACTIVATED, na->hostinfo.GetHost().c_str());
Log(LOG_COMMAND, u, this) << "to enable their vhost of " << (!na->hostinfo.GetIdent().empty() ? na->hostinfo.GetIdent() + "@" : "") << na->hostinfo.GetHost();
ircdproto->SendVhost(u, na->hostinfo.GetIdent(), na->hostinfo.GetHost());
if (ircd->vhost)
u->vhost = na->hostinfo.GetHost();
+2 -1
View File
@@ -81,7 +81,8 @@ class CommandHSSet : public Command
notice_lang(Config->s_HostServ, u, NICK_X_FORBIDDEN, nick.c_str());
return MOD_CONT;
}
Alog() << "vHost for user \2" << nick << "\2 set to \2" << (!vIdent.empty() && ircd->vident ? vIdent : "") << (!vIdent.empty() && ircd->vident ? "@" : "") << hostmask << " \2 by oper \2" << u->nick << "\2";
Log(LOG_ADMIN, u, this) << "to set the vhost of " << na->nick << " to " << (!vIdent.empty() ? vIdent + "@" : "") << hostmask;
na->hostinfo.SetVhost(vIdent, hostmask, u->nick);
FOREACH_MOD(I_OnSetVhost, OnSetVhost(na));
+1 -1
View File
@@ -86,7 +86,7 @@ class CommandHSSetAll : public Command
tmp_time = time(NULL);
Alog() << "vHost for all nicks in group \2" << nick << "\2 set to \2" << (!vIdent.empty() && ircd->vident ? vIdent : "") << (!vIdent.empty() && ircd->vident ? "@" : "") << hostmask << " \2 by oper \2" << u->nick << "\2";
Log(LOG_ADMIN, u, this) << "to set the vhost for all nicks in group " << na->nc->display << " to " << (!vIdent.empty() ? vIdent + "@" : "") << hostmask;
na->hostinfo.SetVhost(vIdent, hostmask, u->nick);
HostServSyncVhosts(na);
+1 -1
View File
@@ -47,7 +47,7 @@ class CommandMSRSend : public Command
else
{
/* rsend has been disabled */
Alog(LOG_DEBUG) << "MSMemoReceipt is set misconfigured to " << Config->MSMemoReceipt;
Log() << "MSMemoReceipt is set misconfigured to " << Config->MSMemoReceipt;
notice_lang(Config->s_MemoServ, u, MEMO_RSEND_DISABLED);
}
+2 -2
View File
@@ -42,7 +42,7 @@ class CommandNSDrop : public Command
{
if (Config->WallDrop)
ircdproto->SendGlobops(NickServ, "\2%s\2 used DROP on \2%s\2", u->nick.c_str(), nick.c_str());
Alog() << Config->s_NickServ << ": " << u->GetMask() << " dropped nickname " << nr->nick << " (e-mail: " << nr->email << ")";
Log(LOG_ADMIN, u, this) << "to drop nickname " << nr->nick << " (email: " << nr->email << ")";
delete nr;
notice_lang(Config->s_NickServ, u, NICK_X_DROPPED, nick.c_str());
}
@@ -73,7 +73,7 @@ class CommandNSDrop : public Command
ircdproto->SendSQLineDel(&x);
}
Alog() << Config->s_NickServ << ": " << u->GetMask() << " dropped nickname " << na->nick << " (group " << na->nc->display << ") (e-mail: " << (!na->nc->email.empty() ? na->nc->email : "none") << ")";
Log(!is_mine ? LOG_OVERRIDE : LOG_COMMAND, u, this) << "to drop nickname " << na->nick << " (group: " << na->nc->display << ") (email: " << (!na->nc->email.empty() ? na->nc->email : "none") << ")";
delete na;
FOREACH_MOD(I_OnNickDrop, OnNickDrop(!my_nick.empty() ? my_nick : nick));
+3 -2
View File
@@ -76,14 +76,15 @@ class CommandNSForbid : public Command
if (Config->WallForbid)
ircdproto->SendGlobops(NickServ, "\2%s\2 used FORBID on \2%s\2", u->nick.c_str(), nick.c_str());
Alog() << Config->s_NickServ << ": " << u->nick << " set FORBID for nick " << nick;
Log(LOG_ADMIN, u, this) << "to forbid nick " << nick;
notice_lang(Config->s_NickServ, u, NICK_FORBID_SUCCEEDED, nick.c_str());
FOREACH_MOD(I_OnNickForbidden, OnNickForbidden(na));
}
else
{
Alog() << Config->s_NickServ << ": Valid FORBID for " << nick << " by " << u->nick << " failed";
// XXX cant happen ?
//Alog() << Config->s_NickServ << ": Valid FORBID for " << nick << " by " << u->nick << " failed";
notice_lang(Config->s_NickServ, u, NICK_FORBID_FAILED, nick.c_str());
}
return MOD_CONT;
+1 -1
View File
@@ -29,7 +29,7 @@ class CommandNSGetEMail : public Command
Anope::string email = params[0];
int j = 0;
Alog() << Config->s_NickServ << ": " << u->GetMask() << " used GETEMAIL on " << email;
Log(LOG_ADMIN, u, this) << "on " << email;
for (nickcore_map::const_iterator it = NickCoreList.begin(), it_end = NickCoreList.end(); it != it_end; ++it)
{
+2 -2
View File
@@ -31,7 +31,7 @@ class CommandNSGetPass : public Command
{
if ((nr = findrequestnick(nick)))
{
Alog() << Config->s_NickServ << ": " << u->GetMask() << " used GETPASS on " << nick;
Log(LOG_ADMIN, u, this) << "for " << nr->nick;
if (Config->WallGetpass)
ircdproto->SendGlobops(NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick.c_str(), nick.c_str());
notice_lang(Config->s_NickServ, u, NICK_GETPASS_PASSCODE_IS, nick.c_str(), nr->passcode.c_str());
@@ -47,7 +47,7 @@ class CommandNSGetPass : public Command
{
if (enc_decrypt(na->nc->pass, tmp_pass) == 1)
{
Alog() << Config->s_NickServ << ": " << u->GetMask() << " used GETPASS on " << nick;
Log(LOG_ADMIN, u, this) << "for " << nick;
if (Config->WallGetpass)
ircdproto->SendGlobops(NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick.c_str(), nick.c_str());
notice_lang(Config->s_NickServ, u, NICK_GETPASS_PASSWORD_IS, nick.c_str(), tmp_pass.c_str());
+3 -1
View File
@@ -42,6 +42,7 @@ class CommandNSGhost : public Command
int res = enc_check_password(pass, na->nc->pass);
if (res == 1)
{
Log(LOG_COMMAND, u, this) << "for " << nick;
Anope::string buf = "GHOST command used by " + u->nick;
kill_user(Config->s_NickServ, nick, buf);
notice_lang(Config->s_NickServ, u, NICK_GHOST_KILLED, nick.c_str());
@@ -51,7 +52,7 @@ class CommandNSGhost : public Command
notice_lang(Config->s_NickServ, u, ACCESS_DENIED);
if (!res)
{
Alog() << Config->s_NickServ << ": GHOST: invalid password for " << nick << " by " << u->GetMask();
Log(LOG_COMMAND, u, this) << "invalid password for " << nick;
if (bad_password(u))
return MOD_STOP;
}
@@ -61,6 +62,7 @@ class CommandNSGhost : public Command
{
if (u->Account() == na->nc || (!na->nc->HasFlag(NI_SECURE) && is_on_access(u, na->nc)))
{
Log(LOG_COMMAND, u, this) << "for " << nick;
Anope::string buf = "GHOST command used by " + u->nick;
kill_user(Config->s_NickServ, nick, buf);
notice_lang(Config->s_NickServ, u, NICK_GHOST_KILLED, nick.c_str());
+6 -6
View File
@@ -61,12 +61,12 @@ class CommandNSGroup : public Command
notice_lang(Config->s_NickServ, u, NICK_GROUP_PLEASE_WAIT, (Config->NSRegDelay + u->lastnickreg) - time(NULL));
else if (u->Account() && u->Account()->HasFlag(NI_SUSPENDED))
{
Alog() << Config->s_NickServ << ": " << u->GetMask() << " tried to use GROUP from SUSPENDED nick " << target->nick;
//Alog() << Config->s_NickServ << ": " << u->GetMask() << " tried to use GROUP from SUSPENDED nick " << target->nick;
notice_lang(Config->s_NickServ, u, NICK_X_SUSPENDED, u->nick.c_str());
}
else if (target && target->nc->HasFlag(NI_SUSPENDED))
{
Alog() << Config->s_NickServ << ": " << u->GetMask() << " tried to use GROUP for SUSPENDED nick " << target->nick;
Log(LOG_COMMAND, u, this) << "tried to use GROUP for SUSPENDED nick " << target->nick;
notice_lang(Config->s_NickServ, u, NICK_X_SUSPENDED, target->nick.c_str());
}
else if (target->HasFlag(NS_FORBIDDEN))
@@ -82,7 +82,7 @@ class CommandNSGroup : public Command
int res = enc_check_password(pass, target->nc->pass);
if (res == -1)
{
Alog() << Config->s_NickServ << ": Failed GROUP for " << u->GetMask() << " (invalid password)";
Log(LOG_COMMAND, u, this) << "failed group for " << na->nick << " (invalid password)";
notice_lang(Config->s_NickServ, u, PASSWORD_INCORRECT);
if (bad_password(u))
return MOD_STOP;
@@ -119,8 +119,7 @@ class CommandNSGroup : public Command
FOREACH_MOD(I_OnNickGroup, OnNickGroup(u, target));
ircdproto->SetAutoIdentificationToken(u);
Alog() << Config->s_NickServ << ": " << u->GetMask() << " makes " << u->nick << " join group of " << target->nick << " (" << target->nc->display << ") (e-mail: " <<
(!target->nc->email.empty() ? target->nc->email : "none") << ")";
Log(LOG_COMMAND, u, this) << "makes " << u->nick << " join group of " << target->nick << " (" << target->nc->display << ") (email: " << (!target->nc->email.empty() ? target->nc->email : "none") << ")";
notice_lang(Config->s_NickServ, u, NICK_GROUP_JOINED, target->nick.c_str());
u->lastnickreg = time(NULL);
@@ -129,7 +128,8 @@ class CommandNSGroup : public Command
}
else
{
Alog() << Config->s_NickServ << ": makealias(" << u->nick << ") failed";
// XXX not possible?
//Alog() << Config->s_NickServ << ": makealias(" << u->nick << ") failed";
notice_lang(Config->s_NickServ, u, NICK_GROUP_FAILED);
}
}
+3 -3
View File
@@ -50,7 +50,7 @@ class CommandNSIdentify : public Command
res = enc_check_password(pass, na->nc->pass);
if (!res)
{
Alog() << Config->s_NickServ << ": Failed IDENTIFY for " << u->nick << "!" << u->GetIdent() << "@" << u->host;
Log(LOG_COMMAND, u, this) << "failed to identify";
notice_lang(Config->s_NickServ, u, PASSWORD_INCORRECT);
if (bad_password(u))
return MOD_STOP;
@@ -60,7 +60,7 @@ class CommandNSIdentify : public Command
else
{
if (u->IsIdentified())
Alog() << Config->s_NickServ << ": " << u->GetMask() << " logged out of account " << u->Account()->display;
Log(LOG_COMMAND, "nickserv/identify") << "logged out of account " << u->Account()->display;
na->last_realname = u->realname;
na->last_seen = time(NULL);
@@ -73,7 +73,7 @@ class CommandNSIdentify : public Command
FOREACH_MOD(I_OnNickIdentify, OnNickIdentify(u));
Alog() << Config->s_NickServ << ": " << u->GetMask() << " identified for account " << u->Account()->display;
Log(LOG_COMMAND, u, this) << "identified for account " << u->Account()->display;
notice_lang(Config->s_NickServ, u, NICK_IDENTIFY_SUCCEEDED);
if (ircd->vhost)
do_on_id(u);
+1 -1
View File
@@ -38,7 +38,7 @@ class CommandNSLogout : public Command
validate_user(u2);
u2->isSuperAdmin = 0; /* Dont let people logout and remain a SuperAdmin */
Alog() << Config->s_NickServ << ": " << u->GetMask() << " logged out nickname " << u2->nick;
Log(LOG_COMMAND, u, this) << "to logout " << u2->nick;
/* Remove founder status from this user in all channels */
if (!nick.empty())
+1 -1
View File
@@ -57,7 +57,7 @@ class CommandNSRecover : public Command
notice_lang(Config->s_NickServ, u, ACCESS_DENIED);
if (!res)
{
Alog() << Config->s_NickServ << ": RECOVER: invalid password for " << nick << " by " << u->GetMask();
Log(LOG_COMMAND, u, this) << "with invalid password for " << nick;
if (bad_password(u))
return MOD_STOP;
}
+10 -8
View File
@@ -24,7 +24,8 @@ class CommandNSConfirm : public Command
if (!na)
{
Alog() << Config->s_NickServ << ": makenick(" << u->nick << ") failed";
// XXX
//Alog() << Config->s_NickServ << ": makenick(" << u->nick << ") failed";
notice_lang(Config->s_NickServ, u, NICK_REGISTRATION_FAILED);
return MOD_CONT;
}
@@ -57,7 +58,7 @@ class CommandNSConfirm : public Command
if (!force)
{
u->Login(na->nc);
Alog() << Config->s_NickServ << ": '" << u->nick << "' registered by " << u->GetIdent() << "@" << u->host << " (e-mail: " << (!nr->email.empty() ? nr->email : "none") << ")";
Log(LOG_COMMAND, u, this) << "to register " << u->nick << " (email: " << (!nr->email.empty() ? nr->email : "none") << ")";
if (Config->NSAddAccessOnReg)
notice_lang(Config->s_NickServ, u, NICK_REGISTERED, u->nick.c_str(), na->nc->GetAccess(0).c_str());
else
@@ -74,7 +75,7 @@ class CommandNSConfirm : public Command
}
else
{
Alog() << Config->s_NickServ << ": '" << nr->nick << "' confirmed by " << u->GetMask() << " (email: " << (!nr->email.empty() ? nr->email : "none") << " )";
Log(LOG_COMMAND, u, this) << "to confirm " << u->nick << " (email: " << (!nr->email.empty() ? nr->email : "none") << ")";
notice_lang(Config->s_NickServ, u, NICK_FORCE_REG, nr->nick.c_str());
User *user = finduser(nr->nick);
/* Delrequest must be called before validate_user */
@@ -250,7 +251,8 @@ class CommandNSRegister : public CommandNSConfirm
/* i.e. there's already such a nick regged */
if (na->HasFlag(NS_FORBIDDEN))
{
Alog() << Config->s_NickServ << ": " << u->GetIdent() << "@" << u->host << " tried to register FORBIDden nick " << u->nick;
// XXX
//Alog() << Config->s_NickServ << ": " << u->GetIdent() << "@" << u->host << " tried to register FORBIDden nick " << u->nick;
notice_lang(Config->s_NickServ, u, NICK_CANNOT_BE_REGISTERED, u->nick.c_str());
}
else
@@ -278,11 +280,11 @@ class CommandNSRegister : public CommandNSConfirm
if (SendRegmail(u, nr))
{
notice_lang(Config->s_NickServ, u, NICK_ENTER_REG_CODE, email.c_str(), Config->s_NickServ.c_str());
Alog() << Config->s_NickServ << ": sent registration verification code to " << nr->email;
Log(LOG_COMMAND, u, this) << "send registration verification code to " << nr->email;
}
else
{
Alog() << Config->s_NickServ << ": Unable to send registration verification mail";
Log(LOG_COMMAND, u, this) << "unable to send registration verification mail";
notice_lang(Config->s_NickServ, u, NICK_REG_UNABLE);
delete nr;
return MOD_CONT;
@@ -342,11 +344,11 @@ class CommandNSResend : public Command
{
nr->lastmail = time(NULL);
notice_lang(Config->s_NickServ, u, NICK_REG_RESENT, nr->email.c_str());
Alog() << Config->s_NickServ << ": re-sent registration verification code for " << nr->nick << " to " << nr->email;
Log(LOG_COMMAND, u, this) << "resend registration verification code for " << nr->nick;
}
else
{
Alog() << Config->s_NickServ << ": Unable to re-send registration verification mail for " << nr->nick;
Log(LOG_COMMAND, u, this) << "unable to resend registration verification code for " << nr->nick;
return MOD_CONT;
}
}
+2 -2
View File
@@ -40,7 +40,7 @@ class CommandNSRelease : public Command
int res = enc_check_password(pass, na->nc->pass);
if (res == 1)
{
na->Release();
Log(LOG_COMMAND, u, this) << "released " << na->nick;
notice_lang(Config->s_NickServ, u, NICK_RELEASED);
}
else
@@ -48,7 +48,7 @@ class CommandNSRelease : public Command
notice_lang(Config->s_NickServ, u, ACCESS_DENIED);
if (!res)
{
Alog() << Config->s_NickServ << ": RELEASE: invalid password for " << nick << " by " << u->GetMask();
Log(LOG_COMMAND, u, this) << "invalid password for " << nick;
if (bad_password(u))
return MOD_STOP;
}
+3 -3
View File
@@ -36,7 +36,7 @@ class CommandNSResetPass : public Command
{
if (SendResetEmail(u, na))
{
Alog() << Config->s_NickServ << ": " << u->GetMask() << " used RESETPASS on " << na->nick << " (" << na->nc->display << ")";
Log(LOG_COMMAND, u, this) << "for " << na->nick << " (group: " << na->nc->display << ")";
notice_lang(Config->s_NickServ, u, NICK_RESETPASS_COMPLETE, na->nick.c_str());
}
}
@@ -111,7 +111,7 @@ class NSResetPass : public Module
ircdproto->SetAutoIdentificationToken(u);
FOREACH_MOD(I_OnNickIdentify, OnNickIdentify(u));
Alog() << Config->s_NickServ << ": " << u->GetMask() << " used CONFIRM with RESETPASS to forcefully identify to " << na->nick;
Log(LOG_COMMAND, u, &commandnsresetpass) << "confirmed RESETPASS to forcefully identify to " << na->nick;
notice_lang(Config->s_NickServ, u, NICK_CONFIRM_SUCCESS, Config->s_NickServ.c_str());
if (ircd->vhost)
@@ -122,7 +122,7 @@ class NSResetPass : public Module
}
else
{
Alog() << Config->s_NickServ << ": Invalid CONFIRM passcode for " << na->nick << " from " << u->GetMask();
Log(LOG_COMMAND, u, &commandnsresetpass) << "invalid confirm passcode for " << na->nick;
notice_lang(Config->s_NickServ, u, NICK_CONFIRM_INVALID);
bad_password(u);
}
+3 -3
View File
@@ -55,6 +55,7 @@ class CommandNSSASet : public Command
Anope::string cmdparams = na->nc->display;
for (std::vector<Anope::string>::const_iterator it = params.begin() + 2; it != params.end(); ++it)
cmdparams += " " + *it;
Log(LOG_ADMIN, u, this) << params[1] << " " << cmdparams;
mod_run_cmd(NickServ, u, c, params[1], cmdparams);
}
else
@@ -192,7 +193,8 @@ class CommandNSSASetPassword : public Command
if (enc_encrypt(params[1], nc->pass))
{
Alog() << Config->s_NickServ << ": Failed to encrypt password for " << nc->display << " (saset)";
// XXX
//Alog() << Config->s_NickServ << ": Failed to encrypt password for " << nc->display << " (saset)";
notice_lang(Config->s_NickServ, u, NICK_SASET_PASSWORD_FAILED, nc->display.c_str());
return MOD_CONT;
}
@@ -203,8 +205,6 @@ class CommandNSSASetPassword : public Command
else
notice_lang(Config->s_NickServ, u, NICK_SASET_PASSWORD_CHANGED, nc->display.c_str());
Alog() << Config->s_NickServ << ": " << u->GetMask() << " used SASET PASSWORD on " << nc->display << " (e-mail: "<< (!nc->email.empty() ? nc->email : "none") << ")";
if (Config->WallSetpass)
ircdproto->SendGlobops(NickServ, "\2%s\2 used SASET PASSWORD on \2%s\2", u->nick.c_str(), nc->display.c_str());
+1 -1
View File
@@ -40,7 +40,7 @@ class CommandNSSendPass : public Command
{
if (SendPassMail(u, na, tmp_pass))
{
Alog() << Config->s_NickServ << ": " << u->GetMask() << " used SENDPASS on " << nick;
Log(Config->RestrictMail ? LOG_ADMIN : LOG_COMMAND, u, this) << "for " << na->nick;
notice_lang(Config->s_NickServ, u, NICK_SENDPASS_OK, nick.c_str());
}
}
+2 -2
View File
@@ -175,7 +175,8 @@ class CommandNSSetPassword : public Command
if (enc_encrypt(param, u->Account()->pass) < 0)
{
Alog() << Config->s_NickServ << ": Failed to encrypt password for " << u->Account()->display << " (set)";
// XXX ?
//Alog() << Config->s_NickServ << ": Failed to encrypt password for " << u->Account()->display << " (set)";
notice_lang(Config->s_NickServ, u, NICK_SASET_PASSWORD_FAILED);
return MOD_CONT;
}
@@ -186,7 +187,6 @@ class CommandNSSetPassword : public Command
else
notice_lang(Config->s_NickServ, u, NICK_SASET_PASSWORD_CHANGED, u->Account()->display.c_str());
Alog() << Config->s_NickServ << ": " << u->GetMask() << " (e-mail: " << (!u->Account()->email.empty() ? u->Account()->email : "none") << ") changed its password.";
return MOD_CONT;
}
-2
View File
@@ -44,8 +44,6 @@ class CommandNSSetEmail : public Command
return MOD_CONT;
}
Alog() << Config->s_NickServ << ": " << u->GetMask() << " (e-mail: " << (!u->Account()->email.empty() ? u->Account()->email : "none") << ") changed the e-mail of " << nc->display << " to " << (!param.empty() ? param : "none");
if (!param.empty())
{
nc->email = param;
+2 -2
View File
@@ -76,7 +76,7 @@ class CommandNSSuspend : public Command
if (Config->WallForbid)
ircdproto->SendGlobops(NickServ, "\2%s\2 used SUSPEND on \2%s\2", u->nick.c_str(), nick.c_str());
Alog() << Config->s_NickServ << ": " << u->nick << " set SUSPEND for nick " << nick;
Log(LOG_ADMIN, u, this) << "for " << nick << " (" << (!reason.empty() ? reason : "No reason") << ")";
notice_lang(Config->s_NickServ, u, NICK_SUSPEND_SUCCEEDED, nick.c_str());
FOREACH_MOD(I_OnNickSuspended, OnNickSuspend(na));
@@ -142,7 +142,7 @@ class CommandNSUnSuspend : public Command
if (Config->WallForbid)
ircdproto->SendGlobops(NickServ, "\2%s\2 used UNSUSPEND on \2%s\2", u->nick.c_str(), nick.c_str());
Alog() << Config->s_NickServ << ": " << u->nick << " set UNSUSPEND for nick " << nick;
Log(LOG_ADMIN, u, this) << "for " << na->nick;
notice_lang(Config->s_NickServ, u, NICK_UNSUSPEND_SUCCEEDED, nick.c_str());
FOREACH_MOD(I_OnNickUnsuspended, OnNickUnsuspended(na));
+9 -9
View File
@@ -32,7 +32,7 @@ class DefConTimeout : public Timer
{
Config->DefConLevel = level;
FOREACH_MOD(I_OnDefconLevel, OnDefconLevel(level));
Alog() << "Defcon level timeout, returning to lvl " << level;
Log(OperServ, "operserv/defcon") << "Defcon level timeout, returning to level " << level;
ircdproto->SendGlobops(OperServ, getstring(OPER_DEFCON_WALL), Config->s_OperServ.c_str(), level);
if (Config->GlobalOnDefcon)
@@ -92,7 +92,7 @@ class CommandOSDefcon : public Command
notice_lang(Config->s_OperServ, u, OPER_DEFCON_CHANGED, Config->DefConLevel);
defcon_sendlvls(u);
Alog() << "Defcon level changed to " << newLevel << " by Oper " << u->nick;
Log(LOG_ADMIN, u, this) << "to change defcon level to " << newLevel;
ircdproto->SendGlobops(OperServ, getstring(OPER_DEFCON_WALL), u->nick.c_str(), newLevel);
/* Global notice the user what is happening. Also any Message that
the Admin would like to add. Set in config file. */
@@ -157,7 +157,7 @@ class OSDefcon : public Module
{
if (CheckDefCon(DEFCON_AKILL_NEW_CLIENTS))
{
Alog() << "DEFCON: adding akill for *@" << u->host;
Log(OperServ, "operserv/defcon") << "DEFCON: adding akill for *@" << u->host;
XLine *x = SGLine->Add(NULL, NULL, "*@" + u->host, time(NULL) + Config->DefConAKILL, !Config->DefConAkillReason.empty() ? Config->DefConAkillReason : "DEFCON AKILL");
if (x)
x->By = Config->s_OperServ;
@@ -352,7 +352,7 @@ void runDefCon()
{
if (Config->DefConChanModes[0] == '+' || Config->DefConChanModes[0] == '-')
{
Alog() << "DEFCON: setting " << Config->DefConChanModes << " on all channels";
Log(OperServ, "operserv/defcon") << "DEFCON: setting " << Config->DefConChanModes << " on all channels";
DefConModesSet = true;
MassChannelModes(OperServ, Config->DefConChanModes);
}
@@ -368,7 +368,7 @@ void runDefCon()
Anope::string newmodes = defconReverseModes(Config->DefConChanModes);
if (!newmodes.empty())
{
Alog() << "DEFCON: setting " << newmodes << " on all channels";
Log(OperServ, "operserv/defcon") << "DEFCON: setting " << newmodes << " on all channels";
MassChannelModes(OperServ, newmodes);
}
}
@@ -420,7 +420,7 @@ void defconParseModeString(const Anope::string &str)
{
if (cm->Type == MODE_STATUS || cm->Type == MODE_LIST || !cm->CanSet(NULL))
{
Alog() << "DefConChanModes mode character '" << mode << "' cannot be locked";
Log() << "DefConChanModes mode character '" << mode << "' cannot be locked";
continue;
}
else if (add)
@@ -434,7 +434,7 @@ void defconParseModeString(const Anope::string &str)
if (!ss.GetToken(param))
{
Alog() << "DefConChanModes mode character '" << mode << "' has no parameter while one is expected";
Log() << "DefConChanModes mode character '" << mode << "' has no parameter while one is expected";
continue;
}
@@ -462,7 +462,7 @@ void defconParseModeString(const Anope::string &str)
{
DefConModesOn.UnsetFlag(CMODE_REDIRECT);
Alog() << "DefConChanModes must lock mode +l as well to lock mode +L";
Log() << "DefConChanModes must lock mode +l as well to lock mode +L";
}
/* Some ircd we can't set NOKNOCK without INVITE */
@@ -470,7 +470,7 @@ void defconParseModeString(const Anope::string &str)
if (ircd->knock_needs_i && (cm = ModeManager::FindChannelModeByName(CMODE_NOKNOCK)) && DefConModesOn.HasFlag(cm->Name) && !DefConModesOn.HasFlag(CMODE_INVITE))
{
DefConModesOn.UnsetFlag(CMODE_NOKNOCK);
Alog() << "DefConChanModes must lock mode +i as well to lock mode +K";
Log() << "DefConChanModes must lock mode +i as well to lock mode +K";
}
}
+1 -1
View File
@@ -170,7 +170,7 @@ class OSIgnore : public Module
{
if ((*ign)->time && (*ign)->time <= now)
{
Alog(LOG_DEBUG) << "[os_ignore] Expiring ignore entry " << (*ign)->mask;
Log(LOG_DEBUG) << "[os_ignore] Expiring ignore entry " << (*ign)->mask;
delete *ign;
ign = ignore.erase(ign);
}
+1 -1
View File
@@ -32,7 +32,7 @@ class CommandOSModUnLoad : public Command
return MOD_CONT;
}
Alog() << "Trying to unload module [" << mname << "]";
Log() << "Trying to unload module [" << mname << "]";
status = ModuleManager::UnloadModule(m, u);
+2 -8
View File
@@ -90,10 +90,7 @@ static void DisplayNews(User *u, NewsType Type)
else if (Type == NEWS_RANDOM)
msg = NEWS_RANDOM_TEXT;
else
{
Alog() << "news: Invalid type (" << Type << ") to display_news()";
return;
}
throw CoreException("news: Invalid type (" + stringify(Type) + ") to display_news()");
unsigned displayed = 0;
bool NewsExists = false;
@@ -277,10 +274,7 @@ class NewsBase : public Command
msgs = findmsgs(type, type_name);
if (!msgs)
{
Alog() << "news: Invalid type to do_news()";
return MOD_CONT;
}
throw CoreException("news: Invalid type to do_news()");
if (cmd.equals_ci("LIST"))
return this->DoList(u, type, msgs);
+1 -1
View File
@@ -31,7 +31,7 @@ class CommandOSReload : public Command
}
catch (const ConfigException &ex)
{
Alog() << "Error reloading configuration file: " << ex.GetReason();
Log() << "Error reloading configuration file: " << ex.GetReason();
}
notice_lang(Config->s_OperServ, u, OPER_RELOAD);
+13 -63
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -41,10 +41,10 @@ class SSMain : public Module
statserv = findbot("StatServ");
if (!statserv)
{
Alog() << "Creating SS";
Log() << "Creating SS";
statserv = new BotInfo("StatServ", Config->ServiceUser, Config->ServiceHost, "Stats Service");
}
Alog() << "Done creating SS";
Log() << "Done creating SS";
this->AddCommand(statserv, &commandsshelp);
}
+1 -1
View File
@@ -95,7 +95,7 @@ class CommandCSAppendTopic : public Command
c->topic_time = ci->last_topic_time;
if (!check_access(u, ci, CA_TOPIC))
Alog() << Config->s_ChanServ << ": " << u->GetMask() << " changed topic of " << c->name << " as services admin.";
Log(LOG_OVERRIDE, u, this, ci) << "changed topic to " << topic;
if (ircd->join2set && whosends(ci) == ChanServ)
{
ChanServ->Join(c);
-6
View File
@@ -60,8 +60,6 @@ class CommandCSEnforce : public Command
if (!(ci = c->ci))
return;
Alog(LOG_DEBUG) << "[cs_enforce] Enforcing SECUREOPS on " << c->name;
/* Dirty hack to allow chan_set_correct_modes to work ok.
* We pretend like SECUREOPS is on so it doesn't ignore that
* part of the code. This way we can enforce SECUREOPS even
@@ -94,8 +92,6 @@ class CommandCSEnforce : public Command
if (!(ci = c->ci))
return;
Alog(LOG_DEBUG) << "[cs_enforce] Enforcing RESTRICTED on " << c->name;
old_nojoin_level = ci->levels[CA_NOJOIN];
if (ci->levels[CA_NOJOIN] < 0)
ci->levels[CA_NOJOIN] = 0;
@@ -124,8 +120,6 @@ class CommandCSEnforce : public Command
if (!(ci = c->ci))
return;
Alog(LOG_DEBUG) << "[cs_enforce] Enforcing mode +R on " << c->name;
for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; )
{
UserContainer *uc = *it++;
+1 -1
View File
@@ -151,7 +151,7 @@ class CSSetMisc : public Module
CommandInfo *info = new CommandInfo(cname, desc, showhidden);
if (!this->Commands.insert(std::make_pair(cname, info)).second)
{
Alog() << "cs_set_misc: Warning, unable to add duplicate entry " << cname;
Log() << "cs_set_misc: Warning, unable to add duplicate entry " << cname;
delete info;
continue;
}
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -139,7 +139,7 @@ class CommandHSRequest : public Command
me->NoticeLang(Config->s_HostServ, u, LNG_REQUESTED);
req_send_memos(u, vIdent, hostmask);
Alog() << "New vHost Requested by " << nick;
Log(LOG_COMMAND, u, this, NULL) << "to request new vhost " << (!vIdent.empty() ? vIdent + "@" : "") << hostmask;
}
else
notice_lang(Config->s_HostServ, u, HOST_NOREG, nick.c_str());
@@ -185,14 +185,14 @@ class CommandHSActivate : public Command
if (it != Requests.end())
{
na->hostinfo.SetVhost(it->second->ident, it->second->host, u->nick, it->second->time);
delete it->second;
Requests.erase(it);
if (HSRequestMemoUser)
my_memo_lang(u, na->nick, 2, LNG_ACTIVATE_MEMO);
me->NoticeLang(Config->s_HostServ, u, LNG_ACTIVATED, nick.c_str());
Alog() << "Host Request for " << nick << " activated by " << u->nick;
me->NoticeLang(Config->s_HostServ, u, LNG_ACTIVATED, na->nick.c_str());
Log(LOG_COMMAND, u, this, NULL) << "for " << na->nick << " for vhost " << (!it->second->ident.empty() ? it->second->ident + "@" : "") << it->second->host;
delete it->second;
Requests.erase(it);
}
else
me->NoticeLang(Config->s_HostServ, u, LNG_NO_REQUEST, nick.c_str());
@@ -252,7 +252,7 @@ class CommandHSReject : public Command
}
me->NoticeLang(Config->s_HostServ, u, LNG_REJECTED, nick.c_str());
Alog() << "Host Request for " << nick << " rejected by " << u->nick << " (" << (!reason.empty() ? reason : "") << ")";
Log(LOG_COMMAND, u, this, NULL) << "to reject vhost for " << nick << " (" << (!reason.empty() ? reason : "") << ")";
}
else
me->NoticeLang(Config->s_HostServ, u, LNG_NO_REQUEST, nick.c_str());
@@ -737,7 +737,7 @@ void my_memo_lang(User *u, const Anope::string &name, int z, int number, ...)
free(buf); // XXX
}
else
Alog() << me->name << ": INVALID language string call, language: [" << lang << "], String [" << number << "]";
Log() << me->name << ": INVALID language string call, language: [" << lang << "], String [" << number << "]";
}
void req_send_memos(User *u, const Anope::string &vIdent, const Anope::string &vHost)
@@ -794,7 +794,7 @@ void my_load_config()
HSRequestMemoOper = config.ReadFlag("hs_request", "memooper", "no", 0);
HSRequestMemoSetters = config.ReadFlag("hs_request", "memosetters", "no", 0);
Alog(LOG_DEBUG) << "[hs_request] Set config vars: MemoUser=" << HSRequestMemoUser << " MemoOper=" << HSRequestMemoOper << " MemoSetters=" << HSRequestMemoSetters;
Log(LOG_DEBUG) << "[hs_request] Set config vars: MemoUser=" << HSRequestMemoUser << " MemoOper=" << HSRequestMemoOper << " MemoSetters=" << HSRequestMemoSetters;
}
MODULE_INIT(HSRequest)
+5 -5
View File
@@ -58,7 +58,7 @@ class MySQLResult : public SQLResult
if (!num_fields)
return;
Alog(LOG_DEBUG) << "SQL query returned " << num_fields << " fields";
Log(LOG_DEBUG) << "SQL query returned " << num_fields << " fields";
for (MYSQL_ROW row; (row = mysql_fetch_row(res));)
{
@@ -70,7 +70,7 @@ class MySQLResult : public SQLResult
for (unsigned field_count = 0; field_count < num_fields; ++field_count)
{
Alog(LOG_DEBUG) << "Field count " << field_count << " name is: " << (fields[field_count].name ? fields[field_count].name : "") << ", data is: " << (row[field_count] ? row[field_count] : "");
Log(LOG_DEBUG) << "Field count " << field_count << " name is: " << (fields[field_count].name ? fields[field_count].name : "") << ", data is: " << (row[field_count] ? row[field_count] : "");
Anope::string column = (fields[field_count].name ? fields[field_count].name : "");
Anope::string data = (row[field_count] ? row[field_count] : "");
@@ -211,7 +211,7 @@ class ModuleSQL : public Module
if (i == num)
{
Alog() << "MySQL: Removing server connection " << cname;
Log(LOG_NORMAL, "mysql") << "MySQL: Removing server connection " << cname;
delete s;
this->MySQLServices.erase(cname);
@@ -235,11 +235,11 @@ class ModuleSQL : public Module
MySQLService *ss = new MySQLService(this, connname, database, server, user, password, port);
this->MySQLServices.insert(std::make_pair(connname, ss));
Alog() << "MySQL: Sucessfully connected to server " << connname << " (" << server << ")";
Log(LOG_NORMAL, "mysql") << "MySQL: Sucessfully connected to server " << connname << " (" << server << ")";
}
catch (const SQLException &ex)
{
Alog() << "MySQL: " << ex.GetReason();
Log(LOG_NORMAL, "mysql") << "MySQL: " << ex.GetReason();
}
}
}
+4 -4
View File
@@ -84,7 +84,7 @@ class SSLModule : public Module
}
}
else
Alog() << "m_ssl: No certificate file found";
Log() << "m_ssl: No certificate file found";
if (IsFile(KEYFILE))
{
@@ -102,7 +102,7 @@ class SSLModule : public Module
throw ModuleException("Error loading private key - file not found");
}
else
Alog() << "m_ssl: No private key found";
Log() << "m_ssl: No private key found";
}
this->SetAuthor("Anope");
@@ -129,11 +129,11 @@ class SSLModule : public Module
try
{
new SSLSocket(u->host, u->port, Config->LocalHost, u->ipv6);
Alog() << "Connected to Server " << Number << " (" << u->host << ":" << u->port << ")";
Log() << "Connected to Server " << Number << " (" << u->host << ":" << u->port << ")";
}
catch (const SocketException &ex)
{
Alog() << "Unable to connect with SSL to server" << Number << " (" << u->host << ":" << u->port << "), " << ex.GetReason();
Log() << "Unable to connect with SSL to server" << Number << " (" << u->host << ":" << u->port << "), " << ex.GetReason();
}
return EVENT_ALLOW;
+1 -1
View File
@@ -163,7 +163,7 @@ void my_load_config()
{
ConfigReader config;
NSEmailMax = config.ReadInteger("ns_maxemail", "maxemails", "0", 0, false);
Alog(LOG_DEBUG) << "[ns_maxemail] NSEmailMax set to " << NSEmailMax;
Log(LOG_DEBUG) << "[ns_maxemail] NSEmailMax set to " << NSEmailMax;
}
MODULE_INIT(NSMaxEmail)
+1 -1
View File
@@ -168,7 +168,7 @@ class NSSetMisc : public Module
CommandInfo *info = new CommandInfo(cname, desc, showhidden);
if (!this->Commands.insert(std::make_pair(cname, info)).second)
{
Alog() << "ns_set_misc: Warning, unable to add duplicate entry " << cname;
Log() << "ns_set_misc: Warning, unable to add duplicate entry " << cname;
delete info;
continue;
}
+4 -4
View File
@@ -342,7 +342,7 @@ int anope_event_sjoin(const Anope::string &source, int ac, const char **av)
{
User *u = finduser(source);
if (!u)
Alog(LOG_DEBUG) << "SJOIN for nonexistant user " << source << " on " << c->name;
Log(LOG_DEBUG) << "SJOIN for nonexistant user " << source << " on " << c->name;
else
{
EventReturn MOD_RESULT;
@@ -380,7 +380,7 @@ int anope_event_sjoin(const Anope::string &source, int ac, const char **av)
ChannelMode *cm = ModeManager::FindChannelModeByChar(ch);
if (!cm)
{
Alog() << "Receeved unknown mode prefix " << buf[0] << " in SJOIN string";
Log() << "Receeved unknown mode prefix " << buf[0] << " in SJOIN string";
continue;
}
@@ -391,7 +391,7 @@ int anope_event_sjoin(const Anope::string &source, int ac, const char **av)
User *u = finduser(buf);
if (!u)
{
Alog(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << c->name;
Log(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << c->name;
continue;
}
@@ -662,7 +662,7 @@ int anope_event_ping(const Anope::string &source, int ac, const char **av)
int anope_event_error(const Anope::string &source, int ac, const char **av)
{
if (ac >= 1)
Alog(LOG_DEBUG) << av[0];
Log(LOG_DEBUG) << av[0];
return MOD_CONT;
}
+10 -10
View File
@@ -392,7 +392,7 @@ int anope_event_fmode(const Anope::string &source, int ac, const char **av)
{
newav[o] = av[n];
++o;
Alog(LOG_DEBUG) << "Param: " << newav[o - 1];
Log(LOG_DEBUG) << "Param: " << newav[o - 1];
}
++n;
}
@@ -438,7 +438,7 @@ int anope_event_fjoin(const Anope::string &source, int ac, const char **av)
if (!cm)
{
Alog() << "Received unknown mode prefix " << buf[0] << " in FJOIN string";
Log() << "Received unknown mode prefix " << buf[0] << " in FJOIN string";
buf.erase(buf.begin());
continue;
}
@@ -451,7 +451,7 @@ int anope_event_fjoin(const Anope::string &source, int ac, const char **av)
User *u = finduser(buf);
if (!u)
{
Alog(LOG_DEBUG) << "FJOIN for nonexistant user " << buf << " on " << c->name;
Log(LOG_DEBUG) << "FJOIN for nonexistant user " << buf << " on " << c->name;
continue;
}
@@ -526,7 +526,7 @@ int anope_event_topic(const Anope::string &source, int ac, const char **av)
if (!c)
{
Alog(LOG_DEBUG) << "TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
Log(LOG_DEBUG) << "TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
return MOD_CONT;
}
@@ -628,7 +628,7 @@ int anope_event_setname(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "SETNAME for nonexistent user " << source;
Log(LOG_DEBUG) << "SETNAME for nonexistent user " << source;
return MOD_CONT;
}
@@ -646,7 +646,7 @@ int anope_event_chgname(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "FNAME for nonexistent user " << source;
Log(LOG_DEBUG) << "FNAME for nonexistent user " << source;
return MOD_CONT;
}
@@ -664,7 +664,7 @@ int anope_event_setident(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "SETIDENT for nonexistent user " << source;
Log(LOG_DEBUG) << "SETIDENT for nonexistent user " << source;
return MOD_CONT;
}
@@ -682,7 +682,7 @@ int anope_event_chgident(const Anope::string &source, int ac, const char **av)
u = finduser(av[0]);
if (!u)
{
Alog(LOG_DEBUG) << "CHGIDENT for nonexistent user " << av[0];
Log(LOG_DEBUG) << "CHGIDENT for nonexistent user " << av[0];
return MOD_CONT;
}
@@ -700,7 +700,7 @@ int anope_event_sethost(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "SETHOST for nonexistent user " << source;
Log(LOG_DEBUG) << "SETHOST for nonexistent user " << source;
return MOD_CONT;
}
@@ -755,7 +755,7 @@ int anope_event_chghost(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "FHOST for nonexistent user " << source;
Log(LOG_DEBUG) << "FHOST for nonexistent user " << source;
return MOD_CONT;
}
+11 -11
View File
@@ -417,7 +417,7 @@ int anope_event_fmode(const Anope::string &source, int ac, const char **av)
{
newav[o] = av[n];
++o;
Alog(LOG_DEBUG) << "Param: " << newav[o - 1];
Log(LOG_DEBUG) << "Param: " << newav[o - 1];
}
++n;
}
@@ -476,7 +476,7 @@ int anope_event_fjoin(const Anope::string &source, int ac, const char **av)
ChannelMode *cm = ModeManager::FindChannelModeByChar(buf[0]);
if (!cm)
{
Alog() << "Receeved unknown mode prefix " << buf[0] << " in FJOIN string";
Log() << "Receeved unknown mode prefix " << buf[0] << " in FJOIN string";
buf.erase(buf.begin());
continue;
}
@@ -490,7 +490,7 @@ int anope_event_fjoin(const Anope::string &source, int ac, const char **av)
User *u = finduser(buf);
if (!u)
{
Alog(LOG_DEBUG) << "FJOIN for nonexistant user " << buf << " on " << c->name;
Log(LOG_DEBUG) << "FJOIN for nonexistant user " << buf << " on " << c->name;
continue;
}
@@ -575,7 +575,7 @@ int anope_event_topic(const Anope::string &source, int ac, const char **av)
if (!c)
{
Alog(LOG_DEBUG) << "debug: TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
Log(LOG_DEBUG) << "debug: TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
return MOD_CONT;
}
@@ -660,7 +660,7 @@ int anope_event_setname(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "SETNAME for nonexistent user " << source;
Log(LOG_DEBUG) << "SETNAME for nonexistent user " << source;
return MOD_CONT;
}
@@ -675,7 +675,7 @@ int anope_event_chgname(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "FNAME for nonexistent user " << source;
Log(LOG_DEBUG) << "FNAME for nonexistent user " << source;
return MOD_CONT;
}
@@ -690,7 +690,7 @@ int anope_event_setident(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "SETIDENT for nonexistent user " << source;
Log(LOG_DEBUG) << "SETIDENT for nonexistent user " << source;
return MOD_CONT;
}
@@ -705,7 +705,7 @@ int anope_event_chgident(const Anope::string &source, int ac, const char **av)
u = finduser(av[0]);
if (!u)
{
Alog(LOG_DEBUG) << "CHGIDENT for nonexistent user " << av[0];
Log(LOG_DEBUG) << "CHGIDENT for nonexistent user " << av[0];
return MOD_CONT;
}
@@ -720,7 +720,7 @@ int anope_event_sethost(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "SETHOST for nonexistent user " << source;
Log(LOG_DEBUG) << "SETHOST for nonexistent user " << source;
return MOD_CONT;
}
@@ -791,7 +791,7 @@ int anope_event_chghost(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "FHOST for nonexistent user " << source;
Log(LOG_DEBUG) << "FHOST for nonexistent user " << source;
return MOD_CONT;
}
@@ -1206,7 +1206,7 @@ int anope_event_endburst(const Anope::string &source, int ac, const char **av)
u->RemoveMode(NickServ, UMODE_REGISTERED);
}
Alog() << "Processed ENDBURST for " << s->GetName();
Log(LOG_DEBUG) << "Processed ENDBURST for " << s->GetName();
s->Sync(true);
return MOD_CONT;
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -102,7 +102,7 @@ void ratbox_cmd_pass(const Anope::string &pass)
send_cmd("", "PASS %s TS 6 :%s", pass.c_str(), TS6SID.c_str());
}
class RatboxProto : public IRCDTS6Proto
class RatboxProto : public IRCDProto
{
void SendGlobopsInternal(BotInfo *source, const Anope::string &buf)
{
@@ -327,7 +327,7 @@ int anope_event_sjoin(const Anope::string &source, int ac, const char **av)
ChannelMode *cm = ModeManager::FindChannelModeByChar(ch);
if (!cm)
{
Alog() << "Received unknown mode prefix " << buf[0] << " in SJOIN string";
Log() << "Received unknown mode prefix " << buf[0] << " in SJOIN string";
continue;
}
@@ -338,7 +338,7 @@ int anope_event_sjoin(const Anope::string &source, int ac, const char **av)
User *u = finduser(buf);
if (!u)
{
Alog(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << c->name;
Log(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << c->name;
continue;
}
@@ -443,7 +443,7 @@ int anope_event_topic(const Anope::string &source, int ac, const char **av)
if (!c)
{
Alog(LOG_DEBUG) << "TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
Log(LOG_DEBUG) << "TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
return MOD_CONT;
}
@@ -487,7 +487,7 @@ int anope_event_tburst(const Anope::string &source, int ac, const char **av)
if (!c)
{
Alog(LOG_DEBUG) << "debug: TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
Log(LOG_DEBUG) << "debug: TOPIC " << merge_args(ac - 1, av + 1) << " for nonexistent channel " << av[0];
return MOD_CONT;
}
@@ -721,7 +721,7 @@ int anope_event_bmask(const Anope::string &source, int ac, const char **av)
int anope_event_error(const Anope::string &source, int ac, const char **av)
{
if (ac >= 1)
Alog(LOG_DEBUG) << av[0];
Log(LOG_DEBUG) << av[0];
return MOD_CONT;
}
+10 -10
View File
@@ -735,7 +735,7 @@ int anope_event_setname(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "SETNAME for nonexistent user " << source;
Log(LOG_DEBUG) << "SETNAME for nonexistent user " << source;
return MOD_CONT;
}
@@ -753,7 +753,7 @@ int anope_event_chgname(const Anope::string &source, int ac, const char **av)
u = finduser(av[0]);
if (!u)
{
Alog(LOG_DEBUG) << "CHGNAME for nonexistent user " << av[0];
Log(LOG_DEBUG) << "CHGNAME for nonexistent user " << av[0];
return MOD_CONT;
}
@@ -771,7 +771,7 @@ int anope_event_setident(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "SETIDENT for nonexistent user " << source;
Log(LOG_DEBUG) << "SETIDENT for nonexistent user " << source;
return MOD_CONT;
}
@@ -789,7 +789,7 @@ int anope_event_chgident(const Anope::string &source, int ac, const char **av)
u = finduser(av[0]);
if (!u)
{
Alog(LOG_DEBUG) << "CHGIDENT for nonexistent user " << av[0];
Log(LOG_DEBUG) << "CHGIDENT for nonexistent user " << av[0];
return MOD_CONT;
}
@@ -807,7 +807,7 @@ int anope_event_sethost(const Anope::string &source, int ac, const char **av)
u = finduser(source);
if (!u)
{
Alog(LOG_DEBUG) << "SETHOST for nonexistent user " << source;
Log(LOG_DEBUG) << "SETHOST for nonexistent user " << source;
return MOD_CONT;
}
@@ -920,7 +920,7 @@ int anope_event_chghost(const Anope::string &source, int ac, const char **av)
u = finduser(av[0]);
if (!u)
{
Alog(LOG_DEBUG) << "debug: CHGHOST for nonexistent user " << av[0];
Log(LOG_DEBUG) << "debug: CHGHOST for nonexistent user " << av[0];
return MOD_CONT;
}
@@ -972,9 +972,9 @@ int anope_event_error(const Anope::string &source, int ac, const char **av)
{
if (av[0])
{
Alog(LOG_DEBUG) << av[0];
Log(LOG_DEBUG) << av[0];
if (strstr(av[0], "No matching link configuration"))
Alog() << "Error: Your IRCD's link block may not be setup correctly, please check unrealircd.conf";
Log() << "Error: Your IRCD's link block may not be setup correctly, please check unrealircd.conf";
}
return MOD_CONT;
}
@@ -1063,7 +1063,7 @@ int anope_event_sjoin(const Anope::string &source, int ac, const char **av)
ChannelMode *cm = ModeManager::FindChannelModeByChar(ch);
if (!cm)
{
Alog() << "Received unknown mode prefix " << buf[0] << " in SJOIN string";
Log() << "Received unknown mode prefix " << buf[0] << " in SJOIN string";
continue;
}
@@ -1074,7 +1074,7 @@ int anope_event_sjoin(const Anope::string &source, int ac, const char **av)
User *u = finduser(buf);
if (!u)
{
Alog(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << c->name;
Log(LOG_DEBUG) << "SJOIN for nonexistant user " << buf << " on " << c->name;
continue;
}
@@ -20,7 +20,7 @@ class SocketEngineEPoll : public SocketEngineBase
if (max <= 0)
{
Alog() << "Can't determine maximum number of open sockets";
Log() << "Can't determine maximum number of open sockets";
throw ModuleException("Can't determine maximum number of open sockets");
}
@@ -28,7 +28,7 @@ class SocketEngineEPoll : public SocketEngineBase
if (EngineHandle == -1)
{
Alog() << "Could not initialize epoll socket engine: " << strerror(errno);
Log() << "Could not initialize epoll socket engine: " << strerror(errno);
throw ModuleException(Anope::string("Could not initialize epoll socket engine: ") + strerror(errno));
}
@@ -52,7 +52,7 @@ class SocketEngineEPoll : public SocketEngineBase
if (epoll_ctl(EngineHandle, EPOLL_CTL_ADD, ev.data.fd, &ev) == -1)
{
Alog() << "Unable to add fd " << ev.data.fd << " to socketengine epoll: " << strerror(errno);
Log() << "Unable to add fd " << ev.data.fd << " to socketengine epoll: " << strerror(errno);
return;
}
@@ -71,7 +71,7 @@ class SocketEngineEPoll : public SocketEngineBase
if (epoll_ctl(EngineHandle, EPOLL_CTL_DEL, ev.data.fd, &ev) == -1)
{
Alog() << "Unable to delete fd " << ev.data.fd << " from socketengine epoll: " << strerror(errno);
Log() << "Unable to delete fd " << ev.data.fd << " from socketengine epoll: " << strerror(errno);
return;
}
@@ -90,7 +90,7 @@ class SocketEngineEPoll : public SocketEngineBase
ev.data.fd = s->GetSock();
if (epoll_ctl(EngineHandle, EPOLL_CTL_MOD, ev.data.fd, &ev) == -1)
Alog() << "Unable to mark fd " << ev.data.fd << " as writable in socketengine epoll: " << strerror(errno);
Log() << "Unable to mark fd " << ev.data.fd << " as writable in socketengine epoll: " << strerror(errno);
}
void ClearWriteable(Socket *s)
@@ -103,7 +103,7 @@ class SocketEngineEPoll : public SocketEngineBase
ev.data.fd = s->GetSock();
if (epoll_ctl(EngineHandle, EPOLL_CTL_MOD, ev.data.fd, &ev) == -1)
Alog() << "Unable to mark fd " << ev.data.fd << " as unwritable in socketengine epoll: " << strerror(errno);
Log() << "Unable to mark fd " << ev.data.fd << " as unwritable in socketengine epoll: " << strerror(errno);
}
void Process()
@@ -112,7 +112,7 @@ class SocketEngineEPoll : public SocketEngineBase
if (total == -1)
{
Alog() << "SockEngine::Process(): error " << strerror(errno);
Log() << "SockEngine::Process(): error " << strerror(errno);
return;
}
@@ -65,7 +65,7 @@ class SocketEngineSelect : public SocketEngineBase
#ifdef WIN32
errno = WSAGetLastError();
#endif
Alog() << "SockEngine::Process(): error" << strerror(errno);
Log() << "SockEngine::Process(): error" << strerror(errno);
}
else if (sresult)
{
+8 -7
View File
@@ -20,16 +20,15 @@ BotInfo *MemoServ = NULL;
BotInfo *NickServ = NULL;
BotInfo *OperServ = NULL;
BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const Anope::string &nhost, const Anope::string &nreal) : User(nnick, ts6_uid_retrieve())
BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const Anope::string &nhost, const Anope::string &nreal) : User(nnick, nuser, nhost, ts6_uid_retrieve())
{
this->ident = nuser;
this->host = nhost;
this->realname = nreal;
this->server = Me;
this->chancount = 0;
this->lastmsg = this->created = time(NULL);
this->SetFlag(BI_CORE);
if (!Config->s_ChanServ.empty() && nnick.equals_ci(Config->s_ChanServ))
ChanServ = this;
else if (!Config->s_BotServ.empty() && nnick.equals_ci(Config->s_BotServ))
@@ -44,6 +43,8 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A
NickServ = this;
else if (!Config->s_GlobalNoticer.empty() && nnick.equals_ci(Config->s_GlobalNoticer))
Global = this;
else
this->UnsetFlag(BI_CORE);
BotListByNick[this->nick] = this;
if (!this->uid.empty())
@@ -168,16 +169,16 @@ void BotInfo::Join(Channel *c, bool update_ts)
c->JoinUser(this);
ChannelContainer *cc = this->FindChannel(c);
for (std::list<ChannelModeStatus *>::iterator it = BotModes.begin(), it_end = BotModes.end(); it != it_end; ++it)
for (int i = 0; i < Config->BotModeList.size(); ++i)
{
if (!update_ts)
{
c->SetMode(this, *it, this->nick, false);
c->SetMode(this, Config->BotModeList[i], this->nick, false);
}
else
{
cc->Status->SetFlag((*it)->Name);
c->SetModeInternal(*it, this->nick, false);
cc->Status->SetFlag(Config->BotModeList[i]->Name);
c->SetModeInternal(Config->BotModeList[i], this->nick, false);
}
}
if (!update_ts)
+39 -33
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -252,7 +252,7 @@ void check_modes(Channel *c)
if (!c)
{
Alog(LOG_DEBUG) << "check_modes called with NULL values";
Log() << "check_modes called with NULL values";
return;
}
@@ -263,7 +263,7 @@ void check_modes(Channel *c)
if (c->server_modecount >= 3 && c->chanserv_modecount >= 3)
{
ircdproto->SendGlobops(NULL, "Warning: unable to set modes on channel %s. Are your servers' U:lines configured correctly?", c->name.c_str());
Alog() << Config->s_ChanServ << ": Bouncy modes on channel " << c->name;
Log() << "Bouncy modes on channel " << c->name;
c->bouncy_modes = 1;
return;
}
@@ -497,7 +497,7 @@ int check_topiclock(Channel *c, time_t topic_time)
if (!c)
{
Alog(LOG_DEBUG) << "check_topiclock called with NULL values";
Log() << "check_topiclock called with NULL values";
return 0;
}
@@ -572,7 +572,7 @@ void expire_chans()
continue;
Anope::string chname = ci->name;
Alog() << "Expiring channel " << ci->name << " (founder: " << (ci->founder ? ci->founder->display : "(none)") << " )";
Log(LOG_NORMAL, "chanserv/expire") << "Expiring channel " << ci->name << " (founder: " << (ci->founder ? ci->founder->display : "(none)") << " )";
delete ci;
FOREACH_MOD(I_OnChanExpire, OnChanExpire(chname));
}
@@ -599,13 +599,13 @@ void cs_remove_nick(const NickCore *nc)
NickCore *nc2 = ci->successor;
if (!nc2->IsServicesOper() && Config->CSMaxReg && nc2->channelcount >= Config->CSMaxReg)
{
Alog() << Config->s_ChanServ << ": Successor (" << nc2->display << " ) of " << ci->name << " owns too many channels, deleting channel",
Log(LOG_NORMAL, "chanserv/expire") << "Successor (" << nc2->display << " ) of " << ci->name << " owns too many channels, deleting channel",
delete ci;
continue;
}
else
{
Alog() << Config->s_ChanServ << ": Transferring foundership of " << ci->name << " from deleted nick " << nc->display << " to successor " << nc2->display;
Log(LOG_NORMAL, "chanserv/expire") << "Transferring foundership of " << ci->name << " from deleted nick " << nc->display << " to successor " << nc2->display;
ci->founder = nc2;
ci->successor = NULL;
++nc2->channelcount;
@@ -613,7 +613,7 @@ void cs_remove_nick(const NickCore *nc)
}
else
{
Alog() << Config->s_ChanServ << ": Deleting channel " << ci->name << "owned by deleted nick " << nc->display;
Log(LOG_NORMAL, "chanserv/expire") << "Deleting channel " << ci->name << "owned by deleted nick " << nc->display;
if (ModeManager::FindChannelModeByName(CMODE_REGISTERED))
{
@@ -712,7 +712,7 @@ void reset_levels(ChannelInfo *ci)
if (!ci)
{
Alog(LOG_DEBUG) << "reset_levels() called with NULL values";
Log() << "reset_levels() called with NULL values";
return;
}
+4 -4
View File
@@ -58,7 +58,7 @@ void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command,
if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED) && !u->IsIdentified())
{
notice_lang(bi->nick, u, NICK_IDENTIFY_REQUIRED, Config->s_NickServ.c_str());
Alog() << "Access denied for unregistered user " << u->nick << " with service " << bi->nick << " and command " << command;
Log(LOG_COMMAND, "denied", bi) << "Access denied for unregistered user " << u->GetMask() << " with command " << command;
return;
}
@@ -103,13 +103,13 @@ void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command,
if (ci->HasFlag(CI_FORBIDDEN) && !c->HasFlag(CFLAG_ALLOW_FORBIDDEN))
{
notice_lang(bi->nick, u, CHAN_X_FORBIDDEN, ci->name.c_str());
Alog() << "Access denied for user " << u->nick << " with service " << bi->nick << " and command " << command << " because of FORBIDDEN channel " << ci->name;
Log(LOG_COMMAND, "denied", bi) << "Access denied for user " << u->GetMask() << " with command " << command << " because of FORBIDDEN channel " << ci->name;
return;
}
else if (ci->HasFlag(CI_SUSPENDED) && !c->HasFlag(CFLAG_ALLOW_SUSPENDED))
{
notice_lang(bi->nick, u, CHAN_X_FORBIDDEN, ci->name.c_str());
Alog() << "Access denied for user " << u->nick << " with service " << bi->nick <<" and command " << command << " because of SUSPENDED channel " << ci->name;
Log(LOG_COMMAND, "denied", bi) << "Access denied for user " << u->GetMask() << " with command " << command << " because of SUSPENDED channel " << ci->name;
return;
}
}
@@ -131,7 +131,7 @@ void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command,
if (!c->permission.empty() && !u->Account()->HasCommand(c->permission))
{
notice_lang(bi->nick, u, ACCESS_DENIED);
Alog() << "Access denied for user " << u->nick << " with service " << bi->nick << " and command " << command;
Log(LOG_COMMAND, "denied", bi) << "Access denied for user " << u->GetMask() << " with command " << command;
return;
}
+104 -23
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -38,7 +38,7 @@ int enc_decrypt(const Anope::string &src, Anope::string &dest)
size_t pos = src.find(':');
if (pos == Anope::string::npos)
{
Alog() << "Error: enc_decrypt() called with invalid password string (" << src << ")";
Log() << "Error: enc_decrypt() called with invalid password string (" << src << ")";
return -1;
}
Anope::string hashm(src.begin(), src.begin() + pos);
@@ -62,7 +62,7 @@ int enc_check_password(Anope::string &plaintext, Anope::string &password)
size_t pos = password.find(':');
if (pos == Anope::string::npos)
{
Alog() << "Error: enc_check_password() called with invalid password string (" << password << ")";
Log() << "Error: enc_check_password() called with invalid password string (" << password << ")";
return 0;
}
Anope::string hashm(password.begin(), password.begin() + pos);
+58 -99
View File
File diff suppressed because it is too large Load Diff
+9 -10
View File
@@ -65,7 +65,7 @@ static void load_lang(int index, const char *filename)
FILE *f;
int32 num, i;
Alog(LOG_DEBUG) << "Loading language " << index << " from file `languages/" << filename << "'";
Log(LOG_DEBUG) << "Loading language " << index << " from file `languages/" << filename << "'";
snprintf(buf, sizeof(buf), "languages/%s", filename);
#ifndef _WIN32
const char *mode = "r";
@@ -74,16 +74,15 @@ static void load_lang(int index, const char *filename)
#endif
if (!(f = fopen(buf, mode)))
{
log_perror("Failed to load language %d (%s)", index, filename);
return;
throw CoreException("Failed to load language " + stringify(index) + " (" + stringify(filename) + ")");
}
else if (read_int32(&num, f) < 0)
{
Alog() << "Failed to read number of strings for language " << index << "(" << filename << ")";
Log() << "Failed to read number of strings for language " << index << "(" << filename << ")";
return;
}
else if (num != NUM_STRINGS)
Alog() << "Warning: Bad number of strings (" << num << " , wanted " << NUM_STRINGS << ") for language " << index << " (" << filename << ")";
Log() << "Warning: Bad number of strings (" << num << " , wanted " << NUM_STRINGS << ") for language " << index << " (" << filename << ")";
langtexts[index] = static_cast<char **>(scalloc(sizeof(char *), NUM_STRINGS));
if (num > NUM_STRINGS)
num = NUM_STRINGS;
@@ -93,7 +92,7 @@ static void load_lang(int index, const char *filename)
fseek(f, i * 8 + 4, SEEK_SET);
if (read_int32(&pos, f) < 0 || read_int32(&len, f) < 0)
{
Alog() << "Failed to read entry " << i << " in language " << index << " (" << filename << ") TOC";
Log() << "Failed to read entry " << i << " in language " << index << " (" << filename << ") TOC";
while (--i >= 0)
{
if (langtexts[index][i])
@@ -107,7 +106,7 @@ static void load_lang(int index, const char *filename)
langtexts[index][i] = NULL;
else if (len >= 65536)
{
Alog() << "Entry " << i << " in language " << index << " (" << filename << ") is too long (over 64k) -- corrupt TOC?";
Log() << "Entry " << i << " in language " << index << " (" << filename << ") is too long (over 64k) -- corrupt TOC?";
while (--i >= 0)
{
if (langtexts[index][i])
@@ -119,7 +118,7 @@ static void load_lang(int index, const char *filename)
}
else if (len < 0)
{
Alog() << "Entry " << i << " in language " << index << " (" << filename << ") has negative length -- corrupt TOC?";
Log() << "Entry " << i << " in language " << index << " (" << filename << ") has negative length -- corrupt TOC?";
while (--i >= 0)
{
if (langtexts[index][i])
@@ -135,7 +134,7 @@ static void load_lang(int index, const char *filename)
fseek(f, pos, SEEK_SET);
if (fread(langtexts[index][i], 1, len, f) != len)
{
Alog() << "Failed to read string " << i << " in language " << index << "(" << filename << ")";
Log() << "Failed to read string " << i << " in language " << index << "(" << filename << ")";
while (--i >= 0)
{
if (langtexts[index][i])
@@ -225,7 +224,7 @@ void lang_init()
Config->NSDefLanguage = DEF_LANGUAGE;
if (!langtexts[DEF_LANGUAGE])
fatal("Unable to load default language");
throw CoreException("Unable to load default language");
for (i = 0; i < NUM_LANGS; ++i)
{
if (!langtexts[i])
-264
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More