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"
|
2010-10-24 01:12:47 +02:00
|
|
|
#include "misc.h"
|
2008-12-10 05:42:49 +01:00
|
|
|
|
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()
|
|
|
|
{
|
2011-02-18 10:33:15 +01:00
|
|
|
SetTimeToNow();
|
2008-12-10 05:42:49 +01:00
|
|
|
Clear();
|
2011-02-18 10:33:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Session::SetTimeToNow()
|
|
|
|
{
|
2008-12-10 05:42:49 +01:00
|
|
|
time = std::time(0);
|
2010-10-24 01:12:47 +02:00
|
|
|
tm_time = Time(time);
|
2009-01-31 07:53:36 +01:00
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-02-18 10:33:15 +01:00
|
|
|
// this doesn't clear times
|
2008-12-10 05:42:49 +01:00
|
|
|
void Session::Clear()
|
|
|
|
{
|
2011-01-23 15:15:30 +01:00
|
|
|
id = 0;
|
|
|
|
time = 0;
|
|
|
|
puser = 0;
|
|
|
|
rebus_item = 0;
|
2009-12-09 01:42:40 +01:00
|
|
|
rebus_checked = false;
|
2011-01-23 15:15:30 +01:00
|
|
|
remember_me = false;
|
|
|
|
new_session = true;
|
|
|
|
spam_score = 0;
|
|
|
|
plugin_data.Resize(0);
|
2008-12-10 05:42:49 +01:00
|
|
|
}
|
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
|