From c07e1f0ebdc3adfcb6aaa83434bd660340a53bca Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 19 Apr 2011 10:25:48 +0000 Subject: [PATCH] Updated release part detection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20746 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_newConfigManagement.inc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index f30ae5d95..2b9234627 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -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() -- 2.30.2