summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/auth.php32
1 files changed, 15 insertions, 17 deletions
diff --git a/inc/auth.php b/inc/auth.php
index 26f4000fd..cedfdee36 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -131,26 +131,24 @@ function auth_loadACL() {
//support user wildcard
$out = array();
- if(isset($_SERVER['REMOTE_USER'])){
- $len = count($acl);
- for($i = 0; $i < $len; $i++) {
- if($acl[$i]{0} == '#') continue;
- if(!trim($acl[$i])) continue;
- list($id,$rest) = preg_split('/\s+/',$acl[$i],2);
-
- if(strstr($acl[$i], '%GROUP%')){
- foreach($USERINFO['grps'] as $grp){
- $nid = str_replace('%GROUP%',cleanID($grp),$id);
- $nrest = str_replace('%GROUP%','@'.auth_nameencode($grp),$rest);
- $out[] = "$nid\t$nrest";
- }
- } else {
- $id = str_replace('%USER%',cleanID($_SERVER['REMOTE_USER']),$id);
- $rest = str_replace('%USER%',auth_nameencode($_SERVER['REMOTE_USER']),$rest);
- $out[] = "$id\t$rest";
+ foreach($acl as $line) {
+ $line = trim($line);
+ if($line{0} == '#') continue;
+ list($id,$rest) = preg_split('/\s+/',$line,2);
+
+ if(strstr($line, '%GROUP%')){
+ foreach((array) $USERINFO['grps'] as $grp){
+ $nid = str_replace('%GROUP%',cleanID($grp),$id);
+ $nrest = str_replace('%GROUP%','@'.auth_nameencode($grp),$rest);
+ $out[] = "$nid\t$nrest";
}
+ } else {
+ $id = str_replace('%USER%',cleanID($_SERVER['REMOTE_USER']),$id);
+ $rest = str_replace('%USER%',auth_nameencode($_SERVER['REMOTE_USER']),$rest);
+ $out[] = "$id\t$rest";
}
}
+
return $out;
}