diff options
-rw-r--r-- | modules/commands/ns_group.cpp | 11 | ||||
-rw-r--r-- | modules/commands/ns_identify.cpp | 9 | ||||
-rw-r--r-- | modules/commands/ns_recover.cpp | 15 |
3 files changed, 25 insertions, 10 deletions
diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index f4a464d28..ff4d5029e 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -62,9 +62,14 @@ class NSGroupRequest : public IdentifyRequest if (!source.GetUser()) return; - Log(LOG_COMMAND, source, cmd) << "failed group for " << target->nick; - source.Reply(PASSWORD_INCORRECT); - source.GetUser()->BadPassword(); + Log(LOG_COMMAND, source, cmd) << "and failed to group to " << target->nick; + if (NickAlias::Find(GetAccount()) != NULL) + { + source.Reply(PASSWORD_INCORRECT); + source.GetUser()->BadPassword(); + } + else + source.Reply(NICK_X_NOT_REGISTERED, GetAccount().c_str()); } }; diff --git a/modules/commands/ns_identify.cpp b/modules/commands/ns_identify.cpp index 4796e7bb6..f1e0a7d3d 100644 --- a/modules/commands/ns_identify.cpp +++ b/modules/commands/ns_identify.cpp @@ -48,8 +48,13 @@ class NSIdentifyRequest : public IdentifyRequest if (source.GetUser()) { Log(LOG_COMMAND, source, cmd) << "and failed to identify"; - source.Reply(PASSWORD_INCORRECT); - source.GetUser()->BadPassword(); + if (NickAlias::Find(GetAccount()) != NULL) + { + source.Reply(PASSWORD_INCORRECT); + source.GetUser()->BadPassword(); + } + else + source.Reply(NICK_X_NOT_REGISTERED, GetAccount().c_str()); } } }; diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index 419857eee..ed258c4e4 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -106,13 +106,18 @@ class NSRecoverRequest : public IdentifyRequest void OnFail() anope_override { - source.Reply(ACCESS_DENIED); - if (!GetPassword().empty()) + if (NickAlias::Find(GetAccount()) != NULL) { - Log(LOG_COMMAND, source, cmd) << "with an invalid password for " << GetAccount(); - if (source.GetUser()) - source.GetUser()->BadPassword(); + source.Reply(ACCESS_DENIED); + if (!GetPassword().empty()) + { + Log(LOG_COMMAND, source, cmd) << "with an invalid password for " << GetAccount(); + if (source.GetUser()) + source.GetUser()->BadPassword(); + } } + else + source.Reply(NICK_X_NOT_REGISTERED, GetAccount().c_str()); } }; |