mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix my previous commit and also display the remote IP for the failed login
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1416 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -628,14 +628,14 @@ void CClientAuth::RefusedLogin(const CString& sReason) {
|
||||
}
|
||||
|
||||
void CAuthBase::RefuseLogin(const CString& sReason) {
|
||||
CUser* pUser = GetUser(GetUsername());
|
||||
CUser* pUser = CZNC::Get().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 + "].");
|
||||
pUser->PutStatus("A client from [" + GetRemoteIP() + "] attempted "
|
||||
"to login as you, but was rejected [" + sReason + "].");
|
||||
}
|
||||
|
||||
#ifdef _MODULES
|
||||
|
||||
Reference in New Issue
Block a user