X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_selectUserToPrinterDialog.inc;h=ef9b38b9da7766fba11f2e3522c600825e0412d6;hb=dfa5fe6c803668ad23a8c44b6412f5d54d6d64b5;hp=20ee7ea22ac972993098a51637bf3c9c10fe59cc;hpb=406e32214ea7fa06e2b4c75078e751d7c18b2854;p=gosa.git diff --git a/plugins/admin/systems/class_selectUserToPrinterDialog.inc b/plugins/admin/systems/class_selectUserToPrinterDialog.inc index 20ee7ea22..ef9b38b9d 100644 --- a/plugins/admin/systems/class_selectUserToPrinterDialog.inc +++ b/plugins/admin/systems/class_selectUserToPrinterDialog.inc @@ -2,10 +2,6 @@ class selectUserToPrinterDialog extends plugin { - /* CLI vars */ - var $cli_summary = "Manage server basic objects"; - var $cli_description = "Some longer text\nfor help"; - var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); /* attribute list for save action */ var $ignore_account = TRUE; @@ -18,6 +14,7 @@ class selectUserToPrinterDialog extends plugin var $searchObjects = ""; var $searchAttrs = ""; var $searchAppend = ""; + var $baseAddition = ""; var $type = ""; function selectUserToPrinterDialog ($config, $dn= NULL,$type=false ) @@ -30,21 +27,25 @@ class selectUserToPrinterDialog extends plugin $this->searchObjects = "(objectClass=gosaAccount)(!(uid=*$))"; $this->searchAttrs = array("cn","uid"); $this->searchAppend = "uid"; + $this->baseAddition = get_people_ou(); ;break; case "AddGroup" : $this->searchObjects = "(objectClass=posixGroup)"; $this->searchAttrs = array("cn","description"); $this->searchAppend = "cn"; + $this->baseAddition = get_groups_ou(); ;break; case "AddAdminUser" : $this->searchObjects = "(objectClass=gosaAccount)(!(uid=*$))"; $this->searchAttrs = array("cn","uid"); $this->searchAppend = "uid"; + $this->baseAddition = get_people_ou(); ;break; case "AddAdminGroup" : $this->searchObjects = "(objectClass=posixGroup)"; $this->searchAttrs = array("cn","description"); $this->searchAppend = "cn"; + $this->baseAddition = get_groups_ou(); ;break; } $this->type = $type; @@ -70,11 +71,12 @@ class selectUserToPrinterDialog extends plugin $this->regex=preg_replace("/\*\*/","*",$this->regex); } + $tmp_printers= $this->getPrinter(); $smarty->assign("regexPrinter" , $this->regex); $smarty->assign("deplistPrinter" , $this->config->idepartments);//deplist); $smarty->assign("depselectPrinter" , $this->depselect); - $smarty->assign("gotoPrinters" , $this->getPrinter()); - $smarty->assign("gotoPrinterKeys" , array_flip($this->getPrinter())); + $smarty->assign("gotoPrinters" , $tmp_printers); + $smarty->assign("gotoPrinterKeys" , array_flip($tmp_printers)); $smarty->assign("apply" , apply_filter()); $smarty->assign("alphabet" , generate_alphabet()); $smarty->assign("search_image" , get_template_path('images/search.png')); @@ -88,7 +90,9 @@ class selectUserToPrinterDialog extends plugin } function check(){ - $message=array(); + /* Call common method to give check the hook */ + $message= plugin::check(); + if(empty($_POST['gotoPrinter'])){ $message[] = _("Please select a printer or press cancel."); } @@ -115,7 +119,8 @@ class selectUserToPrinterDialog extends plugin $a_return=array(); $ldap = $this->config->get_ldap_link(); $ldap->cd($this->depselect); - $ldap->search("(&".$this->searchObjects."(cn=".$this->regex."))",$this->searchAttrs); + #$ldap->search("(&".$this->searchObjects."(cn=".$this->regex."))", $this->depselect, $this->searchAttrs); + $ldap->ls("(&".$this->searchObjects."(cn=".$this->regex."))", $this->baseAddition.$this->depselect, $this->searchAttrs); while($printer = $ldap->fetch()){ if(($detailed ==true)){ if(isset($printer[$this->searchAppend])){ @@ -135,9 +140,5 @@ class selectUserToPrinterDialog extends plugin } } - - - - // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>