diff --git a/WebModules.cpp b/WebModules.cpp index a893320a..d0432834 100644 --- a/WebModules.cpp +++ b/WebModules.cpp @@ -28,7 +28,6 @@ bool CZNCTagHandler::HandleTag(CTemplate& Tmpl, const CString& sName, const CStr } CWebSession::CWebSession(const CString& sId) : m_sId(sId) { - m_bLoggedIn = false; m_pUser = NULL; } @@ -83,7 +82,6 @@ void CWebAuth::AcceptedLogin(CUser& User) { CSmartPtr spSession = m_pWebSock->GetSession(); spSession->SetUser(&User); - spSession->SetLoggedIn(true); m_pWebSock->SetLoggedIn(true); m_pWebSock->UnPauseRead(); @@ -99,7 +97,6 @@ void CWebAuth::RefusedLogin(const CString& sReason) { spSession->AddError("Invalid login!"); spSession->SetUser(NULL); - spSession->SetLoggedIn(false); m_pWebSock->SetLoggedIn(false); m_pWebSock->UnPauseRead(); @@ -534,7 +531,7 @@ CWebSock::EPageReqResult CWebSock::OnPageRequestInternal(const CString& sURI, CS } else if (sURI == "/robots.txt") { return PrintStaticFile("/pub/robots.txt", sPageRet); } else if (sURI == "/logout") { - GetSession()->SetLoggedIn(false); + GetSession()->SetUser(NULL); SetLoggedIn(false); Redirect("/"); diff --git a/WebModules.h b/WebModules.h index 49d81d59..59f44939 100644 --- a/WebModules.h +++ b/WebModules.h @@ -39,10 +39,9 @@ public: const CString& GetId() const { return m_sId; } CUser* GetUser() const { return m_pUser; } - bool IsLoggedIn() const { return m_pUser && m_bLoggedIn; } + bool IsLoggedIn() const { return m_pUser != NULL; } bool IsAdmin() const; - bool SetLoggedIn(bool b) { m_bLoggedIn = b; return m_bLoggedIn; } CUser* SetUser(CUser* p) { m_pUser = p; return m_pUser; } void ClearMessageLoops(); @@ -52,7 +51,6 @@ public: private: CString m_sId; CUser* m_pUser; - bool m_bLoggedIn; VCString m_vsErrorMsgs; VCString m_vsSuccessMsgs; };