X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_pluglist.inc;h=50e0c0f191a29158c58fd8df71453925b8992bf7;hb=1374a0a230c81a1974326e319b7576f4f1855afe;hp=384817bd303c7cf032f354c00a9b75f8fb9920c9;hpb=2f503946138b7e287d1a7cef73057adf0bd204a8;p=gosa.git diff --git a/include/class_pluglist.inc b/include/class_pluglist.inc index 384817bd3..50e0c0f19 100644 --- a/include/class_pluglist.inc +++ b/include/class_pluglist.inc @@ -31,10 +31,10 @@ class pluglist { var $info= array(); var $headlines = array(); - function pluglist($config, $ui) + function pluglist(&$config, &$ui) { - $this->ui= $ui; - $this->config= $config; + $this->ui= &$ui; + $this->config= &$config; /* Create dirlist for all plugins */ $this->dirlist= $this->get_plugins ($this->dirlist, $this->config->data); @@ -56,7 +56,7 @@ class pluglist { $this->info['all']['plSelfModify']= FALSE; } - function get_plugins($list, $config) + function get_plugins($list, &$config) { /* Error reporting, because I'm getting strange messages in PHP 4.2.x */ if (!isset($config['PATH']) && !isset($config['CLASS'])){ @@ -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,20 +166,31 @@ class pluglist { $href= "main.php?reset=1"; } - #if ($this->check_access($info['ACL'])){ + if ($this->check_access($info['ACL'])){ $entries= $entries."
\n"; + } else { + $entries.= "". _($plHeadline)."\n"; + } /* Generate icon entry with description */ - $this->menuparts[_($headline)][]= ''._($plHeadline).' '._($plDescription).' |
';
+ if($_SESSION['js']){
+ $current.= ''._($plHeadline).' '._($plDescription); + } else { + $current.= ''._($plHeadline).' '._($plDescription).''; + } + $current.= ' |