Code

Updated workstation - Startup
[gosa.git] / plugins / admin / systems / class_selectUserToPrinterDialog.inc
index f4964c15bee797ecb7c218125806ccee1182c5e6..1f110e3557a0a91b6c03d623f988722e94bd9675 100644 (file)
@@ -23,7 +23,7 @@ class selectUserToPrinterDialog extends plugin
   var $type                 = "";
   var $search_cat           = ""; 
  
-  function selectUserToPrinterDialog ($config, $dn= NULL,$type=false )
+  function selectUserToPrinterDialog (&$config, $dn= NULL,$type=false )
   {
     plugin::plugin ($config, $dn);
     $this->depselect = $this->config->current['BASE'];
@@ -85,8 +85,9 @@ class selectUserToPrinterDialog extends plugin
 
     /* Get all departments within this subtree */
     $base = $this->config->current['BASE'];
-    $deps_res= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", array("users","groups"), $this->config->current['BASE'],
-                    array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
+    $deps_res[] = array("dn"=>$this->config->current['BASE']);
+    $deps_res= array_merge($deps_res,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", array("users","groups"), $this->config->current['BASE'],
+                    array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
 
     /* Load possible departments */
     $ui     = get_userinfo();
@@ -170,7 +171,7 @@ class selectUserToPrinterDialog extends plugin
     $cat    = $this->search_cat;
 
     if ($this->subtree){
-      $res= get_list($filter,$cat,$base,$attrs, GL_SUBSEARCH);
+      $res= get_list($filter,$cat,$this->depselect,$attrs, GL_SUBSEARCH);
     } else {
       $res= get_list($filter,$cat,$base,$attrs);
     }