diff options
author | Adam <Adam@anope.org> | 2011-08-20 00:50:26 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-08-20 00:50:26 -0400 |
commit | fa3b74a5b49ca7a2c42387bb7b5aa24e09c369d6 (patch) | |
tree | 26fc63833f93e915065ddeaab9c85968e5ffcfb4 | |
parent | fd999b996fe4c76ee10016dbcad316365d1b7988 (diff) |
Fixed zlines to only add the xline host, fixed db_mysql's write function, and prevent adding multiple of the same nick to access lists
-rw-r--r-- | data/chanserv.example.conf | 5 | ||||
-rw-r--r-- | modules/commands/cs_access.cpp | 6 | ||||
-rw-r--r-- | modules/commands/cs_xop.cpp | 6 | ||||
-rw-r--r-- | modules/database/db_mysql.cpp | 2 | ||||
-rw-r--r-- | modules/protocol/bahamut.cpp | 8 | ||||
-rw-r--r-- | modules/protocol/inspircd-ts6.h | 4 | ||||
-rw-r--r-- | modules/protocol/inspircd11.cpp | 4 | ||||
-rw-r--r-- | modules/protocol/unreal.cpp | 4 |
8 files changed, 20 insertions, 19 deletions
diff --git a/data/chanserv.example.conf b/data/chanserv.example.conf index 12f4840a5..df389b56d 100644 --- a/data/chanserv.example.conf +++ b/data/chanserv.example.conf @@ -477,11 +477,12 @@ command { service = "ChanServ"; name = "REGISTER"; command = "chanserv/register" * * Provides the commands chanserv/seen and operserv/seen. * - * Logs for each user when he or she was last seen and makes this information publically available. + * Records the last time a user was seen and what they were doing and allows users to request this data. + * Also allows administrators to view stats about seen data and purge the database. */ module { name = "cs_seen" } command { service = "ChanServ"; name = "SEEN"; command = "chanserv/seen"; } -command { service = "OperServ"; name = "SEEN"; command = "operserv/seen"; } +#command { service = "OperServ"; name = "SEEN"; command = "operserv/seen"; } /* * cs_set diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index af210ce17..d269b1499 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -320,6 +320,9 @@ class CommandCSAccess : public Command bool override = !ci->AccessFor(u).HasPriv(CA_ACCESS_CHANGE) || level >= u_level; + if (mask.find_first_of("!*@") == Anope::string::npos && findnick(mask) == NULL) + mask += "!*@*"; + for (unsigned i = ci->GetAccessCount(); i > 0; --i) { ChanAccess *access = ci->GetAccess(i - 1); @@ -342,9 +345,6 @@ class CommandCSAccess : public Command return; } - if (mask.find_first_of("!*@") == Anope::string::npos && findnick(mask) == NULL) - mask += "!*@*"; - service_reference<AccessProvider> provider("access/access"); if (!provider) return; diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index e886496c1..1ea99541e 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -322,6 +322,9 @@ class XOPBase : public Command return; } + if (mask.find_first_of("!*@") == Anope::string::npos && findnick(mask) == NULL) + mask += "!*@*"; + for (unsigned i = 0; i < ci->GetAccessCount(); ++i) { ChanAccess *a = ci->GetAccess(i); @@ -345,9 +348,6 @@ class XOPBase : public Command return; } - if (mask.find_first_of("!*@") == Anope::string::npos && findnick(mask) == NULL) - mask += "!*@*"; - service_reference<AccessProvider> provider("access/xop"); if (!provider) return; diff --git a/modules/database/db_mysql.cpp b/modules/database/db_mysql.cpp index e0cfbd00a..8cdd6f6c1 100644 --- a/modules/database/db_mysql.cpp +++ b/modules/database/db_mysql.cpp @@ -1396,7 +1396,7 @@ static void Write(const Anope::string &data) { SQLQuery query("INSERT INTO `anope_extra` (data) VALUES(@data)"); query.setValue("data", data); - me->RunQuery(data); + me->RunQuery(query); } static void WriteNickMetadata(const Anope::string &key, const Anope::string &data) diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index 438703b78..880d10a3a 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -117,18 +117,18 @@ class BahamutIRCdProto : public IRCDProto void SendSZLineDel(const XLine *x) { /* this will likely fail so its only here for legacy */ - send_cmd("", "UNSZLINE 0 %s", x->Mask.c_str()); + send_cmd("", "UNSZLINE 0 %s", x->GetHost().c_str()); /* this is how we are supposed to deal with it */ - send_cmd("", "RAKILL %s *", x->Mask.c_str()); + send_cmd("", "RAKILL %s *", x->GetHost().c_str()); } /* SZLINE */ void SendSZLine(User *, const XLine *x) { /* this will likely fail so its only here for legacy */ - send_cmd("", "SZLINE %s :%s", x->Mask.c_str(), x->Reason.c_str()); + send_cmd("", "SZLINE %s :%s", x->GetHost().c_str(), x->Reason.c_str()); /* this is how we are supposed to deal with it */ - send_cmd("", "AKILL %s * %d %s %ld :%s", x->Mask.c_str(), 172800, x->By.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str()); + send_cmd("", "AKILL %s * %d %s %ld :%s", x->GetHost().c_str(), 172800, x->By.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str()); } /* SVSNOOP */ diff --git a/modules/protocol/inspircd-ts6.h b/modules/protocol/inspircd-ts6.h index e4d9995b3..bb2c1cc9a 100644 --- a/modules/protocol/inspircd-ts6.h +++ b/modules/protocol/inspircd-ts6.h @@ -200,13 +200,13 @@ class InspIRCdTS6Proto : public IRCDProto /* UNSZLINE */ void SendSZLineDel(const XLine *x) { - send_cmd(Config->Numeric, "DELLINE Z %s", x->Mask.c_str()); + send_cmd(Config->Numeric, "DELLINE Z %s", x->GetHost().c_str()); } /* SZLINE */ void SendSZLine(User *, const XLine *x) { - send_cmd(Config->Numeric, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str()); + send_cmd(Config->Numeric, "ADDLINE Z %s %s %ld 0 :%s", x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str()); } void SendSVSJoin(const Anope::string &source, const Anope::string &nick, const Anope::string &chan, const Anope::string &) diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index 742c2dc88..a5f8e1d86 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -239,13 +239,13 @@ class InspIRCdProto : public IRCDProto /* UNSZLINE */ void SendSZLineDel(const XLine *x) { - send_cmd(Config->OperServ, "ZLINE %s", x->Mask.c_str()); + send_cmd(Config->OperServ, "ZLINE %s", x->GetHost().c_str()); } /* SZLINE */ void SendSZLine(User *, const XLine *x) { - send_cmd(Config->ServerName, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str()); + send_cmd(Config->ServerName, "ADDLINE Z %s %s %ld 0 :%s", x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str()); } void SendSVSJoin(const Anope::string &source, const Anope::string &nick, const Anope::string &chan, const Anope::string &) diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index 29ad1e1cd..902309267 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -259,13 +259,13 @@ class UnrealIRCdProto : public IRCDProto /* UNSZLINE */ void SendSZLineDel(const XLine *x) { - send_cmd("", "BD - Z * %s %s", x->Mask.c_str(), Config->OperServ.c_str()); + send_cmd("", "BD - Z * %s %s", x->GetHost().c_str(), Config->OperServ.c_str()); } /* SZLINE */ void SendSZLine(User *, const XLine *x) { - send_cmd("", "BD + Z * %s %s %ld %ld :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime + 172800), static_cast<long>(Anope::CurTime), x->Reason.c_str()); + send_cmd("", "BD + Z * %s %s %ld %ld :%s", x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime + 172800), static_cast<long>(Anope::CurTime), x->Reason.c_str()); } /* SGLINE */ |