2008-12-10 05:42:49 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2008-12-10 05:42:49 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2010-02-28 22:33:06 +01:00
|
|
|
* Copyright (c) 2008-2010, Tomasz Sowa
|
2008-12-10 05:42:49 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "session.h"
|
|
|
|
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
|
2010-05-04 23:58:22 +02:00
|
|
|
|
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
Session::Session()
|
|
|
|
{
|
|
|
|
Clear();
|
|
|
|
|
|
|
|
time = std::time(0);
|
2009-01-31 07:53:36 +01:00
|
|
|
tm_time = *std::localtime(&time);
|
|
|
|
|
|
|
|
last_time = time;
|
|
|
|
tm_last_time = tm_time;
|
2009-12-09 01:42:40 +01:00
|
|
|
|
|
|
|
// the first request can be a POST (it doesn't matter)
|
|
|
|
last_time_get = time;
|
2008-12-10 05:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Session::Clear()
|
|
|
|
{
|
|
|
|
id = 0;
|
|
|
|
time = 0;
|
2008-12-21 22:17:09 +01:00
|
|
|
puser = 0;
|
2009-12-09 01:42:40 +01:00
|
|
|
rebus_item = 0;
|
|
|
|
rebus_checked = false;
|
2009-11-21 00:09:52 +01:00
|
|
|
remember_me = false;
|
|
|
|
new_session = true;
|
2009-12-09 01:42:40 +01:00
|
|
|
spam_score = 0;
|
2009-11-17 00:36:38 +01:00
|
|
|
|
2010-02-06 15:08:44 +01:00
|
|
|
// dir_old.clear();
|
2008-12-10 05:42:49 +01:00
|
|
|
}
|
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
bool Session::operator==(const Session & s) const
|
|
|
|
{
|
|
|
|
return id == s.id;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Session::operator<(const Session & s) const
|
|
|
|
{
|
|
|
|
return id < s.id;
|
|
|
|
}
|
|
|
|
|