From: hickert Date: Tue, 19 Apr 2011 10:23:30 +0000 (+0000) Subject: Fixed problem with fetching config items X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=88bd7f4e3137eecd5a8fec8cfe91e833fb0fdd1f;p=gosa.git Fixed problem with fetching config items git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20745 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index 21ffe2454..f30ae5d95 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -226,7 +226,11 @@ class newConfigManagement extends plugin // Request all config items for the selected release via rpc. $rpc = $this->config->getRpcHandle(); - $res = $rpc->listConfigItems($data['name']); + + $rPath = $this->getReleasePath($path); + $dPath = $this->getDistributionPath($path); + $releasePath = preg_replace("/^".preg_quote($dPath, '/')."\/?/", "", $rPath); + $res = $rpc->listConfigItems($releasePath); if(!$rpc->success()){ msg_dialog::display(_("Error"),sprintf(_("Failed to load distributions: %s"),$rpc->get_error()),ERROR_DIALOG); }else{ @@ -575,7 +579,24 @@ class newConfigManagement extends plugin } return(NULL); } - + + + /*! \brief Extracts the distribution path out of a path. + * e.g. /root/debian/squeeze/test/module -> /root/debian + */ + function getDistributionPath($fullPath) + { + $fullPath.='/'; + while(preg_match("/\//", $fullPath)){ + $fullPath = preg_replace("/\/[^\/]*$/","", $fullPath); + $item = $this->dataModel->getItemByPath($fullPath); + if($item['type'] == 'Distribution'){ + return($fullPath); + } + } + return(NULL); + } + function saveItemChanges() {