From 9a9b13b0f7372a7b1b4b19225bc65693b63da058 Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 3 Aug 2006 11:50:31 +0000 Subject: [PATCH] Updated get_category_permissions git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4380 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/main.php | 5 +++++ include/class_userinfo.inc | 21 +++++++++++++++++++- plugins/admin/users/class_userManagement.inc | 4 ++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/html/main.php b/html/main.php index 365763c9c..93c71f5ac 100644 --- a/html/main.php +++ b/html/main.php @@ -157,6 +157,11 @@ textdomain($domain); /* Prepare plugin list */ if (!isset($_SESSION['plist'])){ $_SESSION['plist']= new pluglist($config, $ui); + + /* Load ocMapping into userinfo */ + $tmp= new acl($config, NULL, $ui->dn); + $ui->ocMapping= $tmp->ocMapping; + $_SESSION['ui']= $ui; } $plist= $_SESSION['plist']; diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index 066b57e03..9c8deabb1 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -31,6 +31,7 @@ class userinfo var $gosaUnitTag= ""; var $subtreeACL= array(); var $ACL= array(); + var $ocMapping= array(); var $groups= array(); /* get acl's an put them into the userinfo object @@ -93,6 +94,7 @@ class userinfo #echo "NEW ACL LOADING --------------------------------------------------------------------------------------------
"; $this->ACL= array(); + $this->ocMapping= array(); $this->groups= array(); $ldap= $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); @@ -155,12 +157,21 @@ class userinfo } } + } function get_category_permissions($dn, $category) { - return ("cdmrw"); + /* Get list of objectClasses and get the permissions for it */ + $acl= ""; + if (isset($this->ocMapping[$category])){ + foreach($this->ocMapping[$category] as $oc){ + $acl.= $this->get_permissions($dn, $oc, ""); + } + } + + return ($acl); } @@ -213,6 +224,14 @@ class userinfo continue; } + /* If attribute is "", we want to know, if we've *any* permissions here... */ + if ($attribute == "" && isset($subacl['acl'][$object])){ + foreach($subacl['acl'][$object] as $attr => $dummy){ + $acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$object][$attr]); + } + continue; + } + } } } diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index 0c2e864a5..8e7f6415f 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -717,11 +717,11 @@ class userManagement extends plugin $ldap= $this->config->get_ldap_link(TRUE); if ($SubSearch){ - $ListTemp = get_list($filter, "user", $base, + $ListTemp = get_list($filter, "users", $base, array("uid", "givenName", "sn", "objectClass"), GL_SUBSEARCH | GL_SIZELIMIT); } else { $base= get_people_ou().$base; - $ListTemp = get_list($filter, "user", $base, + $ListTemp = get_list($filter, "users", $base, array("uid", "givenName", "sn", "objectClass"), GL_SIZELIMIT); } $SortTemp = array(); -- 2.30.2