Code

Removed inherit from boot kernel options, if this object isn't member in an objectGroup
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Aug 2006 06:38:44 +0000 (06:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Aug 2006 06:38:44 +0000 (06:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4478 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_terminalStartup.inc
plugins/admin/systems/class_workstationStartup.inc

index fab6d1d1a46d5b4b10acc776806d7933c74efe34..c7bafb9c2beabb8c4980721ea4d3536660662774 100644 (file)
@@ -9,7 +9,7 @@ class termstartup extends plugin
   /* Generic terminal attributes */
   var $bootmode= "G";
   var $goLdapServerList= array();
-  var $gotoBootKernel= "default-inherit";
+  var $gotoBootKernel= "";
   var $gotoKernelParameters= "";
   var $gotoLdapServer= "";
   var $gotoModules= array();
@@ -36,8 +36,6 @@ class termstartup extends plugin
   {
     plugin::plugin ($config, $dn);
 
-    $this->gotoBootKernels = array("default-inherit"=>"["._("inherited")."]");
-
     /* Get arrays */
     foreach (array("gotoModules") as $val){
       if (isset($this->attrs["$val"]["count"])){
@@ -108,6 +106,9 @@ class termstartup extends plugin
             }else{
               $this->gotoBootKernels[$name]= $value;
             }
+            if(empty($this->gotoBootKernel)){
+              $this->gotoBootKernel = $name; 
+            }
           }
         }
         pclose($fh);
@@ -128,7 +129,7 @@ class termstartup extends plugin
     $ldap->cd($this->config->current['BASE']);
     $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
     if ($ldap->count() == 1){
-      $map= array("gotoLdapServer");
+      $map= array("gotoLdapServer","gotoBootKernel");
       $attrs= $ldap->fetch();
 
       foreach ($map as $name){
@@ -140,6 +141,9 @@ class termstartup extends plugin
           case 'gotoLdapServer':
             $this->goLdapServerList= array_merge(array('default-inherit' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList);
             break;
+          case 'gotoBootKernel':
+            $this->gotoBootKernels= array_merge(array('default-inherit' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList);
+            break;
         }
       }
     }
index b9b5d1ec9e536f830462ce25ce322b8ccda54948..9c9087eb89fdfbfa601778df6caed0551e1c167f 100644 (file)
@@ -9,7 +9,7 @@ class workstartup extends plugin
   /* Generic terminal attributes */
   var $bootmode             = "G";
   var $goLdapServerList     = array();
-  var $gotoBootKernel       = "default-inherited";
+  var $gotoBootKernel       = "";
   var $gotoKernelParameters = "";
   var $gotoLdapServer       = "default-inherited";
   var $gotoModules          = array();
@@ -269,7 +269,7 @@ class workstartup extends plugin
     $this->orig_dn= $this->dn;
 
     /* Handle inheritance value "default" */
-    $this->gotoBootKernels= array("default-inherited" => '['._("inherited").']');
+    $this->gotoBootKernels= array();
 
 
     /* Load hardware list */
@@ -316,6 +316,7 @@ class workstartup extends plugin
             get_class($this));
       } else {
         
+        $first = false; 
         $fh= popen($command, "r");
         while (!feof($fh)) {
           $buffer= trim(fgets($fh, 256));
@@ -323,7 +324,6 @@ class workstartup extends plugin
           if(!empty($buffer)){
 
             $name=$value = $buffer;
-
             if(preg_match("/:/",$buffer)){
               $name = preg_replace("/:.*$/","",$buffer);
               $value= preg_replace("/^.*:/","",$buffer);
@@ -331,6 +331,10 @@ class workstartup extends plugin
             }else{
               $this->gotoBootKernels[$name]= $value;
             }
+            if($this->gotoBootKernel =="" ){
+              $this->gotoBootKernel = $name;
+            }
+
           }
         }
         pclose($fh);