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:
psychon
2009-03-07 12:44:11 +00:00
parent 0015098ab3
commit d66698e993

View File

@@ -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