From 3daec3e3469686f68457b992847a339c7add9bb1 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 21 Apr 2010 12:26:58 +0000 Subject: [PATCH] Added dummy reference tab git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17775 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_tabs.inc | 1 + gosa-core/include/class_userinfo.inc | 31 +++++++++++-------- .../generic/references/class_reference.inc | 7 +++++ 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/gosa-core/include/class_tabs.inc b/gosa-core/include/class_tabs.inc index a529f87a3..ccc3f7c71 100644 --- a/gosa-core/include/class_tabs.inc +++ b/gosa-core/include/class_tabs.inc @@ -387,6 +387,7 @@ class tabs $this->by_name['reference']= _("References"); $this->by_object['reference']= new reference($this->config, $this->dn); $this->by_object['reference']->parent= &$this; + $this->by_object['reference']->set_acl_category($this->acl_category); } } diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index 1eb5690b4..336923ac5 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -189,6 +189,7 @@ class userinfo } $this->ACL[$dn][$idx]= $type; } + $this->allACLs[$dn][$idx]= $type; } } @@ -225,10 +226,12 @@ class userinfo /* Remove all acl entries which are especially for the current user (self acl) */ - foreach($acl_set['acl'] as $object => $object_acls){ - if(isset($object_acls[0]) && strpos($object_acls[0],"s")){ - unset($without_self_acl[$sdn][$dn][$acl_id]['acl'][$object]); - } + if(isset($acl_set['acl'])){ + foreach($acl_set['acl'] as $object => $object_acls){ + if(isset($object_acls[0]) && strpos($object_acls[0],"s")){ + unset($without_self_acl[$sdn][$dn][$acl_id]['acl'][$object]); + } + } } } } @@ -592,15 +595,17 @@ class userinfo foreach($this->ACL as $dn => $infos){ foreach($infos as $info){ $found = FALSE; - foreach($info['acl'] as $cat => $data){ - - /* Skip self acls? */ - if($skip_self_acls && isset($data['0']) && (strpos($data['0'], "s") !== FALSE)) continue; - if(preg_match("/^".preg_quote($mod, '/')."/",$cat)){ - $found =TRUE; - break; - } - } + if(isset($info['acl'])){ + foreach($info['acl'] as $cat => $data){ + + /* Skip self acls? */ + if($skip_self_acls && isset($data['0']) && (strpos($data['0'], "s") !== FALSE)) continue; + if(preg_match("/^".preg_quote($mod, '/')."/",$cat)){ + $found =TRUE; + break; + } + } + } if($found && !isset($this->config->idepartments[$dn])){ while(!isset($this->config->idepartments[$dn]) && strpos($dn, ",")){ diff --git a/gosa-core/plugins/generic/references/class_reference.inc b/gosa-core/plugins/generic/references/class_reference.inc index 6c92e9f5b..1c36e1b10 100644 --- a/gosa-core/plugins/generic/references/class_reference.inc +++ b/gosa-core/plugins/generic/references/class_reference.inc @@ -79,6 +79,13 @@ class reference extends plugin /* Call parent execute */ plugin::execute(); + // ACL's we have + $ui = get_userinfo(); + + + $r = new aclResolver($this->config, $this->dn, $this); + return($r->getReadableACL()); + /* Set government mode */ $smarty= get_smarty(); -- 2.30.2