From: hickert Date: Fri, 25 Apr 2008 12:40:28 +0000 (+0000) Subject: Added additional check, that ensures that we do not remove wrong releases X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c1abe04a26dc7090e1088717227a07bc03a793bf;p=gosa.git Added additional check, that ensures that we do not remove wrong releases git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10693 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index 9dba9738c..2b1e2d257 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -491,6 +491,10 @@ class faiManagement extends plugin if(isset($br[$bb]) && $this->acl_is_removeable()){ $name = $br[$bb]; + + echo $bb."
"; + echo $name."
"; + $ldap->cd($bb); $ldap->recursive_remove(); $ldap->cd(preg_replace('/,'.normalizePreg(get_ou('faiou')).'/', ','.get_ou('applicationou'), $bb)); @@ -505,17 +509,7 @@ class faiManagement extends plugin $this->postremove(); new log("remove","fai/".get_class($this),$br[$bb],array(),"Release removed"); - trigger_error("Should be removed"); - }else{ - if(!isset($br[$bb])){ - trigger_error("Invalid release ".$bb); - } - if(!$this->acl_is_removeable()){ - trigger_error("Invalid permission"); - } } - }else{ - trigger_error("No remove Hook"); } } @@ -949,11 +943,6 @@ class faiManagement extends plugin ksort($ret); $ret = array_flip($ret); - /* Ensure that we have a valid release selected */ - if(!isset($ret[$this->fai_release])){ - $this->fai_release = $this->fai_base; - } - return ($ret); } @@ -1141,7 +1130,17 @@ class faiManagement extends plugin /* Get posted release */ $r_releases = array_flip($this->getBranches()); if(isset($_POST['fai_release']) && isset($r_releases[get_post('fai_release')])){ - $this->fai_release = $r_releases[get_post('fai_release')]; + + /* Ensure that we have a valid release selected */ + if(!isset($r_releases[get_post('fai_release')])){ + msg_dialog::display(_("Warning"),_("The selected release is not available anymore. All triggered actions are skipped.")); + $_POST = array(); + $plug =$_GET['plug']; + $_GET = array("plug" => $plug); + $this->fai_release = $this->fai_base; + }else{ + $this->fai_release = $r_releases[get_post('fai_release')]; + } $fai_filter = session::get("fai_filter"); $fai_filter['fai_release'] = $this->fai_release;