added ezc function: user_is_in_all_groups
changed: ezc function user_is_in_group (we can provide more than one group now) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@691 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -34,17 +34,43 @@ void user_name(Info & i)
|
||||
}
|
||||
|
||||
|
||||
// should be at least in one group
|
||||
// !! moze lepsza nazwa?
|
||||
void user_is_in_group(Info & i)
|
||||
{
|
||||
long gid = system->groups.GetGroupId(i.par);
|
||||
|
||||
if( !request->session->puser || gid == -1 )
|
||||
if( !request->session->puser || i.params.empty() )
|
||||
return;
|
||||
|
||||
i.res = request->session->puser->IsMemberOf(gid);
|
||||
for(size_t a=0 ; a<i.params.size() ; ++a)
|
||||
{
|
||||
long gid = system->groups.GetGroupId(i.params[a]);
|
||||
|
||||
if( gid!=-1 && request->session->puser->IsMemberOf(gid) )
|
||||
{
|
||||
i.res = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// !! moze lepsza nazwa?
|
||||
void user_is_in_all_groups(Info & i)
|
||||
{
|
||||
if( !request->session->puser || i.params.empty() )
|
||||
return;
|
||||
|
||||
for(size_t a=0 ; a<i.params.size() ; ++a)
|
||||
{
|
||||
long gid = system->groups.GetGroupId(i.params[a]);
|
||||
|
||||
if( gid==-1 || !request->session->puser->IsMemberOf(gid) )
|
||||
return;
|
||||
}
|
||||
|
||||
i.res = true;
|
||||
}
|
||||
|
||||
|
||||
void user_super_user(Info & i)
|
||||
{
|
||||
|
Reference in New Issue
Block a user