diff --git a/plugins/personal/environment/class_selectPrinterDialog.inc b/plugins/personal/environment/class_selectPrinterDialog.inc
index 88bebb34b69aa54b3d9b24a8374b944c368e344e..2400b2857909eb1b3fd9a89f33406f0c94de54d8 100644 (file)
var $ignore_account = TRUE;
var $attributes = array();
var $objectclasses = array("whatever");
- var $use_existing = false;
+ var $AlreadyAssigned = array();
var $regex = "*";
var $depselect = "/";
var $deplist = "/";
- function selectPrinterDialog ($config, $dn= NULL,$use_existing=false )
+ function selectPrinterDialog ($config, $dn= NULL,$alreadyused=array() )
{
- $this->use_existing = $use_existing;
+ $this->AlreadyAssigned = $alreadyused;
plugin::plugin ($config, $dn);
$this->depselect = $this->config->current['BASE'];
}
$this->regex=preg_replace("/\*\*/","*",$this->regex);
}
- $this->deplist=array_flip($this->config->departments);
+ $this->deplist=$this->config->idepartments;
$smarty->assign("regexPrinter" ,$this->regex);
$smarty->assign("deplistPrinter" ,$this->deplist);
}
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.");
}
$ldap->cd($this->depselect);
$ldap->search("(&(objectClass=gotoPrinter)(cn=".$this->regex."))",array("*"));
while($printer = $ldap->fetch()){
+
+ if(isset($this->AlreadyAssigned[$printer['cn'][0]])) continue;
+
if($detailed ==true){
$a_return[$printer['cn'][0]] = $printer;
}else{