diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc
index 9b7d83051f9d432315255059704a98b8acc8a596..021c75f9d0f5b6864dbd6fbe27e31abb6d306aac 100644 (file)
$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 */
$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{
$ppdManager= new ppdManager($path);
if(!empty($this->gotoPrinterPPD)){
if((!file_exists($path.$this->gotoPrinterPPD))){
- $smarty->assign("driverInfo", "<b>".sprintf(_("Your currently selected PPD file '%s' doesn't exist."),$path.$this->gotoPrinterPPD))."</b>";
+ $smarty->assign("driverInfo", "<b>".sprintf(_("Your currently selected PPD file '%s' doesn't exist."),$path.$this->gotoPrinterPPD)."</b>");
}else{
$smarty->assign("driverInfo", $ppdManager->loadDescription($path.$this->gotoPrinterPPD));
}
/* 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'];
}
}
}
"plDescription" => _("Print generic"),
"plSelfModify" => FALSE,
"plDepends" => array(),
- "plPriority" => 11,
+ "plPriority" => 4,
"plSection" => array("administration"),
"plCategory" => array("printer" => array("description" => _("Printer"),
"objectClass" => "gotoPrinter"),"workstation","terminal"),