summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b79404f)
raw | patch | inline | side by side (parent: b79404f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Jul 2007 07:18:59 +0000 (07:18 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Jul 2007 07:18:59 +0000 (07:18 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6902 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/fai/class_divListFai.inc | patch | blob | history | |
plugins/admin/fai/class_faiManagement.inc | patch | blob | history |
index 79b98c166cd2e4e3e4d69cff96756f06fb39fcfa..c474b15e0d9f243fab07ab67e92dd16060587807 100644 (file)
$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);
index dbb18dc453ea74e0dcf24323e2203819415fbb6d..8059276090bae60a7207cf6652b264f5e9e7d027 100644 (file)
*/
if($s_action == "remove_branch"){
- $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)
+ */
+ if("" != search_config($this->config->data,"faiManagement","POSTREMOVE")){
- $base= $this->DivListFai->selectedBranch;
+ $base= $this->DivListFai->selectedBranch;
- /* Load permissions for selected 'dn' and check if
- we're allowed to remove this 'dn' */
- $acl= get_permissions ($this->DivListFai->selectedBase, $this->ui->subtreeACL);
- $this->acl= get_module_permission($acl, "FAIclass", $base);
- if (chkacl($this->acl, "delete") == ""){
+ /* Load permissions for selected 'dn' and check if
+ we're allowed to remove this 'dn' */
+ $acl= get_permissions ($this->DivListFai->selectedBase, $this->ui->subtreeACL);
+ $this->acl= get_module_permission($acl, "FAIclass", $base);
+ if (chkacl($this->acl, "delete") == ""){
$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 {
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();
- }
-
- $br = $this->DivListFai->AvailableBranches;
+ /* Check if we have a post remove method configured
+ * else skip this operation. (Skip:Button in the ui should be disabled in this case)
+ */
+ if("" != search_config($this->config->data,"faiManagement","POSTREMOVE")){
- if(isset($br[$bb])){
- $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";
- $this->DivListFai->AvailableBranches = $this->getBranches();
+ $bb = $this->DivListFai->selectedBranch;
+ if(!isset($ldap)){
+ $ldap = $this->config->get_ldap_link();
+ }
- /* Post remove */
- $this->lock_name = $name;
- $this->lock_dn = $bb;
- $this->postremove();
+ $br = $this->DivListFai->AvailableBranches;
+
+ if(isset($br[$bb])){
+ $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";
+ $this->DivListFai->AvailableBranches = $this->getBranches();
+
+ /* Post remove */
+ $this->lock_name = $name;
+ $this->lock_dn = $bb;
+ $this->postremove();
+ }
}
}
-
/****************
/****************
Display dialog to enter new Branch name
****************/
-
- $c = "" != search_config($this->config->data,"faiManagement","POSTMODIFY");
-
- if($c){
+
+ /* Check if we have a post create method configured
+ * else skip this operation. (Skip:Button in the ui should be disabled in this case)
+ */
+ if("" != search_config($this->config->data,"faiManagement","POSTCREATE")){
$acl= get_permissions ($this->DivListFai->selectedBase, $this->ui->subtreeACL);
$this->acl= get_module_permission($acl, "FAIclass", $this->DivListFai->selectedBase);
if((($s_action == "branch_branch")||($this->dispNewBranch)) && chkacl($this->acl,"FAIclass") == ""){
Display dialog to enter new Freeze name
****************/
- $c = "" != search_config($this->config->data,"faiManagement","POSTMODIFY");
-
- if($c){
+ /* Check if we have a post create method configured
+ * else skip this operation. (Skip:Button in the ui should be disabled in this case)
+ */
+ if("" != search_config($this->config->data,"faiManagement","POSTCREATE")){
$acl= get_permissions ($this->DivListFai->selectedBase, $this->ui->subtreeACL);
$this->acl= get_module_permission($acl, "FAIclass", $this->DivListFai->selectedBase);
if((($s_action == "freeze_branch")||($this->dispNewFreeze)) && chkacl($this->acl,"FAIclass") == ""){