From c9f26ba05fa696fda727a01d932c55bfc9b460b6 Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 4 Mar 2010 14:10:45 +0000 Subject: [PATCH] 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 --- WebModules.cpp | 9 +++++---- WebModules.h | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/WebModules.cpp b/WebModules.cpp index afc39a63..2a178ad5 100644 --- a/WebModules.cpp +++ b/WebModules.cpp @@ -11,6 +11,8 @@ #include "znc.h" #include +map > CWebSock::m_mspSessions; + CZNCTagHandler::CZNCTagHandler(CWebSock& WebSock) : CTemplateTagHandler(), m_WebSock(WebSock) { } @@ -604,16 +606,15 @@ CSmartPtr CWebSock::GetSession() const { return m_spSession; } - static map > mspSessions; - map >::const_iterator it = mspSessions.find(GetCookie("SessionId")); + map >::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 spSession(new CWebSession()); - mspSessions.insert(make_pair(spSession->GetId(), spSession)); + m_mspSessions.insert(make_pair(spSession->GetId(), spSession)); return spSession; } diff --git a/WebModules.h b/WebModules.h index 726ea495..e8252e95 100644 --- a/WebModules.h +++ b/WebModules.h @@ -156,6 +156,8 @@ private: CString m_sPath; // Gets filled by ResolveModule() CString m_sPage; // Gets filled by ResolveModule() CSmartPtr m_spSession; + + static map > m_mspSessions; }; #endif // !_WEBMODULES_H