68 lines
909 B
C++
Executable File
68 lines
909 B
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 headerfilecmslucoreuser
|
|
#define headerfilecmslucoreuser
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
|
|
struct User
|
|
{
|
|
long id;
|
|
std::wstring name;
|
|
bool super_user;
|
|
std::vector<long> groups;
|
|
std::wstring email;
|
|
|
|
int cms_notify;
|
|
int thread_notify;
|
|
|
|
// !! currently all users have the same offset
|
|
// option in config: time_zone_offset
|
|
int time_zone_offset;
|
|
|
|
|
|
|
|
User()
|
|
{
|
|
Clear();
|
|
}
|
|
|
|
|
|
void Clear()
|
|
{
|
|
id = -1;
|
|
name.clear();
|
|
super_user = false;
|
|
groups.clear();
|
|
email.clear();
|
|
cms_notify = 0;
|
|
thread_notify = 0;
|
|
time_zone_offset = 0;
|
|
}
|
|
|
|
|
|
bool IsMemberOf(long group)
|
|
{
|
|
std::vector<long>::iterator i;
|
|
|
|
for(i=groups.begin() ; i!=groups.end() ; ++i)
|
|
if( *i == group )
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
};
|
|
|
|
|
|
#endif
|