Code

Updated list
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 May 2007 12:47:47 +0000 (12:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 May 2007 12:47:47 +0000 (12:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6424 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/users/class_divListUsers.inc

index cca776319ca553a5d948737d5c0690adbebce6a5..c73fe97aa866e3f246a236a392a156cc1227761b 100644 (file)
@@ -89,19 +89,25 @@ class divListUsers extends MultiSelectWindow
     $base = $this->config->current['BASE'];
 
     /* Add base */
-    $deps[] = array("dn"=>$this->config->current['BASE']);
-    $deps= array_merge($deps,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
+    $tmp = array();
+    $tmp[] = array("dn"=>$this->config->current['BASE']);
+    $tmp=  array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
+    
+    $deps = array();
+    foreach($tmp as $tm){
+      $deps[$tm['dn']] = $tm['dn'];
+    }    
+
 
     /* Load possible departments */
     $ui= get_userinfo();
     $tdeps= $ui->get_module_departments("users");
     $ids = $this->config->idepartments;
-print_a($ids);
     $first = "";
     $found = FALSE;
-    foreach($deps as $dep){
-      if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){
+    foreach($ids as $dep => $name){
+      if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){
 
         /* Keep first base dn in mind, we could need this
          *  info if no valid base was found
@@ -110,12 +116,12 @@ print_a($ids);
           $first = $dep['dn'];
         }
 
-        $value = $ids[$dep['dn']]; 
-        if ($this->selectedBase == $dep['dn']){
+        $value = $ids[$dep]; 
+        if ($this->selectedBase == $dep){
           $found = TRUE;
-          $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
         } else {
-          $options.= "<option value='".$dep['dn']."'>$value</option>";
+          $options.= "<option value='".$dep."'>$value</option>";
         }
       }
     }