From 1e5cc49a90dbeedfdca2b46a494bcc5ad86359e9 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 7 Jan 2010 08:43:52 +0000 Subject: [PATCH] Added checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15095 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_faiManagement.inc | 46 ++++++++++++------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index 141cff98b..5d8d11450 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -597,33 +597,45 @@ class faiManagement extends management */ function createBranch() { - $smarty = get_smarty(); - $this->dispNewBranch=true; - $this->dispNewFreeze=false; - $smarty->assign("iframe",false); - if(isset($_POST['BranchName'])){ - $smarty->assign("BranchName", $_POST['BranchName']); + if($this->config->search("faiManagement", "POSTCREATE",array('menu','tabs')) == ""){ + msg_dialog::display(_("Configuration"), msgPool::cmdnotfound(_("POSTCREATE"), get_class()), ERROR_DIALOG); + }elseif(!preg_match("/c/",$this->ui->get_permissions($this->acl_base,"fai/faiManagement"))){ + msg_dialog::display(_("Permission error"), msgPool::permCreate(_("Branch")), ERROR_DIALOG); }else{ - $smarty->assign("BranchName",""); + $smarty = get_smarty(); + $this->dispNewBranch=true; + $this->dispNewFreeze=false; + $smarty->assign("iframe",false); + if(isset($_POST['BranchName'])){ + $smarty->assign("BranchName", $_POST['BranchName']); + }else{ + $smarty->assign("BranchName",""); + } + return($smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__)))); } - return($smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__)))); } /*! \brief Initiates release creation */ function createFreeze() - { - $smarty = get_smarty(); - $this->dispNewFreeze=true; - $this->dispNewBranch=false; - $smarty->assign("iframe",false); - if(isset($_POST['BranchName'])){ - $smarty->assign("BranchName", $_POST['BranchName']); + { + if($this->config->search("faiManagement", "POSTCREATE",array('menu','tabs')) == ""){ + msg_dialog::display(_("Configuration"), msgPool::cmdnotfound(_("POSTCREATE"), get_class()), ERROR_DIALOG); + }elseif(!preg_match("/c/",$this->ui->get_permissions($this->acl_base,"fai/faiManagement"))){ + msg_dialog::display(_("Permission error"), msgPool::permCreate(_("Branch")), ERROR_DIALOG); }else{ - $smarty->assign("BranchName",""); + $smarty = get_smarty(); + $this->dispNewFreeze=true; + $this->dispNewBranch=false; + $smarty->assign("iframe",false); + if(isset($_POST['BranchName'])){ + $smarty->assign("BranchName", $_POST['BranchName']); + }else{ + $smarty->assign("BranchName",""); + } + return($smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__)))); } - return($smarty->fetch(get_template_path('faiNewBranch.tpl', TRUE, dirname(__FILE__)))); } -- 2.30.2