Files
winix/core/users.h
Tomasz Sowa c48241f78a fixed: there were mktime() used on some dirs Items
so sometimes the time of the dir was changed

now for converting tm into time_t use:
time_t Time(const tm & par);
time_t Time(const tm * par);
tm     Time(time_t par);
from core/misc.h

now winix internally use GMT time
only when printing it is converted to local user time
temporarily all users use the same local time (config: time_zone_offset)
(only logs are genereted with local system time)

added to system:
time_t LocalTime(time_t gmt_time);
tm     LocalTime(const tm * ptm);
tm     LocalTime(const tm & ptm);
they convert GMT time to local user time




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@666 e52654a7-88a9-db11-a3e9-0013d4bc506e
2010-10-23 23:12:47 +00:00

68 lines
1.1 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfilecmslucoreusers
#define headerfilecmslucoreusers
#include <map>
#include "user.h"
#include "ugcontainer.h"
#include "lastcontainer.h"
#include "request.h"
#include "db/db.h"
class Users
{
typedef UGContainer<User> Table;
Table table;
Request * request;
long how_many_logged;
public:
typedef Table::Iterator Iterator;
typedef Table::SizeType SizeType;
LastContainer last;
Users();
void SetRequest(Request * request);
void Clear();
void ReadUsers(Db * db);
void SetTimeZoneOffset(int offset); // !! temporarily one time_zone for all users
bool AddUser(const User & user);
bool IsUser(const std::string & name);
User * GetUser(long user_id);
User * GetUser(const std::string & name);
long GetUserId(const std::string & name);
Iterator Begin();
Iterator End();
SizeType Size();
User & operator[](SizeType pos);
void LoginUser(long user_id, bool remember_me);
void LogoutCurrentUser();
void IncrementLoggedUsers();
long HowManyLogged();
};
#endif