Code

Fixed release detection for new package lists.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 Apr 2008 12:13:57 +0000 (12:13 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 Apr 2008 12:13:57 +0000 (12:13 +0000)
-If no release was selected in the faiManagement dialog, newly create packagelist were initialized correctly.

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

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

index ce57d6de68100023c485ce11d628922bcd965f82..c79079334a42f6fa7d12d97f5b6a452fe19318fd 100644 (file)
@@ -177,14 +177,14 @@ class faiPackage extends plugin
 
       /* Assemble release name */
       $release = $this->parent->parent->fai_release;
-      $tmp= preg_replace('/,'.normalizePreg(get_ou('faiou')).'.*$/', '', $release);
+      $tmp= preg_replace('/[,]*'.normalizePreg(get_ou('faiou')).'.*$/', '', $release);
       $tmp= preg_replace('/ou=/', '', $tmp);
       $rev= array_reverse(split(',', $tmp));
-      $this->FAIdebianRelease= "";
+      $this->FAIdebianRelease= "/";
       foreach ($rev as $part){
         $this->FAIdebianRelease.= "/$part";
       }
-      $this->FAIdebianRelease= preg_replace('#^/#', '', $this->FAIdebianRelease);
+      $this->FAIdebianRelease= preg_replace('#^[/]*#', '', $this->FAIdebianRelease);
 
       /* Assemble sections */
       $repos= $this->getServerInfos();
@@ -196,7 +196,7 @@ class faiPackage extends plugin
       /* Assign Repository settings*/ 
       $this->is_account     = true;
     }
-    
+  
 
     /******
      * Add && Remove Packages