Code

Fixed problems when selecting inherit FAI settings in workstation startup
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 13:29:12 +0000 (13:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 13:29:12 +0000 (13:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7659 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_workstationStartup.inc
plugins/admin/systems/workstationStartup.tpl

index 8f747beee12eec743348bcd677994913cfffd1d8..610aec2a6712fa37176dac2fbd3177bc40234915 100644 (file)
@@ -53,6 +53,8 @@ class workstartup extends plugin
   var $fai_activated      = FALSE;
   var $member_of_ogroup   = FALSE;
 
+  var $o_group_dn         = "";
+
   function workstartup ($config, $dn= NULL, $parent= NULL)
   {
     /* Cehck if FAI is activated, else do not save any FAI attributes */
@@ -69,8 +71,12 @@ class workstartup extends plugin
     if(!isset($this->parent->by_object['ogroup'])){
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->config->current['BASE']);
-      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn"));
-      $this->member_of_ogroup = $ldap->count() >= 1;
+      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn","dn"));
+      if($ldap->count()){
+        $this->member_of_ogroup = TRUE;
+        $attrs = $ldap->fetch();
+        $this->o_group_dn = $attrs['dn'];
+      }
     }
 
     /* Creating a list of valid Mirrors 
@@ -327,6 +333,8 @@ class workstartup extends plugin
         $map= array("gotoLdapServer","gotoBootKernel");
       }
 
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cat($this->o_group_dn);
       $attrs= $ldap->fetch();
 
       foreach ($map as $name){
@@ -523,7 +531,6 @@ class workstartup extends plugin
 
   function execute()
   {
-
        /* Call parent execute */
        plugin::execute();
 
index 7666e3bb20904b61f52e9ed48a31d99d0f8b7248..9a0951ec36101def841de21f2c4998ce7044b22c 100644 (file)
                        <tr>
                                <td>
                                        <select name="FAIdebianMirror"   onchange='document.mainform.submit()' {$FAIdebianMirrorACL}>
-                                               {html_options options=$FAIdebianMirrors output=$FAIdebianMirrors selected=$FAIdebianMirror}
+                                               {foreach from=$FAIdebianMirrors item=val key=key}
+                                                       {if $val.USE}
+                                                               <option value="{$key}" {if $FAIdebianMirror == $key} selected {/if}>{$val.NAME}</option>
+                                                       {else}
+                                                               <option value="auto" disabled>{$val.NAME}</option>
+                                                       {/if}
+                                               {/foreach}
                                        </select>
                                </td>
                                <td>