summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e183de3)
raw | patch | inline | side by side (parent: e183de3)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 21 Apr 2011 08:27:48 +0000 (08:27 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 21 Apr 2011 08:27:48 +0000 (08:27 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20763 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc | patch | blob | history |
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc
index 862b096f0172a9699f85b26851328a15d0bf908c..d703db5c1fbb96a80baa627af246a3e4b8ea163d 100644 (file)
// Is an config item.
if($this->cfgItemMap[$item['type']] != 'root'){
- $release = preg_replace("/^.*\//","", $this->getReleasePath($item['path']));
+ $release = $this->getReleasePart($item['path']);
$path = $this->getItemPath($item['path']);
-
$rpc = $this->config->getRpcHandle();
$rpc->removeConfigItem($release, $path);
if(!$rpc->success()){
$this->dataModel->removeItem($item['path']);
}
}else{
- echo $item['type']." - are not handled yet!";
+
+ // Remove distribution
+ if($item['type'] == 'Distribution'){
+
+ $dist = $this->getDistributionPart($item['path']);
+ $rpc = $this->config->getRpcHandle();
+ $rpc->removeDistribution($dist, array('recursive' => TRUE));
+ echo "Removing distribution '{$dist}'";
+ if(!$rpc->success()){
+ msg_dialog::display(_("Error"), sprintf(_("Failed to remove the distribution: %s. Error was: %s"),
+ $dist, $rpc->get_error()), ERROR_DIALOG);
+ return(NULL);
+ }else{
+ $this->dataModel->removeItem($item['path']);
+ }
+ }elseif($item['type'] == 'Release'){
+
+ // Remove release
+ $release = preg_replace("/^.*\//","", $this->getReleasePart($item['path']));
+ $rpc = $this->config->getRpcHandle();
+ $rpc->removeRelease($release, TRUE);
+ echo "Removing release '{$release}'";
+ if(!$rpc->success()){
+ msg_dialog::display(_("Error"), sprintf(_("Failed to remove the release: %s. Error was: %s"),
+ $release, $rpc->get_error()),ERROR_DIALOG);
+ return(NULL);
+ }else{
+ $this->dataModel->removeItem($item['path']);
+ }
+
+ }else{
+ echo $item['type']." - are not handled yet!";
+ }
}
}
}
return(NULL);
}
+
+ /*! \brief Extracts the distribution-part out of a path.
+ * e.g. /root/debian/squeeze/test/module -> debian
+ */
+ function getDistributionPart($fullPath)
+ {
+ return(trim(preg_replace("#^/root/#","", $this->getDistributionPath($fullPath)), '/'));
+ }
+
/*! \brief Extracts the release-part out of a path.
* e.g. /root/debian/squeeze/test/module -> squeeze/test