From e0da3bae18776f047b3639359a5e7f3a1324a110 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 14 May 2026 09:45:59 +0100 Subject: [PATCH] Fix confirming accounts when admin-only confirmation is enabled. --- language/anope.en_US.po | 9 +++++++-- modules/nickserv/ns_register.cpp | 22 ++++++++++++++++------ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/language/anope.en_US.po b/language/anope.en_US.po index e3abfce97..952007cb3 100644 --- a/language/anope.en_US.po +++ b/language/anope.en_US.po @@ -16,8 +16,8 @@ msgid "" msgstr "" "Project-Id-Version: Anope\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-04-26 18:25+0100\n" -"PO-Revision-Date: 2026-04-26 18:25+0100\n" +"POT-Creation-Date: 2026-05-14 09:44+0100\n" +"PO-Revision-Date: 2026-05-14 09:44+0100\n" "Last-Translator: Sadie Powell \n" "Language-Team: English\n" "Language: en_US\n" @@ -7234,6 +7234,11 @@ msgstr "" msgid "The registration confirmation code you specified for %s is incorrect." msgstr "" +#: ../modules/nickserv/ns_register.cpp +#, c-format +msgid "The registration of %s can only be confirmed by an administrator." +msgstr "" + #: ../modules/nickserv/ns_info.cpp #, c-format msgid "The services access status of %s will now be hidden from %s INFO displays." diff --git a/modules/nickserv/ns_register.cpp b/modules/nickserv/ns_register.cpp index 1bc992895..46fb182d2 100644 --- a/modules/nickserv/ns_register.cpp +++ b/modules/nickserv/ns_register.cpp @@ -275,18 +275,28 @@ public: return; } - auto *passcode = nc->GetExt("passcode"); - if (!passcode) + if (!nc->HasExt("UNCONFIRMED")) { source.Reply(_("There is no registration confirmation pending for %s."), na->nick.c_str()); return; } - if (!code.empty() && !code.equals_cs(*passcode)) + + if (!code.empty()) { - source.Reply(_("The registration confirmation code you specified for %s is incorrect."), - na->nick.c_str()); - return; + auto *passcode = nc->GetExt("passcode"); + if (passcode && !code.equals_cs(*passcode)) + { + source.Reply(_("The registration confirmation code you specified for %s is incorrect."), + na->nick.c_str()); + return; + } + else if (!passcode) + { + source.Reply(_("The registration of %s can only be confirmed by an administrator."), + na->nick.c_str()); + return; + } } nc->Shrink("passcode");