Code

Fixed FAI assignment in workstation Startup
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 13:38:43 +0000 (13:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 25 Oct 2007 13:38:43 +0000 (13:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7660 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 42f98ee615399ab3d53f7ef19200f0aa80c9decf..6e72439f91a8fb50cb3b7cceaf9bed3a8cebf000 100644 (file)
@@ -59,7 +59,7 @@ class workstartup extends plugin
   var $CopyPasteVars = array("gotoModules","gotoShares");
 
   var $fai_activated = FALSE;
-
+  var $o_group_dn     ="";
   var $member_of_ogroup   = FALSE;
 
   function workstartup (&$config, $dn= NULL, $parent= NULL)
@@ -78,8 +78,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 
@@ -335,6 +339,9 @@ class workstartup extends plugin
       }else{
         $map= array("gotoBootKernel");
       }
+
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cat($this->o_group_dn);
       $attrs= $ldap->fetch();
 
       foreach ($map as $name){
@@ -518,7 +525,6 @@ class workstartup extends plugin
 
   function execute()
   {
-
        /* Call parent execute */
        plugin::execute();
 
index ca5739033616a12837bf93c71da613069ed40938..f68115942273bb9eeda1fc5a6b3e0da88d9c6ff4 100644 (file)
                                        <td>
        {render acl=$FAIdebianMirrorACL}
                                                <select name="FAIdebianMirror"   onchange='document.mainform.submit()'>
-                                                       {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>
        {/render}
                                        </td>