Code

Added user headpage department selector fix.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 Aug 2006 11:45:54 +0000 (11:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 Aug 2006 11:45:54 +0000 (11:45 +0000)
Just for testing.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4469 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/users/class_divListUsers.inc

index cef09a331d9e61535a806845c9e4a50069dcd25b..12a847efcc51a83fa11c0f1ef7cd2503e7b3453f 100644 (file)
@@ -83,11 +83,24 @@ class divListUsers extends MultiSelectWindow
 #$ui= get_userinfo();
 #$t= $ui->get_module_departments("users");
 #print_a($t);
-    foreach ($this->config->idepartments as $key => $value){
-      if ($this->selectedBase == $key){
-        $options.= "<option selected='selected' value='$key'>$value</option>";
-      } else {
-        $options.= "<option value='$key'>$value</option>";
+
+    
+    /* Get all departments within this subtree */ 
+    $base = $this->config->current['BASE'];
+    $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
+                    array("ou", "description"), GL_SIZELIMIT);
+  
+    $ids = $this->config->idepartments;
+  
+    foreach($deps as $dep){
+      if(isset($ids[$dep['dn']])){
+
+        $value = $ids[$dep['dn']]; 
+        if ($this->selectedBase == $dep){
+          $options.= "<option selected='selected' value='$dep'>$value</option>";
+        } else {
+          $options.= "<option value='$dep'>$value</option>";
+        }
       }
     }