Code

Some FAI funtionality
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 1 Mar 2006 07:14:33 +0000 (07:14 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 1 Mar 2006 07:14:33 +0000 (07:14 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2788 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_workstationStartup.inc

index 6f9d7a22f621deefac14fc938e3538949f429389..11f02446bca237f1a4c5411952e6922efe84e958 100644 (file)
@@ -143,6 +143,7 @@ class workstartup extends plugin
      */
     while($attr = $ldap->fetch()){
       $cn = $attr['cn'][0];
+      $tmp2[$cn]['REST'] = $attr;
       if(in_array('FAIpackageList',$attr['objectClass'])){
         $tmp2[$cn]['FAIpackageList']['obj']   = 'FAIpackageList'; 
         $tmp2[$cn]['FAIpackageList']['kzl']   = 'Pl';
@@ -211,13 +212,26 @@ class workstartup extends plugin
   /* Create array to display available classes/profiles in a selectbox */
   function selectFriendlyClasses(){
     $tmp=array();
+
+    $tmp2 = $this->getFAIreleases();
+    if(!in_array($this->FAIrelease, $tmp2)){  
+      $this->FAIrelease = key($tmp2);
+    }
+
+
     foreach($this->FAIclasses as $class){
+      
+      if(($this->FAIdebianMirror != "auto") && (!preg_match("/ou=".$this->FAIrelease."/",$this->FAIclassInfo[$class]['REST']['dn']))){
+        continue;
+      }
       $str    = "";
       $skip = false;
 
       if(isset($this->FAIclassInfo[$class])){
         foreach($this->FAIclassInfo[$class] as $objs){
-          $str .= $objs['kzl']." "; 
+          if (isset($objs['kzl'])){
+            $str .= $objs['kzl']." "; 
+          }
         }
       }
       $tmp[$class] = $class."&nbsp; [".$str."]";
@@ -276,8 +290,10 @@ class workstartup extends plugin
       foreach($this->FAIclass as $name){
         if(isset($this->FAIclassInfo[$name])){
           foreach($this->FAIclassInfo[$name] as $atr){
-            if($atr['obj'] == "FAIpartitionTable"){
-              $found ++ ; 
+            if(isset($atr['obj'])){
+              if($atr['obj'] == "FAIpartitionTable"){
+                $found ++ ; 
+              }
             }
           }
         }
@@ -497,6 +513,7 @@ class workstartup extends plugin
         }
       }
     }
+
     if(is_array($this->FAIdebianMirrors)){
       foreach($this->FAIdebianMirrors as $mirr=>$sections){
         $allok = true;
@@ -505,6 +522,11 @@ class workstartup extends plugin
             $allok = false;
           }
         }
+        if(count($this->FAIclass)){
+          if(!in_array($this->FAIrelease,$this->FAIreleases[$mirr])){
+            $allok = false; 
+          }
+        }
         if($allok){
           $ret[$mirr]=$mirr;
         }