From: hickert Date: Mon, 9 Jul 2007 13:01:49 +0000 (+0000) Subject: Udpated FAI handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=189da344d7c1ef370dc0aa3319548756f60d7e86;p=gosa.git Udpated FAI handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6779 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/branch_selector.tpl b/plugins/admin/fai/branch_selector.tpl index 642c9420e..2211b0347 100644 --- a/plugins/admin/fai/branch_selector.tpl +++ b/plugins/admin/fai/branch_selector.tpl @@ -16,18 +16,21 @@ diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index e4831a17b..77f84cd27 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -86,10 +86,17 @@ class divListFai extends MultiSelectWindow $this->AddRegex ("Regex", _("Display users matching"),"*" , true); } - function AddUserBoxToFilter($position){ + function AddUserBoxToFilter($position) + { $str = ""; if($position == 2){ + + $r = "" != search_config($this->config->data,"faiManagement","POSTREMOVE"); + $c = "" != search_config($this->config->data,"faiManagement","POSTCREATE"); + $smarty = get_smarty(); + $smarty->assign("allow_create", $c); + $smarty->assign("allow_remove", $r); $smarty->assign("selectedBranch",$this->selectedBranch); $smarty->assign("branchimage","images/branch.png"); $smarty->assign("branches",$this->AvailableBranches); diff --git a/plugins/admin/fai/class_faiManagement.inc b/plugins/admin/fai/class_faiManagement.inc index 1922b2aad..a991b1d8d 100644 --- a/plugins/admin/fai/class_faiManagement.inc +++ b/plugins/admin/fai/class_faiManagement.inc @@ -372,15 +372,19 @@ class faiManagement extends plugin if($s_action == "remove_branch"){ $base= $this->DivListFai->selectedBranch; - /* Load permissions for selected 'dn' and check if - we're allowed to remove this 'dn' */ - $this->set_acl_base($base); - if($this->acl_is_removeable()){ - - $smarty->assign("info", sprintf(_("You're about to delete a fai branch / freeze '%s'."), $this->DivListFai->selectedBranch)); - return($smarty->fetch(get_template_path('remove_branch.tpl',TRUE))); - } else { - print_red (_("You are not allowed to delete this release!")); + $r = "" != search_config($this->config->data,"faiManagement","POSTREMOVE"); + if($r){ + + /* Load permissions for selected 'dn' and check if + we're allowed to remove this 'dn' */ + $this->set_acl_base($base); + if($this->acl_is_removeable()){ + + $smarty->assign("info", sprintf(_("You're about to delete a fai branch / freeze '%s'."), $this->DivListFai->selectedBranch)); + return($smarty->fetch(get_template_path('remove_branch.tpl',TRUE))); + } else { + print_red (_("You are not allowed to delete this release!")); + } } } @@ -390,6 +394,9 @@ class faiManagement extends plugin ****************/ if(isset($_POST['delete_branch_confirm'])){ + + $r = "" != search_config($this->config->data,"faiManagement","POSTREMOVE"); + $bb = $this->DivListFai->selectedBranch; if(!isset($ldap)){ $ldap = $this->config->get_ldap_link(); @@ -413,6 +420,7 @@ class faiManagement extends plugin new log("remove","fai/".get_class($this),$br[$bb],array(),"Release removed"); } } + } /**************** @@ -584,23 +592,29 @@ class faiManagement extends plugin Display dialog to enter new Branch name ****************/ - if(($s_action == "branch_branch")||($this->dispNewBranch)){ - $this->dispNewBranch=true; - $smarty->assign("iframe",false); - $display .= $smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__))); - return($display); + $r = "" != search_config($this->config->data,"faiManagement","POSTMODIFY"); + if($r){ + if(($s_action == "branch_branch")||($this->dispNewBranch)){ + $this->dispNewBranch=true; + $smarty->assign("iframe",false); + $display .= $smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__))); + return($display); + } } - + /**************** Display dialog to enter new Freeze name ****************/ - if(($s_action == "freeze_branch")||($this->dispNewFreeze)){ - $this->dispNewFreeze = true; - $smarty->assign("iframe",false); - $display .= $smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__))); - return($display); + $r = "" != search_config($this->config->data,"faiManagement","POSTMODIFY"); + if($r){ + if(($s_action == "freeze_branch")||($this->dispNewFreeze)){ + $this->dispNewFreeze = true; + $smarty->assign("iframe",false); + $display .= $smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__))); + return($display); + } }
- -   - {t}Create new branch{/t} -
- -   - {t}Create new locked branch{/t} - {if $selectedBranch != "main"} -
- -   - {t}Delete current release{/t} + + {if $allow_create} + +   + {t}Create new branch{/t} +
+ +   + {t}Create new locked branch{/t} + {/if} + {if $selectedBranch != "main" && $allow_remove} +
+ +   + {t}Delete current release{/t} {/if}