diff --git a/plugins/admin/systems/class_glpiPrinterAccount.inc b/plugins/admin/systems/class_glpiPrinterAccount.inc
index dd69e23012037cbca7ad17228d75b1104330ca77..6447d62ca47496fbeb3403e10e3ff28f2211d642 100644 (file)
/* Contructor
Sets default values and checks if we already have an existing glpi account
*/
- function glpiPrinterAccount ($config, $dn= NULL, $parent= NULL)
+ function glpiPrinterAccount (&$config, $dn= NULL, $parent= NULL)
{
plugin::plugin ($config, $dn, $parent);
$this->ui= get_userinfo();
if($this->is_account && !$this->view_logged){
$this->view_logged = TRUE;
- @log::log("view","printer/".get_class($this),$this->dn);
+ new log("view","printer/".get_class($this),$this->dn);
}
/* Fill templating stuff */
/* if( cur_dialog != false || cur_dialog != NULL)
* There is a dialog which wants to be displayed
*/
- if($this->cur_dialog){
+ if($this->cur_dialog && is_object($this->cur_dialog)){
$this->cur_dialog->save_object();
$this->dialog=true;
$this->cur_dialog->parent = &$this;
$this->handle = new glpiDB($this->data['SERVER'],$this->data['LOGIN'],$this->data['PASSWORD'],$this->data['DB']);
if($this->initially_was_account){
$this->handle->removePrinterInformations($this->dn);
- @log::log("remove","printer/".get_class($this),$this->dn);
+ new log("remove","printer/".get_class($this),$this->dn);
}
}
$this->handle = new glpiDB($this->data['SERVER'],$this->data['LOGIN'],$this->data['PASSWORD'],$this->data['DB']);
if($this->initially_was_account&&$this->is_account){
$this->handle->updatePrinterInformations($attrs,$this->dn);
- @log::log("modify","printer/".get_class($this),$this->dn);
+ new log("modify","printer/".get_class($this),$this->dn);
}elseif($this->is_account){
$this->handle->addPrinterInformations($attrs,$this->dn);
- @log::log("create","printer/".get_class($this),$this->dn);
+ new log("create","printer/".get_class($this),$this->dn);
}
$tmp = $this->handle->getPrinterInformations($this->dn);
$this->handle->addAttachmentsToPrinter($this->usedAttachments,$tmp[0]['ID']);