Code

Column name changed.
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_workstationStartup.inc
index ef3fa586a94c316aa6bf02ea7e7b25503d93ca30..ea4db08a490e13d67b80f8cc1c65ac5ff10d370c 100644 (file)
@@ -61,7 +61,7 @@ class workstartup extends plugin
   {
     /* Check if FAI is active */
     $tmp= $config->search("faiManagement", "CLASS",array('menu','tabs'));
-    if(!empty($tmp)){
+    if(!empty($tmp) && class_available("faiManagement")){
       $this->fai_activated = TRUE;
     }else{
       $this->attributes = array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "gotoShare");
@@ -179,7 +179,7 @@ class workstartup extends plugin
       }
     }
 
-    $this->otoShareSelections= $config->getShareList(true);
+    $this->gotoShareSelections= $config->getShareList(true);
     $this->gotoAvailableShares= $config->getShareList(false);
     $tmp2 = array();
   
@@ -261,36 +261,6 @@ class workstartup extends plugin
         $this->update_fai_cache();
       }
     }
-
-#   /* Get list of boot kernels */
-#   if (isset($this->config->data['TABS'])){
-#     $command= $this->config->search(get_class($this), "KERNELS",array('tabs'));
-#     if (!check_command($command)){
-#       $message[]= sprintf(_("Command '%s', specified as KERNELS hook for plugin '%s' doesn't seem to exist."), $command,
-#           get_class($this));
-#     } else {
-#       $fh= popen($command, "r");
-#       while (!feof($fh)) {
-#         $buffer= trim(fgets($fh, 256));
-#         if(!empty($buffer)){
-#           $name=$value = $buffer;
-#           if(preg_match("/:/",$buffer)){
-#             $name = preg_replace("/:.*$/","",$buffer);
-#             $value= preg_replace("/^.*:/","",$buffer);
-#             $this->gotoBootKernels[$name]= $name.":".$value;
-#           }else{
-#             $this->gotoBootKernels[$name]= $value;
-#           }
-#         }
-#       }
-#       pclose($fh);
-#     }
-#   }
-#
-#    /* Turn to default, if we've nothing to inherit */
-#    if (!isset($this->gotoBootKernels['default-inherited']) && $this->gotoBootKernel == "default-inherited"){
-#      $this->gotoBootKernel= "default";
-#    }
   }
 
   
@@ -328,14 +298,14 @@ class workstartup extends plugin
 
     /* Add module */
     if (isset ($_POST['add_module'])){
-      if ($_POST['module'] != "" && $this->acl_is_writeable("gotoModule")){
+      if ($_POST['module'] != "" && $this->acl_is_writeable("gotoModules")){
         $this->add_list ($this->gotoModules, $_POST['module']);
       }
     }
 
     /* Delete module */
     if (isset ($_POST['delete_module'])){
-      if (count($_POST['modules_list']) && $this->acl_is_writeable("gotoModule")){
+      if (count($_POST['modules_list']) && $this->acl_is_writeable("gotoModules")){
         $this->del_list ($this->gotoModules, $_POST['modules_list']);
       }
     }
@@ -466,12 +436,13 @@ class workstartup extends plugin
     /* if $_POST['gotoShareAdd'] is set, we will try to add a new entry
      * This entry will be, a combination of mountPoint and sharedefinitions
      */
-    if((isset($_POST['gotoShareAdd'])) && ($this->acl_is_writeable("gotoShare"))) {
+    if((isset($_POST['gotoShareAdd'])) && isset($_POST['gotoShareSelection']) && ($this->acl_is_writeable("gotoShare"))) {
       /* We assign a share to this user, if we don't know where to mount the share */
       if((!isset($_POST['gotoShareMountPoint']))||(empty($_POST['gotoShareMountPoint']))||(preg_match("/[\|]/i",$_POST['gotoShareMountPoint']))){
         msg_dialog::display(_("Error"), msgPool::required(_("Mount point")), ERROR_DIALOG);
       }else{
-        if(count($this->gotoAvailableShares)){
+    
+        if(isset($this->gotoAvailableShares[$_POST['gotoShareSelection']])){
           $a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']];
           $s_mount = $_POST['gotoShareMountPoint'];
           /* Preparing the new assignment */
@@ -1108,7 +1079,7 @@ class workstartup extends plugin
         return;
       }else{
         foreach($tmp as $entry){
-          $rel = $entry['RELEASE'];
+          $rel = $entry['FAI_RELEASE'];
           $this->cache['SERVERS']['auto'][$rel] = $rel;
           $this->cache['SERVERS'][$entry['SERVER']][$rel] = $rel;
           uksort($this->cache['SERVERS']['auto'], 'strnatcasecmp');
@@ -1335,14 +1306,14 @@ class workstartup extends plugin
   function GetHookElements()
   {
     $ret = array();
-    $cmd= $this->config->search("servrepository", "REPOSITORY_HOOK",array('tabs'));
+    $cmd= $this->config->search("servrepository", "repositoryBranchHook",array('tabs'));
     if(!empty($cmd)){
       $res = shell_exec($cmd);
       $res2 = trim($res);
       if((!$res)){
-        msg_dialog::display(_("Configuration error"), msgPool::cmdexecfailed("REPOSITORY_HOOK", $cmd), ERROR_DIALOG);
+        msg_dialog::display(_("Configuration error"), msgPool::cmdexecfailed("repositoryBranchHook", $cmd), ERROR_DIALOG);
       }elseif(empty($res2)){
-        msg_dialog::display(_("Configuration error"), _("REPOSITORY_HOOK returned no result!"), ERROR_DIALOG);
+        msg_dialog::display(_("Configuration error"), _("repositoryBranchHook returned no result!"), ERROR_DIALOG);
       }else{
         $tmp = split("\n",$res);
         foreach($tmp as $line){