diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index 9fe83499302db8fa79e847d05b3242de7c9958ba..df9f7f12879878165062bdcb7a533e930683fa9c 100644 (file)
var $AdminMemberKeys =array();
var $is_terminalBased = false;
+ var $gotoUserPrinter ;
var $PPDdialogToSave = NULL;
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)
}
}
- /* 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;
}
}
}
}
+ /* 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){
/* 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"){
/* 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];
}
}
$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());