2008-12-21 22:17:09 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of CMSLU -- Content Management System like Unix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2009-04-21 22:50:55 +02:00
|
|
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
2008-12-21 22:17:09 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
#ifndef headerfilecmslucoreuser
|
|
|
|
#define headerfilecmslucoreuser
|
2008-12-21 22:17:09 +01:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
|
2008-12-21 22:17:09 +01:00
|
|
|
struct User
|
|
|
|
{
|
|
|
|
long id;
|
|
|
|
std::string name;
|
|
|
|
bool super_user;
|
|
|
|
std::vector<long> groups;
|
2009-10-01 00:31:20 +02:00
|
|
|
std::string email;
|
|
|
|
|
|
|
|
int cms_notify;
|
|
|
|
int thread_notify;
|
|
|
|
|
|
|
|
|
2008-12-21 22:17:09 +01:00
|
|
|
|
|
|
|
User()
|
|
|
|
{
|
|
|
|
Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Clear()
|
|
|
|
{
|
|
|
|
id = -1;
|
|
|
|
name.clear();
|
|
|
|
super_user = false;
|
|
|
|
groups.clear();
|
2009-10-01 00:31:20 +02:00
|
|
|
email.clear();
|
|
|
|
cms_notify = 0;
|
|
|
|
thread_notify = 0;
|
2008-12-21 22:17:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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
|