added: winix function: rmuser
changed: UGContainer<> now uses std::list as a storage (previously it was using std::vector with pointers) removed: now we don't have the operator[] for UGContainer<> git-svn-id: svn://ttmath.org/publicrep/winix/trunk@816 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -25,12 +25,16 @@ void user_logged(Info & i)
|
||||
}
|
||||
|
||||
|
||||
void user_id(Info & i)
|
||||
{
|
||||
if( cur->session->puser )
|
||||
i.out << cur->session->puser->id;
|
||||
}
|
||||
|
||||
void user_name(Info & i)
|
||||
{
|
||||
if( !cur->session->puser )
|
||||
return;
|
||||
|
||||
i.out << cur->session->puser->name;
|
||||
if( cur->session->puser )
|
||||
i.out << cur->session->puser->name;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,12 +112,35 @@ void user_can_use_raw(Info & i)
|
||||
|
||||
|
||||
|
||||
static size_t user_index = 0;
|
||||
static Users::Iterator user_iter;
|
||||
static size_t user_reqid = 0;
|
||||
static size_t user_index; // only information
|
||||
|
||||
|
||||
bool user_tab_init()
|
||||
{
|
||||
if( user_reqid != cur->request->id )
|
||||
{
|
||||
user_reqid = cur->request->id;
|
||||
user_iter = system->users.Begin();
|
||||
}
|
||||
|
||||
return user_iter != system->users.End();
|
||||
}
|
||||
|
||||
|
||||
void user_tab(Info & i)
|
||||
{
|
||||
user_tab_init();
|
||||
user_index = i.iter;
|
||||
i.res = user_index < system->users.Size();
|
||||
|
||||
if( i.iter == 0 )
|
||||
user_iter = system->users.Begin();
|
||||
else
|
||||
if( user_iter != system->users.End() )
|
||||
++user_iter;
|
||||
|
||||
i.res = user_iter != system->users.End();
|
||||
}
|
||||
|
||||
|
||||
@@ -124,49 +151,47 @@ void user_tab_index(Info & i)
|
||||
|
||||
void user_tab_id(Info & i)
|
||||
{
|
||||
if( user_index < system->users.Size() )
|
||||
i.out << system->users[user_index].id;
|
||||
if( user_tab_init() )
|
||||
i.out << user_iter->id;
|
||||
}
|
||||
|
||||
|
||||
void user_tab_name(Info & i)
|
||||
{
|
||||
if( user_index < system->users.Size() )
|
||||
i.out << system->users[user_index].name;
|
||||
if( user_tab_init() )
|
||||
i.out << user_iter->name;
|
||||
}
|
||||
|
||||
|
||||
void user_tab_is_super_user(Info & i)
|
||||
{
|
||||
if( user_index < system->users.Size() )
|
||||
i.res = system->users[user_index].super_user;
|
||||
if( user_tab_init() )
|
||||
i.res = user_iter->super_user;
|
||||
}
|
||||
|
||||
|
||||
void user_tab_is_active(Info & i)
|
||||
{
|
||||
if( user_index < system->users.Size() )
|
||||
i.res = system->users[user_index].status == WINIX_ACCOUNT_READY;
|
||||
if( user_tab_init() )
|
||||
i.res = user_iter->status == WINIX_ACCOUNT_READY;
|
||||
}
|
||||
|
||||
void user_tab_is_suspended(Info & i)
|
||||
{
|
||||
if( user_index < system->users.Size() )
|
||||
i.res = system->users[user_index].status == WINIX_ACCOUNT_SUSPENDED;
|
||||
if( user_tab_init() )
|
||||
i.res = user_iter->status == WINIX_ACCOUNT_SUSPENDED;
|
||||
}
|
||||
|
||||
void user_tab_is_blocked(Info & i)
|
||||
{
|
||||
if( user_index < system->users.Size() )
|
||||
i.res = system->users[user_index].status == WINIX_ACCOUNT_BLOCKED;
|
||||
if( user_tab_init() )
|
||||
i.res = user_iter->status == WINIX_ACCOUNT_BLOCKED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void user_tab_is_current(Info & i)
|
||||
{
|
||||
if( user_index < system->users.Size() && cur->session->puser )
|
||||
i.res = (system->users[user_index].id == cur->session->puser->id);
|
||||
if( user_tab_init() && cur->session->puser )
|
||||
i.res = (user_iter->id == cur->session->puser->id);
|
||||
}
|
||||
|
||||
} // namespace TemplatesFunctions
|
||||
|
Reference in New Issue
Block a user