Code

A little bit better.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Oct 2005 09:41:54 +0000 (09:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Oct 2005 09:41:54 +0000 (09:41 +0000)
Check for partition table entries.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1581 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index f9548a12c6657a4bb99e2be759f3da5c2ac758c2..b994a16c5eb57960260bd7df5516e0540ca23a71 100644 (file)
@@ -192,11 +192,26 @@ class workstartup extends plugin
     }
 
     /* FAI class management */
-    
     if((isset($_POST['AddClass']))&&(isset($_POST['FAIclassesSel']))){
-      $this->FAIclass[$_POST['FAIclassesSel']]=$_POST['FAIclassesSel'];
-    }
 
+      $found = 0 ; 
+
+      foreach($this->FAIclass as $name){
+        if(isset($this->FAIclassInfo[$name])){
+          foreach($this->FAIclassInfo[$name] as $atr){
+            if($atr['obj'] == "FAIpartitionTable"){
+              $found ++ ; 
+            }
+          }
+        }
+      }
+
+      if((isset($this->FAIclassInfo[$_POST['FAIclassesSel']]['FAIpackageList']))&&($found>0)){
+        print_red(_("There is already a profile in your selection that contain partition table configuratons."));
+      }else{
+        $this->FAIclass[$_POST['FAIclassesSel']]=$_POST['FAIclassesSel'];
+      }
+    }
 
     if((isset($_POST['DelClass']))&&(isset($_POST['FAIclassSel']))){
       if(isset($this->FAIclass[$_POST['FAIclassSel']])){
@@ -204,15 +219,6 @@ class workstartup extends plugin
       }
     }
 
-
-
-
-
-
-
-
-
-
     /* Show main page */
     $smarty= get_smarty();
 
@@ -397,9 +403,20 @@ class workstartup extends plugin
     foreach($this->FAIclass as $class){
       $tmp[] = $class;
     }
-    $this->FAIclass = $tmp;
+    $this->attrs['FAIclass'] = $tmp;
     /* Write back to ldap */
-    
+   
+    if(count($this->attrs['FAIclass'])==0){
+      $tmp = array();
+      foreach($this->attrs['objectClass'] as $class){
+        if($class != "FAIobject"){
+          $tmp[] = $class;
+        }
+      }
+      $this->attrs['objectClass'] = $tmp;
+      $this->attrs['FAIclass'] = array();;
+    }
 
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->dn);
index 3c0bd3edfbb0be8fd1f0624d352497c9228a206e..2fcb2918c1990d98e4639c5366ed7b4ff4a1a228 100644 (file)
@@ -33,7 +33,7 @@
   
   <td style="vertical-align:top;">
     {t}Assigned FAI classes{/t}<br>
-               <select name="FAIclassSel" {$FAIclassACL} multiple style="width:200px;height:50px;">
+               <select name="FAIclassSel" {$FAIclassACL} multiple style="width:280px;height:100px;">
         {html_options values=$FAIclass output=$FAIclassKeys}
         <option disabled>&nbsp;</option>
                </select>