summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa1a5ae)
raw | patch | inline | side by side (parent: fa1a5ae)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 19 May 2011 07:00:22 +0000 (07:00 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 19 May 2011 07:00:22 +0000 (07:00 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20870 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/DeviceConfig-list.xml b/gosa-plugins/goto-ng/admin/newConfigManagement/DeviceConfig-list.xml
index 883cfb1dcb5b860ea6fe324af0eb6975064f6836..d3a1b6ec2540650a986fe7c1960c7775826874c4 100644 (file)
<name>remove</name>
<type>entry</type>
<image>images/lists/trash.png</image>
- <acl>ConfigManagement/cfgItem[w]</acl>
+ <acl>ConfigManagement/ConfigManagement[createFAICD:w]</acl>
<label>Remove item</label>
</action>
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagement.inc
index a54591923ac71724427f05a1b895e65c46506e8b..b474d4ece18718c502f6ab782426b34543e8d8fe 100644 (file)
function openEntry($ids)
{
$id = $ids[0];
- $item = $this->dataModel->getItemById($id);
+ $item = $this->dataModel->getItemByDn($id);
$this->setCurrentContainer($item['path']);
return;
}
function removeEntry($ids)
{
foreach($ids as $id){
- $item = $this->dataModel->getItemById($id);
+ $item = $this->dataModel->getItemByDn($id);
// Is an config item.
if($this->cfgItemMap[$item['type']] != 'root'){
*/
function editEntry($ids)
{
- $item = $this->dataModel->getItemById($ids[0]);
+ $item = $this->dataModel->getItemByDn($ids[0]);
+
+ if(!$item) return;
+
$release = $this->getReleasePart($item['path']);
$path = $this->getItemPath($item['path']);
$method = $this->cfgItemMap[$item['type']];
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc
index d50b3f71b8ce414d8261687a4795588f7fa71ee3..d73e35f06d0227c2b6ff655294e20fe0d6d9ac9e 100644 (file)
public $data = array();
public $typeToPath = array();
public $idToPath = array();
+ public $dnToPath = array();
function __construct()
{
$toParentPath = preg_replace("/\/[^\/]*$/","", $to);
$parentTo = &$this->data['linear'][$toParentPath];
$parentToDn = $parentTo['dn'];
+ $dn = rtrim("cn={$name},{$parentToDn}",',');
// Append the 'from' entry to the 'to' parent children.
$parentTo['children'][$to] = $parentFrom['children'][$from];
$parentTo['children'][$to]['path']= $to;
$parentTo['children'][$to]['name']= $name;
- $parentTo['children'][$to]['dn']= rtrim("cn={$name},{$parentToDn}",',');
+ $parentTo['children'][$to]['dn']= $dn;
// Unset the source path
unset($parentFrom['children'][$from]);
// Update id->Path mapping
$id = $this->data['linear'][$to]['id'];
$this->idToPath[$id] = $to;
+ $this->dnToPath[$dn] = $to;
}
$this->data['linear'][$entryPath] = &$parentItem[$entryPath];
$this->idToPath[$entryId] = $entryPath;
+ $this->idToPath[$entryDn] = $entryPath;
$this->typeToPath[$type][$name] = $entryPath;
return($entryId);
}
return(NULL);
}
+
+ function getItemByDn($dn)
+ {
+ $path = NULL;
+ if(isset($this->dnToPath[$dn])){
+ $path = $this->dnToPath[$dn];
+ }else{
+ return(NULL);
+ }
+ if(isset($this->data['linear'][$path])){
+ return($this->data['linear'][$path]);
+ }
+ return(NULL);
+ }
}
?>
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_filterConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_filterConfigManagement.inc
index db43ea525fc1a6dde4b86c7defc06ef770c2fb64..fce191f9313b58a181f3d2060e12aadf50a14479 100644 (file)
$ret = array();
if($data['path'] != "/root"){
$back = array();
- $back['dn'] = $data['id'];
+ $back['dn'] = $data['dn'];
$back[] = 'dn';
$back['cn'] = array('.', 'count' => 1);
$back[] = 'cn';
{
if(preg_match("/".$filter."/",$item['name'])){
$entry = array();
- $entry['dn'] = $item['id'];
+ $entry['dn'] = $item['dn'];
$entry[] = 'dn';
$entry['cn'] = array($item['name'], 'count' => 1);
$entry[] = 'cn';