added: put info about logging out a user (to 'last' table) (when a session expires)

git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@496 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2009-04-20 20:22:35 +00:00
parent a1ea298a43
commit e778903dab
1 changed files with 5 additions and 2 deletions

View File

@ -8,7 +8,7 @@
*/ */
#include "sessioncontainer.h" #include "sessioncontainer.h"
#include "data.h"
void SessionContainer::Clear() void SessionContainer::Clear()
{ {
@ -79,7 +79,10 @@ time_t limit = std::time(0) - interval;
{ {
long id = i->second->id; long id = i->second->id;
iold = i; iold = i;
++i; ++i; // incrementing before deleting old one
if( iold->second->puser )
data.last.UserLogout(iold->second->puser->id, iold->second->id);
// we're logging session.id (call this before table.erase()) // we're logging session.id (call this before table.erase())
DelFromIdIndex(iold->second); DelFromIdIndex(iold->second);