Code

Updated functions.inc
[gosa.git] / gosa-core / include / class_userinfo.inc
index 83db453bf1077cb01d7e8ff0379d8077ad3980f4..4045821ba85e0d5311ce31f6360678db2e522c6c 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,10 @@ class userinfo
       foreach($infos as $info){
         $found = FALSE;
         foreach($info['acl'] as $cat => $data){
+
+          /* Skip self acls? */
+          if($skip_self_acls && isset($data['0']) && preg_match("//s",$data['0'])) continue;
+
           if(is_array($module)){
             foreach($module as $mod){
               if(preg_match("/^".normalizePreg($mod)."/",$cat)){