From: hickert Date: Wed, 18 Jul 2007 07:23:06 +0000 (+0000) Subject: Udpated psot checks for faiManagement X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3d277574531acabb801427b7063705fe25e1c08a;p=gosa.git Udpated psot checks for faiManagement git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6903 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index 77f84cd27..b6fc3e399 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -91,8 +91,11 @@ class divListFai extends MultiSelectWindow $str = ""; if($position == 2){ - $r = "" != search_config($this->config->data,"faiManagement","POSTREMOVE"); - $c = "" != search_config($this->config->data,"faiManagement","POSTCREATE"); + /* Check if there are post commands available for fai management. + * If not, grey out freeze/branch and release remove buttons. + */ + $r = ("" != search_config($this->config->data,"faiManagement","POSTREMOVE")); + $c = ("" != search_config($this->config->data,"faiManagement","POSTCREATE")); $smarty = get_smarty(); $smarty->assign("allow_create", $c); diff --git a/plugins/admin/fai/class_faiManagement.inc b/plugins/admin/fai/class_faiManagement.inc index 86fb0c4c9..20c50d07b 100644 --- a/plugins/admin/fai/class_faiManagement.inc +++ b/plugins/admin/fai/class_faiManagement.inc @@ -372,8 +372,10 @@ class faiManagement extends plugin if($s_action == "remove_branch"){ $base= $this->DivListFai->selectedBranch; - $r = "" != search_config($this->config->data,"faiManagement","POSTREMOVE"); - if($r){ + /* Check if we have a post remove method configured + * else skip this operation. (Skip:Button in the ui should be disabled in this case too) + */ + if("" != search_config($this->config->data,"faiManagement","POSTREMOVE")){ /* Load permissions for selected 'dn' and check if we're allowed to remove this 'dn' */ @@ -395,29 +397,33 @@ class faiManagement extends plugin if(isset($_POST['delete_branch_confirm'])){ - $r = "" != search_config($this->config->data,"faiManagement","POSTREMOVE"); + /* Check if we have a post remove method configured + * else skip this operation. (Skip:Button in the ui should be disabled in this case too) + */ + if("" != search_config($this->config->data,"faiManagement","POSTREMOVE")){ - $bb = $this->DivListFai->selectedBranch; - if(!isset($ldap)){ - $ldap = $this->config->get_ldap_link(); - } + $bb = $this->DivListFai->selectedBranch; + if(!isset($ldap)){ + $ldap = $this->config->get_ldap_link(); + } - $br = $this->getBranches(); + $br = $this->getBranches(); - if(isset($br[$bb]) && $this->acl_is_removeable()){ - $name = $br[$bb]; - $ldap->cd($bb); - $ldap->recursive_remove(); - $ldap->cd(preg_replace('/,ou=fai,ou=configs,ou=systems,/', ',ou=apps,', $bb)); - $ldap->recursive_remove(); - $this->DivListFai->selectedBranch = "main"; + if(isset($br[$bb]) && $this->acl_is_removeable()){ + $name = $br[$bb]; + $ldap->cd($bb); + $ldap->recursive_remove(); + $ldap->cd(preg_replace('/,ou=fai,ou=configs,ou=systems,/', ',ou=apps,', $bb)); + $ldap->recursive_remove(); + $this->DivListFai->selectedBranch = "main"; - /* 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"); + } } } @@ -591,8 +597,10 @@ class faiManagement extends plugin Display dialog to enter new Branch name ****************/ - $r = "" != search_config($this->config->data,"faiManagement","POSTMODIFY"); - if($r){ + /* Check if we have a post create method configured + * else skip this operation. (Skip:Button in the ui should be disabled in this case too) + */ + if("" != search_config($this->config->data,"faiManagement","POSTCREATE")){ if(($s_action == "branch_branch")||($this->dispNewBranch)){ $this->dispNewBranch=true; $smarty->assign("iframe",false); @@ -606,8 +614,10 @@ class faiManagement extends plugin Display dialog to enter new Freeze name ****************/ - $r = "" != search_config($this->config->data,"faiManagement","POSTMODIFY"); - if($r){ + /* Check if we have a post create method configured + * else skip this operation. (Skip:Button in the ui should be disabled in this case too) + */ + if("" != search_config($this->config->data,"faiManagement","POSTCREATE")){ if(($s_action == "freeze_branch")||($this->dispNewFreeze)){ $this->dispNewFreeze = true; $smarty->assign("iframe",false);