mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Call OnFailedLogin() for all failed logins, not only those on the irc port
This breaks CAuthBase's API for modules that want to auth users. Instead of overloading AcceptLogin() and RefuseLogin(), they now have to overload AcceptedLogin() and RefusedLogin(). Modules that auth users (e.g. imapauth) still call AcceptLogin() and RefuseLogin() which is where OnFailedLogin() gets called. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1389 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -619,13 +619,17 @@ CClientAuth::CClientAuth(CClient* pClient, const CString& sUsername, const CStri
|
||||
m_pClient = pClient;
|
||||
}
|
||||
|
||||
void CClientAuth::RefuseLogin(const CString& sReason) {
|
||||
void CClientAuth::RefusedLogin(const CString& sReason) {
|
||||
if (m_pClient) {
|
||||
m_pClient->RefuseLogin(sReason);
|
||||
}
|
||||
}
|
||||
|
||||
void CAuthBase::RefuseLogin(const CString& sReason) {
|
||||
#ifdef _MODULES
|
||||
CZNC::Get().GetModules().OnFailedLogin(GetUsername(), GetRemoteIP());
|
||||
#endif
|
||||
RefusedLogin(sReason);
|
||||
}
|
||||
|
||||
void CClient::RefuseLogin(const CString& sReason) {
|
||||
@@ -639,7 +643,7 @@ void CClient::RefuseLogin(const CString& sReason) {
|
||||
Close();
|
||||
}
|
||||
|
||||
void CClientAuth::AcceptLogin(CUser& User) {
|
||||
void CClientAuth::AcceptedLogin(CUser& User) {
|
||||
if (m_pClient) {
|
||||
m_pClient->AcceptLogin(User);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user