summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3e35563)
raw | patch | inline | side by side (parent: 3e35563)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Apr 2011 13:36:19 +0000 (13:36 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 14 Apr 2011 13:36:19 +0000 (13:36 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20735 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 a0d5cf78e3d3e59d98e29c525767f28070072650..608c1344ff5aef2034eef04a919bf1fe76736d57 100644 (file)
}
}
+ function getUsedNamesForPath($path)
+ {
+ $item = $this->dataModel->getItemByPath($path);
+ $names = array();
+ foreach($item['children'] as $path => $data){
+ $names[] = $data['name'];
+ }
+ return($names);
+ }
+
/*! \brief Edits a selected list item.
*/
return;
}
+
+
if($this->cfgItemMap[$type] != 'root'){
// Save template engine modifications
// If this is a new item, then create it now.
if($item == NULL){
+ // Validate item name
+ $usedNames = $this->getUsedNamesForPath($this->selectedContainer);
+ if(in_array($values['name'],$usedNames)){
+ echo 'The name is used';
+ return;
+ }
+
// Add the new item
$rpc = $this->config->getRpcHandle();
$res = $rpc->setConfigItem($release, $newItemPath, $type, $values);
}
}else{
+ // Validate item name
+ if($item['name'] != $values['name']){
+ $usedNames = $this->getUsedNamesForPath($this->selectedContainer);
+ if(in_array($values['name'],$usedNames)){
+ echo 'The name is used';
+ return;
+ }
+ }
+
// Write the modifications back to the server.
$rpc = $this->config->getRpcHandle();
$res = $rpc->setConfigItem($release, $oldItemPath, $type, $values);