Code

Moved default release detection into constructor
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Jan 2010 15:36:29 +0000 (15:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Jan 2010 15:36:29 +0000 (15:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15091 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiManagement.inc

index e70b5ba9ca9c5e899426ed4ba0a4c53397bb7dc9..1719e82c3c599acca4263b48117057f5aa8afb50 100644 (file)
@@ -61,7 +61,13 @@ class faiManagement extends management
     }
 
     $this->fai_base = get_ou("faiBaseRDN").$this->config->current['BASE'];
-    $this->fai_release = $this->fai_base;
+    $cfg_rel = $this->config->search("faiManagement","DEFAULTFAIRELEASE",array("menu"));
+    if(!empty($cfg_rel)){
+      $this->fai_release = $cfg_rel;
+    }else{
+      $this->fai_release = $this->fai_base;
+    }
+
     $this->acl_base = $this->config->current['BASE'];
     $this->ui = $ui;
     $this->storagePoints = array(
@@ -825,16 +831,9 @@ class faiManagement extends management
 
     $ldap = $this->config->get_ldap_link();
     $ldap->ls("(objectClass=FAIbranch)",$base,array("ou","FAIstate"));
-    $cfg_rel = $this->config->search("faiManagement","DEFAULTFAIRELEASE",array("menu"));
 
     while($release = $ldap->fetch()){
       $list[$release['dn']] = $prefix.$release['ou'][0];
-
-      // Preset to prefered releaes if necessary  
-      if(empty($this->fai_release) && $cfg_rel == $release['dn']){
-        $this->fai_release = $release['dn'];
-      }
-
       $list = array_merge($list,$this->getReleaseList($release['dn'],$prefix."&nbsp; "));
     }
     return($list);