Skip to content
Snippets Groups Projects
Commit 85d03f68 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

fix usage of is_admin in auth_aclcheck

There were a few problems with name encoding for groups and users
introduced in the recent aclcheck change

darcs-hash:20080226172257-7ad00-d591f0d2f2219a2b23f93060c65b8fb5f46bd1d7.gz
parent 09742313
No related branches found
No related tags found
No related merge requests found
......@@ -344,24 +344,22 @@ function auth_aclcheck($id,$user,$groups){
global $conf;
global $AUTH_ACL;
# if no ACL is used always return upload rights
// if no ACL is used always return upload rights
if(!$conf['useacl']) return AUTH_UPLOAD;
$user = auth_nameencode($user);
//make sure groups is an array
if(!is_array($groups)) $groups = array();
//if user is superuser return 255 (acl_admin)
//if user is superuser or in superusergroup return 255 (acl_admin)
if(auth_isadmin($user,$groups)) { return AUTH_ADMIN; }
//make sure groups is an array
if(!is_array($groups)) $groups = array();
$user = auth_nameencode($user);
//prepend groups with @ and nameencode
$cnt = count($groups);
for($i=0; $i<$cnt; $i++){
$groups[$i] = '@'.auth_nameencode($groups[$i]);
}
//if user is in superuser group return 255 (acl_admin)
if(auth_isadmin($user,$groups)) { return AUTH_ADMIN; }
$ns = getNS($id);
$perm = -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment