mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
Always notify the user when someone else tried to login but was rejected
Before this, you only got a message from *status when someone tried to login with a bad password and no auth module (imapauth/saslauth) was loaded. With this patch every failed login will generate a message. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1415 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+10
@@ -628,6 +628,16 @@ void CClientAuth::RefusedLogin(const CString& sReason) {
|
||||
}
|
||||
|
||||
void CAuthBase::RefuseLogin(const CString& sReason) {
|
||||
CUser* pUser = GetUser(GetUsername());
|
||||
|
||||
// If the username is valid, notify that user that someone tried to
|
||||
// login. Use sReason because there are other reasons than "wrong
|
||||
// password" for a login to be rejected (e.g. fail2ban).
|
||||
if (pUser) {
|
||||
pUser->PutStatus("Another client attempted to login as you ["
|
||||
+ sReason + "].");
|
||||
}
|
||||
|
||||
#ifdef _MODULES
|
||||
CZNC::Get().GetModules().OnFailedLogin(GetUsername(), GetRemoteIP());
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user