diff options
author | Sadie Powell <sadie@witchery.services> | 2023-10-20 18:32:57 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2023-10-22 23:31:48 +0100 |
commit | 97fa6d84bcb70b3b87d3fd7cc14f3b2567ca4e11 (patch) | |
tree | 3761cb82f6bf292ed34a54079315ca6511f93f4d /modules/commands/ns_register.cpp | |
parent | 02940e4ea810f2fa634f5a783f5ed966b936d6f4 (diff) |
Fix confirming an unconfirmed operator's account.
Diffstat (limited to 'modules/commands/ns_register.cpp')
-rw-r--r-- | modules/commands/ns_register.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index d38b07bc6..db606cb5b 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -25,7 +25,10 @@ class CommandNSConfirm : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - if (source.nc && (!source.nc->HasExt("UNCONFIRMED") || source.IsOper()) && source.HasPriv("nickserv/confirm")) + Anope::string *code = source.nc ? source.nc->GetExt<Anope::string>("passcode") : NULL; + bool confirming_other = !code || *code != params[0]; + + if (source.nc && (!source.nc->HasExt("UNCONFIRMED") || (source.IsOper() && confirming_other)) && source.HasPriv("nickserv/confirm")) { const Anope::string &nick = params[0]; NickAlias *na = NickAlias::Find(nick); @@ -58,7 +61,6 @@ class CommandNSConfirm : public Command else if (source.nc) { const Anope::string &passcode = params[0]; - Anope::string *code = source.nc->GetExt<Anope::string>("passcode"); if (code != NULL && *code == passcode) { NickCore *nc = source.nc; |