Remove CWebSock::m_bLoggedIn

We can just check if m_pUser is NULL for the very same thing.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1859 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-03-30 12:20:31 +00:00
parent 4d149f3d5f
commit ba05f11ea4
2 changed files with 2 additions and 7 deletions
+1 -4
View File
@@ -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<CWebSession> 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("/");
+1 -3
View File
@@ -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;
};