diff --git a/WebModules.cpp b/WebModules.cpp index bc67da7f..b63abd56 100644 --- a/WebModules.cpp +++ b/WebModules.cpp @@ -527,7 +527,7 @@ bool CWebSock::OnPageRequestInternal(const CString& sURI, CString& sPageRet) { if (GetParam("submitted").ToBool()) { m_sUser = GetParam("user"); m_sPass = GetParam("pass"); - OnLogin(m_sUser, m_sPass); + m_bLoggedIn = OnLogin(m_sUser, m_sPass); Redirect("/"); return true; @@ -661,7 +661,7 @@ CSmartPtr CWebSock::GetSession() { return spSession; } -void CWebSock::OnLogin(const CString& sUser, const CString& sPass) { +bool CWebSock::OnLogin(const CString& sUser, const CString& sPass) { DEBUG("=================== CWebSock::OnLogin()"); m_spAuth = new CWebAuth(this, sUser, sPass); @@ -669,6 +669,9 @@ void CWebSock::OnLogin(const CString& sUser, const CString& sPass) { // until then. CWebAuth will UnPauseRead(). PauseRead(); CZNC::Get().AuthUser(m_spAuth); + + // If CWebAuth already set this, don't change it. + return IsLoggedIn(); } Csock* CWebSock::GetSockObj(const CString& sHost, unsigned short uPort) { diff --git a/WebModules.h b/WebModules.h index b4ffc8ba..2f4465db 100644 --- a/WebModules.h +++ b/WebModules.h @@ -117,7 +117,7 @@ public: virtual ~CWebSock(); virtual bool ForceLogin(); - virtual void OnLogin(const CString& sUser, const CString& sPass); + virtual bool OnLogin(const CString& sUser, const CString& sPass); virtual void OnPageRequest(const CString& sURI); void ParsePath(); // This parses the path portion of the url into some member vars