Code

Added option to skip self acls in get_module_departments().
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 Jun 2008 12:22:13 +0000 (12:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 25 Jun 2008 12:22:13 +0000 (12:22 +0000)
-

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11439 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_pluglist.inc
gosa-core/include/class_userinfo.inc

index 54b5c67644a0df08132bb5b74ba0615f1a5f1ef0..ecc77a18c519e517eadcab801409b3fa4e24bd3f 100644 (file)
@@ -113,7 +113,7 @@ class pluglist {
                
                                /* No self acls. Check if we have any acls for the given ACL type 
                  */
-                               $deps = $this->ui->get_module_departments($acl_to_check);
+                               $deps = $this->ui->get_module_departments($acl_to_check,TRUE);
                                if(count($deps)) return TRUE;
                        }
                }
index 83db453bf1077cb01d7e8ff0379d8077ad3980f4..65cdfdfd9ff0c606b93412305d910ce55f3b4350 100644 (file)
@@ -426,7 +426,7 @@ class userinfo
 
   /* Extract all departments that are accessible (direct or 'on the way' to an
      accessible department) */
-  function get_module_departments($module)
+  function get_module_departments($module, $skip_self_acls = FALSE )
   {
     
     /* If we are forced to skip ACLs checks for the current user 
@@ -474,6 +474,11 @@ class userinfo
       foreach($infos as $info){
         $found = FALSE;
         foreach($info['acl'] as $cat => $data){
+
+          /* Skip self acls?
+           */
+          if($skip_self_acls && preg_match("//s",$data['0'])) continue;
+
           if(is_array($module)){
             foreach($module as $mod){
               if(preg_match("/^".normalizePreg($mod)."/",$cat)){