Code

Updated release part detection
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Apr 2011 10:25:48 +0000 (10:25 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Apr 2011 10:25:48 +0000 (10:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20746 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc

index f30ae5d95960a8e1b8d6f1ee17423010d122f7a9..2b92346270e932a952ff6b6fead2b49751747f86 100644 (file)
@@ -226,10 +226,7 @@ class newConfigManagement extends plugin
 
                 // Request all config items for the selected release via rpc.
                 $rpc = $this->config->getRpcHandle();
-
-                $rPath = $this->getReleasePath($path);
-                $dPath = $this->getDistributionPath($path);
-                $releasePath = preg_replace("/^".preg_quote($dPath, '/')."\/?/", "", $rPath);
+                $releasePath = $this->getReleasePart($path);
                 $res = $rpc->listConfigItems($releasePath);
                 if(!$rpc->success()){
                     msg_dialog::display(_("Error"),sprintf(_("Failed to load distributions: %s"),$rpc->get_error()),ERROR_DIALOG);
@@ -596,6 +593,17 @@ class newConfigManagement extends plugin
         }
         return(NULL);
     }
+
+    
+    /*! \brief  Extracts the release-part out of a path.
+     *          e.g. /root/debian/squeeze/test/module -> squeeze/test
+     */
+    function getReleasePart($path)
+    {
+        $rPath = $this->getReleasePath($path);
+        $dPath = $this->getDistributionPath($path);
+        return(preg_replace("/^".preg_quote($dPath, '/')."\/?/", "", $rPath));
+    }
  
  
     function saveItemChanges()