added: mount params can have arguments (in parentheses) added: mount params: withheader, withinfo, restrictcreatethread, only_root_can_remove, can_use_emacs_on(level), can_use_mkdir_on(level), added: table Item has 'subject' column now removed: column 'subject' from table Content git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@505 e52654a7-88a9-db11-a3e9-0013d4bc506e
78 lines
1.2 KiB
C++
Executable File
78 lines
1.2 KiB
C++
Executable File
/*
|
|
* This file is a part of CMSLU -- Content Management System like Unix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2009, Tomasz Sowa
|
|
* All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#ifndef headerfilecmslucorelastcontainer
|
|
#define headerfilecmslucorelastcontainer
|
|
|
|
#include <string>
|
|
#include <list>
|
|
#include <cstring>
|
|
#include <ctime>
|
|
|
|
|
|
|
|
// how many items we store in the 'last' function
|
|
#define LAST_TABLE_SIZE 100
|
|
|
|
|
|
|
|
struct LastItem
|
|
{
|
|
long user_id;
|
|
|
|
// additional we store the whole string-name
|
|
// (you can delete a user from the database but we can still print the name)
|
|
std::string name;
|
|
|
|
// ip address
|
|
unsigned int ip;
|
|
|
|
// session id (used when logging out)
|
|
long session_id;
|
|
|
|
// start logging and end logging
|
|
tm start;
|
|
tm end;
|
|
|
|
|
|
LastItem();
|
|
bool IsLoggedOut();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class LastContainer
|
|
{
|
|
public:
|
|
|
|
typedef std::list<LastItem> LastTab;
|
|
typedef LastTab::iterator Iterator;
|
|
|
|
|
|
public:
|
|
|
|
Iterator Begin();
|
|
Iterator End();
|
|
void UserLogin(long user_id, const std::string & name, unsigned int ip, long session_id);
|
|
void UserLogout(long user_id, long session_id);
|
|
|
|
|
|
private:
|
|
|
|
LastTab last_tab;
|
|
Iterator FindNotLoggedOut(long user_id, long session_id);
|
|
|
|
};
|
|
|
|
|
|
#endif
|