From 31d23391fdb71800f6a7bd06602bb7da992e18e0 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 19 May 2011 12:04:06 +0000 Subject: [PATCH] Updated listing class -Check entry permissions in management listings git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20884 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_acl.inc | 2 +- gosa-core/include/class_listing.inc | 23 ++++++++++++++++++++++- gosa-core/include/class_remoteObject.inc | 5 +++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/class_acl.inc b/gosa-core/include/class_acl.inc index 6f0af83fb..e2bab7dda 100644 --- a/gosa-core/include/class_acl.inc +++ b/gosa-core/include/class_acl.inc @@ -250,7 +250,7 @@ class acl extends plugin $this->sectionList->setDeleteable(false); $this->sectionList->setEditable(false); $this->sectionList->setWidth("100%"); - $this->sectionList->setHeight("120px"); + $this->sectionList->setHeight("220px"); $this->sectionList->setColspecs(array('200px','*')); $this->sectionList->setHeader(array(_("Section"),_("Description"))); $this->sectionList->setDefaultSortColumn(0); diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc index 456b3cb8d..5d8e6069c 100644 --- a/gosa-core/include/class_listing.inc +++ b/gosa-core/include/class_listing.inc @@ -55,7 +55,7 @@ class listing { var $height= 0; var $scrollPosition= 0; var $baseSelector; - + var $aclToObjectClass = array(); function listing($source, $isString = FALSE) { @@ -194,6 +194,10 @@ class listing { $this->objectTypes[$tmp['objectClass']]= $tmp; if (isset($this->xmlData['definition']['objectType'][$index]['category'])){ $this->categories[]= $otype['category']; + + if(isset($otype['category']) && isset($otype['class'])){ + $this->aclToObjectClass[$otype['category']."/".$otype['class']][] = $otype['objectClass']; + } } } } @@ -385,6 +389,7 @@ class listing { } // Fill with contents, sort as configured + $ui = get_userinfo(); foreach ($this->entries as $row => $entry) { $trow= ""; @@ -647,6 +652,22 @@ class listing { $this->filter->setBase($this->base); $this->entries= $this->filter->query(); + // Check entry acls + foreach($this->entries as $row => $entry){ + $acl = ""; + $found = false; + foreach($this->aclToObjectClass as $category => $ocs){ + if(count(array_intersect($ocs, $entry['objectClass']))){ + $acl .= $ui->get_permissions($entry['dn'],$category, 0); + $found = true; + } + } + if(!preg_match("/r/", $acl) && $found){ + unset($this->entries[$row]); + continue; + } + } + // Fix filter if querie returns NULL if ($this->entries == null) { $this->entries= array(); diff --git a/gosa-core/include/class_remoteObject.inc b/gosa-core/include/class_remoteObject.inc index c3e241f08..7e21a248d 100644 --- a/gosa-core/include/class_remoteObject.inc +++ b/gosa-core/include/class_remoteObject.inc @@ -145,6 +145,11 @@ class remoteObject return($this->success); } + function getError() + { + return($this->lastError); + } + /*!\brief A catch all method for setter calls. * -- 2.30.2