mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Move the list of sessions to a more "public" place
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1806 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
#include "znc.h"
|
||||
#include <sstream>
|
||||
|
||||
map<CString, CSmartPtr<CWebSession> > CWebSock::m_mspSessions;
|
||||
|
||||
CZNCTagHandler::CZNCTagHandler(CWebSock& WebSock) : CTemplateTagHandler(), m_WebSock(WebSock) {
|
||||
}
|
||||
|
||||
@@ -604,16 +606,15 @@ CSmartPtr<CWebSession> CWebSock::GetSession() const {
|
||||
return m_spSession;
|
||||
}
|
||||
|
||||
static map<CString, CSmartPtr<CWebSession> > mspSessions;
|
||||
map<CString, CSmartPtr<CWebSession> >::const_iterator it = mspSessions.find(GetCookie("SessionId"));
|
||||
map<CString, CSmartPtr<CWebSession> >::const_iterator it = m_mspSessions.find(GetCookie("SessionId"));
|
||||
|
||||
if (it != mspSessions.end()) {
|
||||
if (it != m_mspSessions.end()) {
|
||||
DEBUG("Found existing session from cookie: [" + GetCookie("SessionId") + "] IsLoggedIn(" + CString(it->second->IsLoggedIn() ? "true" : "false") + ")");
|
||||
return it->second;
|
||||
}
|
||||
|
||||
CSmartPtr<CWebSession> spSession(new CWebSession());
|
||||
mspSessions.insert(make_pair(spSession->GetId(), spSession));
|
||||
m_mspSessions.insert(make_pair(spSession->GetId(), spSession));
|
||||
|
||||
return spSession;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user