Code

Added checks
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 7 Jan 2010 08:43:52 +0000 (08:43 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 7 Jan 2010 08:43:52 +0000 (08:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15095 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiManagement.inc

index 141cff98b6d0da83eaa94a70c822d9138666c576..5d8d114500b8c562a1b0fdc2b0f4d57ace24cb23 100644 (file)
@@ -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__))));
   }