diff options
author | Adam <Adam@anope.org> | 2016-09-30 21:31:53 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-09-30 21:31:53 -0400 |
commit | c8b35704696c1931fa07096fa645f099a74b62e0 (patch) | |
tree | f43e0852cd9e7f83a3f0a1d171384a0649eeb671 | |
parent | 17c2129a043641479ad2eb71c2e22d881fd88186 (diff) |
operserv/oper: don't allow deleting conf opers
-rw-r--r-- | modules/operserv/oper.cpp | 14 |
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; |