X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_printGeneric.inc;h=021c75f9d0f5b6864dbd6fbe27e31abb6d306aac;hb=269b6da4461630896e0af284cca9742b9f819f2b;hp=9b7d83051f9d432315255059704a98b8acc8a596;hpb=53c2ca36c3f32d1e2a7c2b3ae96ec04fd64fd05e;p=gosa.git diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 9b7d83051..021c75f9d 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -288,14 +288,6 @@ class printgeneric extends plugin $smarty->assign($name."ACL", $this->getacl($name)); } - /* Create base acls */ - $baseACL = $this->getacl("base"); - if(!$this->acl_is_moveable()) { - $baseACL = preg_replace("/w/","",$baseACL); - } - $smarty->assign("baseACL", $baseACL); - - $display=""; /* Tell smarty if this is a standalone object or a terminal / WS depending printer */ @@ -371,7 +363,13 @@ class printgeneric extends plugin $this->dialog = false; $this->baseSelection = false; }elseif($this->dialog->isSelected()){ - $this->base = $this->dialog->isSelected(); + + /* A new base was selected, check if it is a valid one */ + $tmp = $this->get_allowed_bases(); + if(isset($tmp[$this->dialog->isSelected()])){ + $this->base = $this->dialog->isSelected(); + } + $this->dialog= false; $this->baseSelection = false; }else{ @@ -507,7 +505,7 @@ class printgeneric extends plugin $ppdManager= new ppdManager($path); if(!empty($this->gotoPrinterPPD)){ if((!file_exists($path.$this->gotoPrinterPPD))){ - $smarty->assign("driverInfo", "".sprintf(_("Your currently selected PPD file '%s' doesn't exist."),$path.$this->gotoPrinterPPD)).""; + $smarty->assign("driverInfo", "".sprintf(_("Your currently selected PPD file '%s' doesn't exist."),$path.$this->gotoPrinterPPD).""); }else{ $smarty->assign("driverInfo", $ppdManager->loadDescription($path.$this->gotoPrinterPPD)); } @@ -603,27 +601,22 @@ class printgeneric extends plugin /* Save data to object */ function save_object() { + /* Create a base backup and reset the + base directly after calling plugin::save_object(); + Base will be set seperatly a few lines below */ + $base_tmp = $this->base; plugin::save_object(); - + $this->base = $base_tmp; + if(is_object($this->netConfigDNS)){ $this->netConfigDNS->save_object(); } - - /* Save base, since this is no LDAP attribute */ - if((isset($_POST['base'])) && ($this->acl_is_moveable()) ) { - $this->set_acl_base('dummy,'.$_POST['base']); - if($this->acl_is_moveable()){ - - if(isset($this->config->idepartments[$_POST['base']])){ - $this->base = $_POST['base']; - if ($_POST['base'] != $this->base){ - $this->is_modified= TRUE; - } - } - }else{ - - print_red(sprintf(_("You are not allowed to move this object to '%s'."),LDAP::fix($_POST['base']))); - $this->set_acl_base('dummy,'.$this->base); + + /* Set new base if allowed */ + $tmp = $this->get_allowed_bases(); + if(isset($_POST['base'])){ + if(isset($tmp[$_POST['base']])){ + $this->base= $_POST['base']; } } } @@ -860,7 +853,7 @@ class printgeneric extends plugin "plDescription" => _("Print generic"), "plSelfModify" => FALSE, "plDepends" => array(), - "plPriority" => 11, + "plPriority" => 4, "plSection" => array("administration"), "plCategory" => array("printer" => array("description" => _("Printer"), "objectClass" => "gotoPrinter"),"workstation","terminal"),