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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
#ifndef headerfilecmslucoresession
|
|
|
|
#define headerfilecmslucoresession
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
#include <ctime>
|
2009-04-21 22:50:55 +02:00
|
|
|
#include "item.h"
|
|
|
|
#include "error.h"
|
2008-12-21 22:17:09 +01:00
|
|
|
#include "user.h"
|
2010-05-04 23:58:22 +02:00
|
|
|
#include "plugindata.h"
|
2010-08-10 18:12:50 +02:00
|
|
|
#include "rebus.h"
|
2008-12-10 05:42:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
struct Session
|
|
|
|
{
|
|
|
|
// 0 - means that there is no session
|
2008-12-30 02:05:03 +01:00
|
|
|
long id;
|
2008-12-21 22:17:09 +01:00
|
|
|
|
2009-11-21 00:09:52 +01:00
|
|
|
// true if the session was created now
|
|
|
|
bool new_session;
|
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
// when this session was created
|
2009-01-31 07:53:36 +01:00
|
|
|
// (the same values)
|
|
|
|
time_t time;
|
|
|
|
tm tm_time;
|
|
|
|
|
|
|
|
// when this session was last used
|
|
|
|
// (the same values)
|
|
|
|
time_t last_time;
|
|
|
|
tm tm_last_time;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2009-12-09 01:42:40 +01:00
|
|
|
// when there was a last get request
|
|
|
|
// (used to calculate spam)
|
|
|
|
time_t last_time_get;
|
2009-01-31 07:53:36 +01:00
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
// 0 - means that nobody is logged
|
2008-12-21 22:17:09 +01:00
|
|
|
User * puser;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2009-11-21 00:09:52 +01:00
|
|
|
// if false the session will end when the user browser is shutdown
|
|
|
|
bool remember_me;
|
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2009-11-21 00:09:52 +01:00
|
|
|
// rebus - set by rebus_question(Info & i) from templates
|
2009-11-17 00:36:38 +01:00
|
|
|
Rebus::Item * rebus_item;
|
2009-12-09 01:42:40 +01:00
|
|
|
bool rebus_checked;
|
2009-11-17 00:36:38 +01:00
|
|
|
|
2010-02-06 15:08:44 +01:00
|
|
|
//std::string dir_old;
|
2009-02-06 14:12:03 +01:00
|
|
|
|
2009-12-09 01:42:40 +01:00
|
|
|
|
|
|
|
int spam_score;
|
|
|
|
|
2010-05-04 23:58:22 +02:00
|
|
|
|
|
|
|
PluginData plugin_data;
|
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
// -------------------
|
|
|
|
|
|
|
|
Session();
|
2009-11-21 00:09:52 +01:00
|
|
|
void Clear();
|
2008-12-10 05:42:49 +01:00
|
|
|
bool operator==(const Session & s) const;
|
|
|
|
bool operator<(const Session & s) const;
|
2009-12-09 01:42:40 +01:00
|
|
|
void DecTimer(int & timer);
|
2008-12-10 05:42:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|