Code

Fixed glpi user select
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Sep 2006 07:46:14 +0000 (07:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Sep 2006 07:46:14 +0000 (07:46 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4795 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_glpiAccount.inc
plugins/admin/systems/class_glpiSelectUser.inc

index 4c43d5c4e51646ca9c23aa648df2ecaed2daca6d..10155ac1251153eb6bedc41f62b28b8601e700ff 100644 (file)
@@ -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*/
index 8e7eff7e3812b28adc51c79dd027af5509f5da03..ff7c0a4ac7b7354ebe9f9aa63e6c9362c5bca1e3 100644 (file)
@@ -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.= "<option selected='selected' value='$key'>$value</option>";
       } 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);