Code

Added Mirror selection for FAIclasses
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 18 Oct 2005 09:21:33 +0000 (09:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 18 Oct 2005 09:21:33 +0000 (09:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1602 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 418c3abe57aa20adeeb80e92814f38d430f3872f..e6b46ca26e9efb2d8ec0205cd0d43e8555a716ff 100644 (file)
@@ -17,13 +17,14 @@ class workstartup extends plugin
   var $gotoFilesystem= array();
   var $gotoTerminalPath= "";
   var $FAIstatus= "";
-  var $FAIclass     = array();
-  var $FAIclasses   = array();
-  var $FAIclassInfo = array();
+  var $FAIclass         = array();
+  var $FAIclasses       = array();
+  var $FAIclassInfo     = array();
+  var $FAIdebianMirror  = array();
 
 
   /* attribute list for save action */
-  var $attributes= array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "FAIclass", "FAIstatus", "gotoShare");
+  var $attributes= array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "FAIclass", "FAIstatus", "gotoShare","FAIdebianMirror");
   var $objectclasses= array("GOhard", "FAIobject");
 
   /* Share */
@@ -36,11 +37,27 @@ class workstartup extends plugin
   var $customParameters= "";
   var $orig_dn= "";
   var $ignore_account= TRUE;
+  var $FAIdebianMirrors = array();
 
   function workstartup ($config, $dn= NULL)
   {
     plugin::plugin ($config, $dn);
-
+    
+    // Create Mirror 
+    $this->FAIdebianMirrors=array();
+    $path = "/etc/gosa/fai/";
+    $suffix = "http://";
+    if(is_readable($path)){
+      $od= opendir($path);
+      if($od){
+        while($dir = readdir($od)){
+          if((is_dir($path.$dir))&&($dir[0]!=".")){
+            $this->FAIdebianMirrors[$suffix.$dir]=$suffix.$dir;
+          }
+        }
+      }
+    }
+    
     /* Get arrays */
     foreach (array("gotoModules", "gotoAutoFs", "gotoFilesystem") as $val){
       if (isset($this->attrs["$val"]["count"])){
@@ -85,19 +102,6 @@ class workstartup extends plugin
 
     $this->gotoShareSelections= $config->getShareList(true);
     $this->gotoAvailableShares= $config->getShareList(false);
-/*
-    $tmp = array();
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cd($this->config->current['BASE']);
-    $ldap->search("(objectClass=FAIclass)",array("cn"));
-    while($attr = $ldap->fetch()){
-      $this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
-      $base =  "ou=fai,".preg_replace("/^.*ou=fai,/","",$attr['dn']);
-      $cn   = $attr['cn'][0];
-      $tmp[$cn] = $base;
-    }
-
-*/
     $tmp2 = array();
   
     //$ldap->cd($base);
@@ -276,11 +280,12 @@ class workstartup extends plugin
     }
 
     /* Values */
-    foreach(array("gotoBootKernel", "customParameters", "gotoShare","FAIclasses","FAIclass") as $val){
+    foreach(array("gotoBootKernel", "customParameters", "gotoShare","FAIclasses","FAIclass","FAIdebianMirror") as $val){
       $smarty->assign($val, $this->$val);
       $smarty->assign($val."ACL", chkacl($this->acl, $val));
     }
-   
+  
+    $smarty->assign("FAIdebianMirrors",$this->FAIdebianMirrors);
     
     $smarty->assign("FAIclasses",$this->selectFriendlyClasses());
     $smarty->assign("FAIclassesKeys",array_flip($this->selectFriendlyClasses()));
@@ -428,7 +433,6 @@ class workstartup extends plugin
       $this->attrs['objectClass'] = $tmp;
       $this->attrs['FAIclass'] = array();;
     }
 
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->dn);
index 128d66bf4dcd95df2683fa58c5e762168616de52..7c463a0b18df42ef795181661c106db6f0564c31 100644 (file)
      &nbsp;
   </td>
   
-  <td style="vertical-align:top;"><h2><img alt="" align="middle" src="images/fai_profile.png">&nbsp;{t}Assigned FAI classes{/t}</h2>
+  <td style="vertical-align:top;">
+       <h2><img alt="" align="middle" src="images/fai_profile.png">&nbsp;{t}FAI server{/t}</h2>
+               <select name="FAIdebianMirror" {$FAIdebianMirrorACL}>
+        {html_options options=$FAIdebianMirrors output=$FAIdebianMirrors selected=$FAIdebianMirror}
+        <option disabled>&nbsp;</option>
+               </select>       
+
+       <h2><img alt="" align="middle" src="images/fai_profile.png">&nbsp;{t}Assigned FAI classes{/t}</h2>
                <select name="FAIclassSel" {$FAIclassACL} multiple style="width:100%;height:100px;">
         {html_options values=$FAIclass output=$FAIclassKeys}
         <option disabled>&nbsp;</option>
                </select>       
+
     <br>
                <select name="FAIclassesSel" {$FAIclassACL}>
         {html_options values=$FAIclassesKeys output=$FAIclasses}