From a3d7f9d1ca1a704e10287680a1a3d8ae95665ff7 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 6 Dec 2006 06:12:03 +0000 Subject: [PATCH] Fixed Blocklist base selcetion acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5307 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../blocklists/class_blocklistManagement.inc | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc index 5c81d030a..5d96251d4 100644 --- a/plugins/gofax/blocklists/class_blocklistManagement.inc +++ b/plugins/gofax/blocklists/class_blocklistManagement.inc @@ -264,7 +264,7 @@ class blocklist extends plugin foreach($_POST as $name => $value){ if(preg_match("/^chooseBase/",$name) && $once){ $once = false; - $this->dialog = new baseSelectDialog($this->config,$this); + $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases()); $this->dialog->setCurrentBase($this->base); } } @@ -277,8 +277,14 @@ class blocklist extends plugin if($this->dialog->isClosed()){ $this->dialog = 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; + }else{ return($this->dialog->execute()); } @@ -317,12 +323,6 @@ class blocklist extends plugin $smarty->assign("$val", $this->$val); } - $baseACL = $this->getacl("base"); - if(!$this->acl_is_moveable()) { - $baseACL = preg_replace("/w/","",$baseACL); - } - $smarty->assign("baseACL", $baseACL); - /* Lock blocklist type for non new entries */ $smarty->assign('typeACL',$this->getacl("type", ($this->dn != "new"))); @@ -438,17 +438,22 @@ class blocklist extends plugin function save_object() { $this->DivListBlocklist->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; - $baseACL = $this->getacl("base"); - if(!$this->acl_is_moveable()) { - $baseACL = preg_replace("/w/","",$baseACL); + /* Save base, since this is no LDAP attribute */ + $tmp = $this->get_allowed_bases(); + if(isset($_POST['base'])){ + if(isset($tmp[$_POST['base']])){ + $this->base= $_POST['base']; + } } - if(isset($_POST['base']) && preg_match("/w/",$baseACL)){ - $this->base = $_POST['base']; - } - foreach($this->attributes as $attr){ if(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){ $this->$attr = $_POST[$attr]; -- 2.30.2