X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_printGeneric.inc;h=df9f7f12879878165062bdcb7a533e930683fa9c;hb=07e6492263fef837908f515518bd362b433a44ce;hp=9fe83499302db8fa79e847d05b3242de7c9958ba;hpb=d5b20d63aafd6e495dd4fe3b22ea1437ee7a1efc;p=gosa.git diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 9fe834993..df9f7f128 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -30,6 +30,7 @@ class printgeneric extends plugin var $AdminMemberKeys =array(); var $is_terminalBased = false; + var $gotoUserPrinter ; var $PPDdialogToSave = NULL; @@ -39,9 +40,12 @@ class printgeneric extends plugin var $dialog =NULL; var $netConfigDNS; + var $baseSelection = false; + + var $macAddress = ""; /* attribute list for save action */ - var $attributes = array("cn", "description", "l", "labeledURI", "gotoPrinterPPD"); + var $attributes = array("cn", "description", "l", "labeledURI", "gotoPrinterPPD","gotoUserPrinter", "macAddress"); var $objectclasses = array("top", "gotoPrinter"); function printgeneric ($config, $dn= NULL) @@ -155,18 +159,11 @@ class printgeneric extends plugin } } - /* This attributes is sometimes written with Uri instead of URI - In RFC 2079 it is defined with URI ... - */ - if(isset($this->attrs['labeledUri'])){ - $this->labeledURI = $this->attrs['labeledUri'][0]; - } - /* A printer was only saved if the printer belongs to a workstation. * If there was a new single printer created, it was never saved. * -This allows new printers to be saved. */ - if($this->dn == "new"){ + if(($this->dn == "new")&&(!$this->is_terminal)){ $this->is_account = true; } } @@ -253,6 +250,34 @@ class printgeneric extends plugin } } + /* Base select dialog */ + $once = true; + foreach($_POST as $name => $value){ + if(preg_match("/^chooseBase/",$name) && $once){ + $once = false; + $this->dialog = new baseSelectDialog($this->config); + $this->dialog->setCurrentBase($this->base); + $this->baseSelection = true; + } + } + + /* Dialog handling */ + if(is_object($this->dialog)){ + /* Must be called before save_object */ + $this->dialog->save_object(); + if($this->baseSelection){ + if($this->dialog->isClosed()){ + $this->dialog = false; + $this->baseSelection = false; + }elseif($this->dialog->isSelected()){ + $this->base = $this->dialog->isSelected(); + $this->dialog= false; + $this->baseSelection = false; + }else{ + return($this->dialog->execute()); + } + } + } /* Do we represent a valid printer? */ if (!$this->is_account && $this->parent == NULL){ @@ -470,7 +495,9 @@ class printgeneric extends plugin /* Check supplied data */ function check() { - $message= $this->netConfigDNS->check(); + /* Call common method to give check the hook */ + $message= plugin::check(); + $message= array_merge($message, $this->netConfigDNS->check()); if(isset($this->parent->by_name['workgeneric'])){ if($this->parent->by_object['workgeneric']->cn == "wdefault"){ @@ -586,6 +613,9 @@ class printgeneric extends plugin /* Append printer user */ + if(is_string( $this->attrs['gotoUserPrinter'])){ + $this->attrs['gotoUserPrinter']=array(); + } foreach($this->member['AddUser'] as $mem){ $this->attrs['gotoUserPrinter'][]=$mem['uid'][0]; } @@ -622,7 +652,9 @@ class printgeneric extends plugin } $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $this->cleanup(); +$ldap->modify ($this->attrs); + $this->handle_post_events("modify"); } show_ldap_error($ldap->get_error());