mirror of
https://github.com/anope/anope.git
synced 2026-06-25 03:06:37 +02:00
Do not allow nickserv/ungroup to bypass ns_maxemail, and allow opers to bypass ns_maxemail
This commit is contained in:
+10
-2
@@ -25,9 +25,9 @@ class NSMaxEmail : public Module
|
||||
return false;
|
||||
|
||||
if (NSEmailMax == 1)
|
||||
source.Reply(_("The given email address has reached its usage limit of 1 user."));
|
||||
source.Reply(_("The email address \2%s\2 has reached its usage limit of 1 user."), email.c_str());
|
||||
else
|
||||
source.Reply(_("The given email address has reached its usage limit of %d users."), NSEmailMax);
|
||||
source.Reply(_("The email address \2%s\2 has reached its usage limit of %d users."), email.c_str(), NSEmailMax);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -57,6 +57,9 @@ class NSMaxEmail : public Module
|
||||
|
||||
EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
if (source.IsOper())
|
||||
return EVENT_CONTINUE;
|
||||
|
||||
if (command->name == "nickserv/register")
|
||||
{
|
||||
if (this->CheckLimitReached(source, params.size() > 1 ? params[1] : ""))
|
||||
@@ -67,6 +70,11 @@ class NSMaxEmail : public Module
|
||||
if (this->CheckLimitReached(source, params.size() > 0 ? params[0] : ""))
|
||||
return EVENT_STOP;
|
||||
}
|
||||
else if (command->name == "nickserv/ungroup" && source.GetAccount())
|
||||
{
|
||||
if (this->CheckLimitReached(source, source.GetAccount()->email))
|
||||
return EVENT_STOP;
|
||||
}
|
||||
|
||||
return EVENT_CONTINUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user