From a0560fa63034ba91a02649bafb211fd355bc6860 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 27 Sep 2006 07:46:14 +0000 Subject: [PATCH] Fixed glpi user select git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4795 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_glpiAccount.inc | 5 +++++ plugins/admin/systems/class_glpiSelectUser.inc | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/admin/systems/class_glpiAccount.inc b/plugins/admin/systems/class_glpiAccount.inc index 4c43d5c4e..10155ac12 100644 --- a/plugins/admin/systems/class_glpiAccount.inc +++ b/plugins/admin/systems/class_glpiAccount.inc @@ -453,6 +453,9 @@ class glpiAccount extends plugin if(isset($_POST['SelectContactPerson']) && $this->acl_is_writeable("contact_num")){ $this->addUser = "contact"; $this->cur_dialog= new glpiSelectUser($this->config,$this->dn,"user_tech_num"); + $this->cur_dialog->set_acl_category(preg_replace("/\//","",$this->acl_category)); + $this->cur_dialog->set_acl_base($this->dn); + } /* Open dialog which allows to edit the manufacturers @@ -483,6 +486,8 @@ class glpiAccount extends plugin if(isset($_POST['SelectTechPerson']) && $this->acl_is_writeable("tech_num")){ $this->addUser ="tech"; $this->cur_dialog= new glpiSelectUser($this->config,$this->dn,"user_tech_num"); + $this->cur_dialog->set_acl_category(preg_replace("/\//","",$this->acl_category)); + $this->cur_dialog->set_acl_base($this->dn); } /* Technical responsible person selected*/ diff --git a/plugins/admin/systems/class_glpiSelectUser.inc b/plugins/admin/systems/class_glpiSelectUser.inc index 8e7eff7e3..ff7c0a4ac 100644 --- a/plugins/admin/systems/class_glpiSelectUser.inc +++ b/plugins/admin/systems/class_glpiSelectUser.inc @@ -147,7 +147,8 @@ class glpiSelectUser extends plugin which are shown in the listbox on top of the listbox */ $options= ""; - foreach ($this->config->idepartments as $key => $value){ + $this->base = $_SESSION['glpi_user_filter']['base']; + foreach ($this->get_allowed_bases("users/user") as $key => $value){ if ($_SESSION['glpi_user_filter']['base'] == $key){ $options.= ""; } else { @@ -208,8 +209,8 @@ class glpiSelectUser extends plugin * So we are able to navigate like in konquerer */ - $res3= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", - "glpi", $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT); + $res3= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))",preg_replace("/\//","",$this->acl_category), + $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT); $this->departments= array(); $tmp = array(); @@ -228,7 +229,8 @@ class glpiSelectUser extends plugin /* END NEW LIST MANAGMENT */ $ou = get_people_ou(); - $res2= get_list("(&(|(cn=$regex)(sn=$regex))(objectClass=person))", "glpi", + + $res2= get_list("(&(|(cn=$regex)(sn=$regex))(objectClass=person))", preg_replace("/\//","",$this->acl_category), $ou.$base, array("cn", "sn", "uid", "givenName", "description"), GL_SUBSEARCH | GL_SIZELIMIT); -- 2.30.2