diff options
author | Sadie Powell <sadie@witchery.services> | 2024-02-17 19:31:38 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-02-17 19:52:39 +0000 |
commit | 2b7872139c40ea5b0ca96c1d6595b7d5f9fa60a5 (patch) | |
tree | 323f09a2e5d429d2494724494cc6b4a563836e55 | |
parent | 8e3be203873542b31b9be7ceb04ec86cbb1df03b (diff) |
Prevent resetting the password of suspended accounts.
Closes #351.
-rw-r--r-- | modules/commands/ns_resetpass.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index bf5f30230..fe94c939b 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -29,6 +29,8 @@ class CommandNSResetPass : public Command if (!(na = NickAlias::Find(params[0]))) source.Reply(NICK_X_NOT_REGISTERED, params[0].c_str()); + else if (na->nc->HasExt("NS_SUSPENDED")) + source.Reply(NICK_X_SUSPENDED, na->nc->display.c_str()); else if (!na->nc->email.equals_ci(params[1])) source.Reply(_("Incorrect email address.")); else @@ -89,6 +91,12 @@ class NSResetPass : public Module if (na && ri) { NickCore *nc = na->nc; + if (nc->HasExt("NS_SUSPENDED")) + { + source.Reply(NICK_X_SUSPENDED, nc->display.c_str()); + return EVENT_STOP; + } + const Anope::string &passcode = params[1]; if (ri->time < Anope::CurTime - 3600) { |