summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/hs_group.cpp4
-rw-r--r--modules/commands/ms_info.cpp25
-rw-r--r--modules/commands/ns_group.cpp2
-rw-r--r--modules/commands/ns_info.cpp2
-rw-r--r--modules/commands/os_akill.cpp7
-rw-r--r--modules/commands/os_oper.cpp2
-rw-r--r--modules/commands/os_sxline.cpp8
-rw-r--r--modules/extra/m_sql_oper.cpp44
-rw-r--r--modules/pseudoclients/memoserv.cpp4
-rw-r--r--modules/pseudoclients/nickserv.cpp2
-rw-r--r--modules/pseudoclients/operserv.cpp5
-rw-r--r--modules/webcpanel/pages/chanserv/access.cpp3
12 files changed, 84 insertions, 24 deletions
diff --git a/modules/commands/hs_group.cpp b/modules/commands/hs_group.cpp
index 232b2bef3..9924d7836 100644
--- a/modules/commands/hs_group.cpp
+++ b/modules/commands/hs_group.cpp
@@ -55,9 +55,9 @@ class CommandHSGroup : public Command
{
this->Sync(na);
if (!na->GetVhostIdent().empty())
- source.Reply(_("All vhost's in the group \002%s\002 have been set to \002%s\002@\002%s\002."), source.nc->display.c_str(), na->GetVhostIdent().c_str(), na->GetVhostHost().c_str());
+ source.Reply(_("All vhosts in the group \002%s\002 have been set to \002%s\002@\002%s\002."), source.nc->display.c_str(), na->GetVhostIdent().c_str(), na->GetVhostHost().c_str());
else
- source.Reply(_("All vhost's in the group \002%s\002 have been set to \002%s\002."), source.nc->display.c_str(), na->GetVhostHost().c_str());
+ source.Reply(_("All vhosts in the group \002%s\002 have been set to \002%s\002."), source.nc->display.c_str(), na->GetVhostHost().c_str());
}
else
source.Reply(HOST_NOT_ASSIGNED);
diff --git a/modules/commands/ms_info.cpp b/modules/commands/ms_info.cpp
index 00df72769..9a4b28142 100644
--- a/modules/commands/ms_info.cpp
+++ b/modules/commands/ms_info.cpp
@@ -168,15 +168,32 @@ class CommandMSInfo : public Command
else
source.Reply(_("You have no limit on the number of memos you may keep."));
- /* Ripped too. But differently because of a seg fault (loughs) */
+ bool memo_mail = nc->HasExt("MEMO_MAIL");
if (nc->HasExt("MEMO_RECEIVE") && nc->HasExt("MEMO_SIGNON"))
- source.Reply(_("You will be notified of new memos at logon and when they arrive."));
+ {
+ if (memo_mail)
+ source.Reply(_("You will be notified of new memos at logon and when they arrive, and by mail when they arrive."));
+ else
+ source.Reply(_("You will be notified of new memos at logon and when they arrive."));
+ }
else if (nc->HasExt("MEMO_RECEIVE"))
- source.Reply(_("You will be notified when new memos arrive."));
+ {
+ if (memo_mail)
+ source.Reply(_("You will be notified by message and by mail when new memos arrive."));
+ else
+ source.Reply(_("You will be notified when new memos arrive."));
+ }
else if (nc->HasExt("MEMO_SIGNON"))
- source.Reply(_("You will be notified of new memos at logon."));
+ {
+ if (memo_mail)
+ source.Reply(_("You will be notified of new memos at logon, and by mail when they arrive."));
+ else
+ source.Reply(_("You will be notified of new memos at logon."));
+ }
else
+ {
source.Reply(_("You will not be notified of new memos."));
+ }
}
}
diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp
index 11e4091cd..8d85a305d 100644
--- a/modules/commands/ns_group.cpp
+++ b/modules/commands/ns_group.cpp
@@ -259,7 +259,7 @@ class CommandNSUngroup : public Command
source.Reply(_("Nick %s has been ungrouped from %s."), na->nick.c_str(), oldcore->display.c_str());
- User *user = User::Find(na->nick);
+ User *user = User::Find(na->nick, true);
if (user)
/* The user on the nick who was ungrouped may be identified to the old group, set -r */
user->RemoveMode(source.service, "REGISTERED");
diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp
index 443b6a9b7..692c4abf3 100644
--- a/modules/commands/ns_info.cpp
+++ b/modules/commands/ns_info.cpp
@@ -40,7 +40,7 @@ class CommandNSInfo : public Command
bool nick_online = false, show_hidden = false;
/* Is the real owner of the nick we're looking up online? -TheShadow */
- User *u2 = User::Find(na->nick);
+ User *u2 = User::Find(na->nick, true);
if (u2 && u2->Account() == na->nc)
{
nick_online = true;
diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp
index 81c440ef3..154390135 100644
--- a/modules/commands/os_akill.cpp
+++ b/modules/commands/os_akill.cpp
@@ -287,6 +287,7 @@ class CommandOSAKill : public Command
entry["Creator"] = x->by;
entry["Created"] = Anope::strftime(x->created, NULL, true);
entry["Expires"] = Anope::Expires(x->expires, source.nc);
+ entry["ID"] = x->id;
entry["Reason"] = x->reason;
this->list.AddEntry(entry);
}
@@ -308,6 +309,7 @@ class CommandOSAKill : public Command
entry["Creator"] = x->by;
entry["Created"] = Anope::strftime(x->created, NULL, true);
entry["Expires"] = Anope::Expires(x->expires, source.nc);
+ entry["ID"] = x->id;
entry["Reason"] = x->reason;
list.AddEntry(entry);
}
@@ -353,7 +355,10 @@ class CommandOSAKill : public Command
}
ListFormatter list(source.GetAccount());
- list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("Creator")).AddColumn(_("Created")).AddColumn(_("Expires")).AddColumn(_("Reason"));
+ list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("Creator")).AddColumn(_("Created")).AddColumn(_("Expires"));
+ if (Config->GetModule("operserv")->Get<bool>("akillids"))
+ list.AddColumn(_("ID"));
+ list.AddColumn(_("Reason"));
this->ProcessList(source, params, list);
}
diff --git a/modules/commands/os_oper.cpp b/modules/commands/os_oper.cpp
index 7b74af5ea..751c76cc9 100644
--- a/modules/commands/os_oper.cpp
+++ b/modules/commands/os_oper.cpp
@@ -135,6 +135,8 @@ class CommandOSOper : public Command
source.Reply(_("Nick \002%s\002 is not a Services Operator."), oper.c_str());
else if (!HasPrivs(source, na->nc->o->ot))
source.Reply(ACCESS_DENIED);
+ else if (std::find(Config->Opers.begin(), Config->Opers.end(), na->nc->o) != Config->Opers.end())
+ source.Reply(_("Oper \002%s\002 is configured in the configuration file(s) and can not be removed by this command."), na->nc->display.c_str());
else
{
delete na->nc->o;
diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp
index eb3d570ec..eadb276b4 100644
--- a/modules/commands/os_sxline.cpp
+++ b/modules/commands/os_sxline.cpp
@@ -144,6 +144,7 @@ class CommandOSSXLineBase : public Command
entry["By"] = x->by;
entry["Created"] = Anope::strftime(x->created, NULL, true);
entry["Expires"] = Anope::Expires(x->expires, source.nc);
+ entry["ID"] = x->id;
entry["Reason"] = x->reason;
list.AddEntry(entry);
}
@@ -165,6 +166,7 @@ class CommandOSSXLineBase : public Command
entry["By"] = x->by;
entry["Created"] = Anope::strftime(x->created, NULL, true);
entry["Expires"] = Anope::Expires(x->expires, source.nc);
+ entry["ID"] = x->id;
entry["Reason"] = x->reason;
list.AddEntry(entry);
}
@@ -196,7 +198,11 @@ class CommandOSSXLineBase : public Command
void OnView(CommandSource &source, const std::vector<Anope::string> &params)
{
ListFormatter list(source.GetAccount());
- list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("By")).AddColumn(_("Created")).AddColumn(_("Expires")).AddColumn(_("Reason"));
+ list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("By")).AddColumn(_("Created")).AddColumn(_("Expires"));
+ if (Config->GetModule("operserv")->Get<bool>("akillids"))
+ list.AddColumn(_("ID"));
+ list.AddColumn(_("Reason"));
+
this->ProcessList(source, params, list);
}
diff --git a/modules/extra/m_sql_oper.cpp b/modules/extra/m_sql_oper.cpp
index 3203021bc..060893e19 100644
--- a/modules/extra/m_sql_oper.cpp
+++ b/modules/extra/m_sql_oper.cpp
@@ -17,6 +17,18 @@ class SQLOperResult : public SQL::Interface
~SQLOperResultDeleter() { delete res; }
};
+ void Deoper()
+ {
+ if (user->Account() && user->Account()->o && dynamic_cast<SQLOper *>(user->Account()->o))
+ {
+ delete user->Account()->o;
+ user->Account()->o = NULL;
+
+ Log(this->owner) << "m_sql_oper: Removed services operator from " << user->nick << " (" << user->Account()->display << ")";
+ user->RemoveMode(OperServ, "OPER"); // Probably not set, just incase
+ }
+ }
+
public:
SQLOperResult(Module *m, User *u) : SQL::Interface(m), user(u) { }
@@ -24,9 +36,16 @@ class SQLOperResult : public SQL::Interface
{
SQLOperResultDeleter d(this);
- if (!user || !user->Account() || r.Rows() == 0)
+ if (!user || !user->Account())
return;
+ if (r.Rows() == 0)
+ {
+ Log(LOG_DEBUG) << "m_sql_oper: Got 0 rows for " << user->nick;
+ Deoper();
+ return;
+ }
+
Anope::string opertype;
try
{
@@ -34,6 +53,7 @@ class SQLOperResult : public SQL::Interface
}
catch (const SQL::Exception &)
{
+ Log(this) << "Expected column named \"opertype\" but one was not found";
return;
}
@@ -44,19 +64,15 @@ class SQLOperResult : public SQL::Interface
{
modes = r.Get(0, "modes");
}
- catch (const SQL::Exception &) { }
+ catch (const SQL::Exception &)
+ {
+ // Common case here is an exception, but this probably doesn't get this far often
+ }
BotInfo *OperServ = Config->GetClient("OperServ");
if (opertype.empty())
{
- if (user->Account() && user->Account()->o && dynamic_cast<SQLOper *>(user->Account()->o))
- {
- delete user->Account()->o;
- user->Account()->o = NULL;
-
- Log(this->owner) << "m_sql_oper: Removed services operator from " << user->nick << " (" << user->Account()->display << ")";
- user->RemoveMode(OperServ, "OPER"); // Probably not set, just incase
- }
+ Deoper();
return;
}
@@ -67,9 +83,17 @@ class SQLOperResult : public SQL::Interface
return;
}
+ if (user->Account()->o && !dynamic_cast<SQLOper *>(user->Account()->o))
+ {
+ Log(this) << "Oper " << user->Account()->display << " has type " << opertype << ", but is already configured as an oper of type " << user->Account()->o->ot->GetName();
+ return;
+ }
+
if (!user->Account()->o || user->Account()->o->ot != ot)
{
Log(this->owner) << "m_sql_oper: Tieing oper " << user->nick << " to type " << opertype;
+
+ delete user->Account()->o;
user->Account()->o = new SQLOper(user->Account()->display, ot);
}
diff --git a/modules/pseudoclients/memoserv.cpp b/modules/pseudoclients/memoserv.cpp
index f4ba325fb..2c4c53f16 100644
--- a/modules/pseudoclients/memoserv.cpp
+++ b/modules/pseudoclients/memoserv.cpp
@@ -49,7 +49,7 @@ class MemoServCore : public Module, public MemoServService
if (mi == NULL)
return MEMO_INVALID_TARGET;
- User *sender = User::Find(source);
+ User *sender = User::Find(source, true);
if (sender != NULL && !sender->HasPriv("memoserv/no-limit") && !force)
{
time_t send_delay = Config->GetModule("memoserv")->Get<time_t>("senddelay");
@@ -103,7 +103,7 @@ class MemoServCore : public Module, public MemoServService
for (unsigned i = 0; i < nc->aliases->size(); ++i)
{
const NickAlias *na = nc->aliases->at(i);
- User *user = User::Find(na->nick);
+ User *user = User::Find(na->nick, true);
if (user && user->IsIdentified())
user->SendMessage(MemoServ, MEMO_NEW_MEMO_ARRIVED, source.c_str(), Config->StrictPrivmsg.c_str(), MemoServ->nick.c_str(), mi->memos->size());
}
diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp
index 5d3579ced..b3d7bcc3b 100644
--- a/modules/pseudoclients/nickserv.cpp
+++ b/modules/pseudoclients/nickserv.cpp
@@ -535,7 +535,7 @@ class NickServCore : public Module, public NickServService
NickAlias *na = it->second;
++it;
- User *u = User::Find(na->nick);
+ User *u = User::Find(na->nick, true);
if (u && (u->IsIdentified(true) || u->IsRecognized()))
na->last_seen = Anope::CurTime;
diff --git a/modules/pseudoclients/operserv.cpp b/modules/pseudoclients/operserv.cpp
index 439c33708..7780091f2 100644
--- a/modules/pseudoclients/operserv.cpp
+++ b/modules/pseudoclients/operserv.cpp
@@ -92,7 +92,10 @@ class SQLineManager : public XLineManager
u->Kill(Config->GetClient("OperServ"), "Q-Lined: " + x->reason);
}
else if (x->IsRegex())
- ;
+ {
+ if (u)
+ u->Kill(Config->GetClient("OperServ"), "Q-Lined: " + x->reason);
+ }
else if (x->mask[0] != '#' || IRCD->CanSQLineChannel)
IRCD->SendSQLine(u, x);
}
diff --git a/modules/webcpanel/pages/chanserv/access.cpp b/modules/webcpanel/pages/chanserv/access.cpp
index daa8e7406..8a435e9d4 100644
--- a/modules/webcpanel/pages/chanserv/access.cpp
+++ b/modules/webcpanel/pages/chanserv/access.cpp
@@ -93,6 +93,9 @@ bool WebCPanel::ChanServ::Access::OnRequest(HTTPProvider *server, const Anope::s
}
}
+ /* command might have invalidated u_access */
+ u_access = ci->AccessFor(na->nc);
+
replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname);
replacements["ACCESS_CHANGE"] = u_access.HasPriv("ACCESS_CHANGE") ? "YES" : "NO";