From: hickert Date: Fri, 25 Apr 2008 12:47:52 +0000 (+0000) Subject: Updated FAI management X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a04ad4c1abfb774cf30615f49b2a07ff3bd79880;p=gosa.git Updated FAI management -Ensure that only the displayed release is removed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10694 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 2b1e2d257..7fea76a93 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -461,7 +461,7 @@ class faiManagement extends plugin /* Load permissions for selected 'dn' and check if we're allowed to remove this 'dn' */ if($this->acl_is_removeable()){ - + $smarty->assign("release_hidden",base64_encode($this->fai_release)); $smarty->assign("info", msgPool::deleteInfo(@LDAP::fix($this->fai_release),_("FAI branch/freeze"))); return($smarty->fetch(get_template_path('remove_branch.tpl',TRUE))); } else { @@ -482,33 +482,35 @@ class faiManagement extends plugin */ if("" != $this->config->search("faiManagement", "POSTREMOVE",array('menu','tabs'))){ - $bb = $this->fai_release; - if(!isset($ldap)){ - $ldap = $this->config->get_ldap_link(); - } + if(!isset($_POST['release_hidden']) || base64_decode($_POST['release_hidden']) != $this->fai_release){ + msg_dialog::display(_("Warning"),_("Release remove aborted, release name check failed.")); + }else{ - $br = $this->getBranches(); + $bb = $this->fai_release; + if(!isset($ldap)){ + $ldap = $this->config->get_ldap_link(); + } - if(isset($br[$bb]) && $this->acl_is_removeable()){ - $name = $br[$bb]; + $br = $this->getBranches(); - echo $bb."
"; - echo $name."
"; + if(isset($br[$bb]) && $this->acl_is_removeable()){ + $name = $br[$bb]; - $ldap->cd($bb); - $ldap->recursive_remove(); - $ldap->cd(preg_replace('/,'.normalizePreg(get_ou('faiou')).'/', ','.get_ou('applicationou'), $bb)); - $ldap->recursive_remove(); - $ldap->cd(preg_replace('/,'.normalizePreg(get_ou('faiou')).'/', ','.get_ou('mimetypeou'), $bb)); - $ldap->recursive_remove(); - $this->fai_release = $this->fai_base; + $ldap->cd($bb); + $ldap->recursive_remove(); + $ldap->cd(preg_replace('/,'.normalizePreg(get_ou('faiou')).'/', ','.get_ou('applicationou'), $bb)); + $ldap->recursive_remove(); + $ldap->cd(preg_replace('/,'.normalizePreg(get_ou('faiou')).'/', ','.get_ou('mimetypeou'), $bb)); + $ldap->recursive_remove(); + $this->fai_release = $this->fai_base; - /* Post remove */ - $this->lock_name = $name; - $this->lock_dn = $bb; - $this->postremove(); + /* Post remove */ + $this->lock_name = $name; + $this->lock_dn = $bb; + $this->postremove(); - new log("remove","fai/".get_class($this),$br[$bb],array(),"Release removed"); + new log("remove","fai/".get_class($this),$br[$bb],array(),"Release removed"); + } } } } diff --git a/gosa-plugins/fai/admin/fai/remove_branch.tpl b/gosa-plugins/fai/admin/fai/remove_branch.tpl index 1fb1d9f3d..23e8b0926 100644 --- a/gosa-plugins/fai/admin/fai/remove_branch.tpl +++ b/gosa-plugins/fai/admin/fai/remove_branch.tpl @@ -9,7 +9,7 @@

{t}So - if you're sure - press 'Delete' to continue or 'Cancel' to abort.{/t}

- +