Code

added fix for inherit / default for workstationstartup
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 9 Aug 2006 06:17:40 +0000 (06:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 9 Aug 2006 06:17:40 +0000 (06:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4432 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_workstationStartup.inc

index 5d7e1bb9083a8ac7e4c2c23302e6886704358230..a2761f271853024a2833d33c92880d2ee54e5ac4 100644 (file)
@@ -9,9 +9,9 @@ class workstartup extends plugin
   /* Generic terminal attributes */
   var $bootmode             = "G";
   var $goLdapServerList     = array();
-  var $gotoBootKernel       = "default";
+  var $gotoBootKernel       = "default-inherited";
   var $gotoKernelParameters = "";
-  var $gotoLdapServer       = "default";
+  var $gotoLdapServer       = "default-inherited";
   var $gotoModules          = array();
   var $gotoAutoFs           = array();
   var $gotoFilesystem       = array();
@@ -263,7 +263,7 @@ class workstartup extends plugin
     $this->orig_dn= $this->dn;
 
     /* Handle inheritance value "default" */
-    $this->gotoBootKernels= array("%default%" => '['._("inherited").']');
+    $this->gotoBootKernels= array("default-inherited" => '['._("inherited").']');
 
 
     /* Load hardware list */
@@ -281,11 +281,11 @@ class workstartup extends plugin
 
         switch ($name){
           case 'gotoLdapServer':
-            $this->goLdapServerList= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList);
+            $this->goLdapServerList= array_merge(array('default-inherited' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList);
             break;
 
           case 'gotoBootKernel':
-            $this->gotoBootKernels['%default%']=  _("inherited").' ['.$attrs[$name][0].']' ;
+            $this->gotoBootKernels['default-inherited']=  _("inherited").' ['.$attrs[$name][0].']' ;
             break;
 
           case 'FAIclass':
@@ -309,12 +309,19 @@ class workstartup extends plugin
         $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));
+
+          $name= $value = $buffer;
+
+          if(preg_match("/:/",$buffer)){
+            $name  = preg_replace("/:.*$/","",$buffer);
+            $value = preg_replace("/^.*:/","",$buffer);
+          }
+
           if ($buffer != ""){
-            $this->gotoBootKernels[preg_replace('/:.*$/', '', $buffer)]= $buffer;
+            $this->gotoBootKernels[$name]= $value;
           }
         }
         pclose($fh);
@@ -966,11 +973,11 @@ class workstartup extends plugin
     }
 
     /* Strip out 'default' values */
-    if ($this->attrs['gotoLdapServer'] == "default"){
+    if ($this->attrs['gotoLdapServer'] == "default-inherited"){
       $this->attrs['gotoLdapServer']= array();
     }
 
-    if (($this->attrs['gotoBootKernel'] == "default") || ($this->attrs['gotoBootKernel'] == "%default%")){
+    if (($this->attrs['gotoBootKernel'] == "default-inherited") || ($this->attrs['gotoBootKernel'] == "%default%")){
       $this->attrs['gotoBootKernel']= array();
     }