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:
psychon
2009-02-21 16:48:28 +00:00
parent 7a985ac077
commit cbc27f5bb9
3 changed files with 18 additions and 10 deletions

View File

@@ -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);
}