From: <ps...@us...> - 2010-03-04 14:10:51
|
Revision: 1806 http://znc.svn.sourceforge.net/znc/?rev=1806&view=rev Author: psychon Date: 2010-03-04 14:10:45 +0000 (Thu, 04 Mar 2010) Log Message: ----------- Move the list of sessions to a more "public" place Modified Paths: -------------- trunk/WebModules.cpp trunk/WebModules.h Modified: trunk/WebModules.cpp =================================================================== --- trunk/WebModules.cpp 2010-03-04 14:04:34 UTC (rev 1805) +++ trunk/WebModules.cpp 2010-03-04 14:10:45 UTC (rev 1806) @@ -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 @@ 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; } Modified: trunk/WebModules.h =================================================================== --- trunk/WebModules.h 2010-03-04 14:04:34 UTC (rev 1805) +++ trunk/WebModules.h 2010-03-04 14:10:45 UTC (rev 1806) @@ -156,6 +156,8 @@ CString m_sPath; // Gets filled by ResolveModule() CString m_sPage; // Gets filled by ResolveModule() CSmartPtr<CWebSession> m_spSession; + + static map<CString, CSmartPtr<CWebSession> > m_mspSessions; }; #endif // !_WEBMODULES_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |