From b4dd732c45b096d0c4b4c869244d13b36e3eb733 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 29 Nov 2006 07:00:15 +0000 Subject: [PATCH] Fixed object Listing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5239 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_divListSystem.inc | 9 ++++++++- plugins/admin/systems/class_systemManagement.inc | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index 9ca7308e3..435f8291f 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -220,8 +220,15 @@ class divListSystem extends MultiSelectWindow // Test Every Entry and generate divlist Array foreach($terminals as $key => $val){ + /* Get system type, it is used to fetch the acls for the current object. + "winstation" acls are stored as 2winworkstation", so we have to map this here */ $type = $this->parent->get_system_type($val['objectClass']); - $acl_all = $ui->has_complete_category_acls($val['dn'],$type) ; + if($type == "winstation") { + $acl_type = "winworkstation"; + }else{ + $acl_type = $type; + } + $acl_all = $ui->has_complete_category_acls($val['dn'],$acl_type) ; $action= ""; diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index de5f19e02..9918377e2 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -685,8 +685,15 @@ class systems extends plugin if($this->DivListSystem->SubSearch){ if($oc['CLASS'] != ""){ $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))"; - $res = array_merge($res,get_list($filter, array("terminal", "workstation", "server", "phone" ,"printer"), $base, - array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT)); + $new_res = get_list($filter, array("terminal", "workstation", "server", "phone" ,"printer"), $base, + array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT); + + /* Remove all objects that are not in the expected sub department */ + foreach($new_res as $key => $obj){ + if(preg_match("/^[^,]+,".normalizePreg($oc['TREE'])."/",$obj['dn'])){ + $res[$obj['dn']] = $obj; + } + } } }else{ /* User filter? */ -- 2.30.2