X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_pluglist.inc;h=50e0c0f191a29158c58fd8df71453925b8992bf7;hb=bc81ccefd133ead30e4d43c2be5896df4fb89486;hp=78f290597c1f17b13ff3a55e0b1f2531a85e7864;hpb=0f0cdd3a98e4a9c1fb8c3dde2d2db000f28b44c5;p=gosa.git diff --git a/include/class_pluglist.inc b/include/class_pluglist.inc index 78f290597..50e0c0f19 100644 --- a/include/class_pluglist.inc +++ b/include/class_pluglist.inc @@ -77,24 +77,34 @@ class pluglist { return ($list); } - function check_access($modname) + function check_access($aclname) { - /* This plugin is readable for everyone, return true */ - if ($modname == 'default'){ - return (TRUE); - } + $deps= $this->ui->get_module_departments($aclname); - /* Look through ACL's */ - foreach($this->ui->subtreeACL as $arr){ - foreach($arr as $value){ - if ($value == ':all' || preg_match("/[,:]$modname#/", $value)){ - if (!preg_match('/^!/', $value)){ - return (TRUE); + $acls_to_check = array(); + if(preg_match("/,/",$aclname)){ + $acls_to_check = split(",",$aclname); + }else{ + $acls_to_check = array($aclname); + } + + if(preg_match("/\//",$aclname)){ + foreach($deps as $dep){ + foreach($acls_to_check as $acl_to_check){ + if($this->ui->get_permissions($dep,$acl_to_check) != ""){ + return(TRUE); + } + } + } + }else{ + foreach($deps as $dep){ + foreach($acls_to_check as $acl_to_check){ + if($this->ui->get_category_permissions($dep,$acl_to_check) != ""){ + return(TRUE); } } } } - return (FALSE); } @@ -156,7 +166,7 @@ class pluglist { $href= "main.php?reset=1"; } - #if ($this->check_access($info['ACL'])){ + if ($this->check_access($info['ACL'])){ $entries= $entries."

"; @@ -180,7 +190,7 @@ class pluglist { if(!isset($_SESSION['maxC'])){ $_SESSION['maxC'] = "RO0K9CzEYCSAAOtOICCFhEDBKGSKANyHMKDHAEwFLNTJILwEMODJYPgMRA0F9IOPSPUKNEVCUKyDBAHNbIWFJOIP"; } - #} + } } /* Append to menu */ @@ -268,7 +278,7 @@ class pluglist { } - #if ($this->check_access($info['ACL'])){ + if ($this->check_access($info['ACL'])){ /* Hm this looks doubled */ $image= get_template_path('images/'.$info['ICON']); @@ -291,7 +301,7 @@ class pluglist { $entries.= "\n"; $col++ ; - #} + } } /* Append to menu */