Code

Added error message, if FAI class is not available.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 Jan 2008 14:23:10 +0000 (14:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 Jan 2008 14:23:10 +0000 (14:23 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8367 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/systems/class_workstationStartup.inc

index 90ba14cc4da3d0a4b936ad9b704e14655e2ba0c8..c74b3761756fbcaf2b61f97a87b7863152e3aa42 100644 (file)
@@ -1097,20 +1097,23 @@ class workstartup extends plugin
       $base = array_search($release,$this->cache['RELEASE_DNS']);
       $this->cache['CLASSES'][$release] = array();
 
-      if(!empty($base)){
-        $filter = "(|(objectClass=FAIpackageList)(objectClass=FAItemplate)(objectClass=FAIvariable)".
-          "(objectClass=FAIscript)(objectClass=FAIhook)(objectClass=FAIprofile)".
-          "(objectClass=FAIpartitionTable))";
-        $list = FAI::get_all_objects_for_given_base($base,$filter,TRUE);
-        foreach($list as $attrs){
-          $info = $this->analyse_fai_object($attrs);
-          if(count($info)){
-            $this->cache['CLASSES'][$release][$attrs['cn'][0]][] = $info;
+      if(class_exists("FAI")){
+        if(!empty($base)){
+          $filter = "(|(objectClass=FAIpackageList)(objectClass=FAItemplate)(objectClass=FAIvariable)".
+            "(objectClass=FAIscript)(objectClass=FAIhook)(objectClass=FAIprofile)".
+            "(objectClass=FAIpartitionTable))";
+          $list = FAI::get_all_objects_for_given_base($base,$filter,TRUE);
+          foreach($list as $attrs){
+            $info = $this->analyse_fai_object($attrs);
+            if(count($info)){
+              $this->cache['CLASSES'][$release][$attrs['cn'][0]][] = $info;
+            }
           }
         }
+      }else{
+        print_red(_("Could not load available classes, the fai extension plugin seems not to be installed."));
       }
 
-
       /* Add object caught from external hook
        */
       $lines= $this->GetHookElements();