summaryrefslogtreecommitdiff
path: root/modules/operserv/oper.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-09-30 21:31:53 -0400
committerAdam <Adam@anope.org>2016-09-30 21:31:53 -0400
commitc8b35704696c1931fa07096fa645f099a74b62e0 (patch)
treef43e0852cd9e7f83a3f0a1d171384a0649eeb671 /modules/operserv/oper.cpp
parent17c2129a043641479ad2eb71c2e22d881fd88186 (diff)
operserv/oper: don't allow deleting conf opers
Diffstat (limited to 'modules/operserv/oper.cpp')
-rw-r--r--modules/operserv/oper.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/operserv/oper.cpp b/modules/operserv/oper.cpp
index 0364b41ba..40880d8fc 100644
--- a/modules/operserv/oper.cpp
+++ b/modules/operserv/oper.cpp
@@ -111,24 +111,32 @@ class CommandOSOper : public Command
}
NickServ::Nick *na = NickServ::FindNick(oper);
- if (na == NULL)
+ if (na == nullptr || na->GetAccount() == nullptr)
{
source.Reply(_("\002{0}\002 isn't registered."), oper);
return;
}
- if (!na->GetAccount() || !na->GetAccount()->o)
+ Oper *o = na->GetAccount()->o;
+
+ if (o == nullptr)
{
source.Reply(_("Nick \002{0}\002 is not a Services Operator."), oper);
return;
}
- if (!HasPrivs(source, na->GetAccount()->o->GetType()))
+ if (!HasPrivs(source, o->GetType()))
{
source.Reply(_("Access denied."));
return;
}
+ if (o->conf != nullptr)
+ {
+ source.Reply(_("Oper \002{0}\002 is configured in the configuration file(s) and can not be removed by this command."), na->GetNick());
+ return;
+ }
+
na->GetAccount()->o->Delete();
na->GetAccount()->o = NULL;