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:
@@ -59,47 +59,65 @@ void env_user_name(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 env_user_tab_init()
|
||||
{
|
||||
if( user_reqid != cur->request->id )
|
||||
{
|
||||
user_reqid = cur->request->id;
|
||||
user_iter = system->users.End();
|
||||
}
|
||||
|
||||
return user_iter != system->users.End();
|
||||
}
|
||||
|
||||
|
||||
void env_user_tab(Info & i)
|
||||
{
|
||||
env_user_tab_init();
|
||||
|
||||
if( cur->session->puser && cur->session->puser->super_user )
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool evn_user_tab_has_access()
|
||||
{
|
||||
return cur->session->puser &&
|
||||
cur->session->puser->super_user &&
|
||||
user_index < system->users.Size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void env_user_tab_id(Info & i)
|
||||
{
|
||||
if( evn_user_tab_has_access() )
|
||||
i.out << system->users[user_index].id;
|
||||
if( env_user_tab_init() )
|
||||
i.out << user_iter->id;
|
||||
}
|
||||
|
||||
|
||||
void env_user_tab_name(Info & i)
|
||||
{
|
||||
if( evn_user_tab_has_access() )
|
||||
i.out << system->users[user_index].name;
|
||||
if( env_user_tab_init() )
|
||||
i.out << user_iter->name;
|
||||
}
|
||||
|
||||
|
||||
void env_user_tab_is_current(Info & i)
|
||||
{
|
||||
if( evn_user_tab_has_access() && functions->fun_env.GetUser() )
|
||||
i.res = (system->users[user_index].id == functions->fun_env.GetUser()->id );
|
||||
if( env_user_tab_init() )
|
||||
{
|
||||
User * puser = functions->fun_env.GetUser();
|
||||
|
||||
if( puser )
|
||||
i.res = (user_iter->id == puser->id );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user