From: hickert Date: Wed, 29 Sep 2010 16:00:23 +0000 (+0000) Subject: Updated base handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c355347c5bd88c6b2f501b7898050b5bf2c2b315;p=gosa.git Updated base handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19861 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc index 0bc9d755b..87d317a89 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc @@ -21,6 +21,7 @@ class DeviceConfig extends management public $is_account = FALSE; public $ignore_account = FALSE; + private $baseToDN = array(); /*! \brief Constructs the device configuration plugin * @param Config The GOsa configuration object. @@ -65,6 +66,7 @@ class DeviceConfig extends management // Set current item to 'root', this is the minimum to get things running. $this->addItem($root,'root',array()); $this->setCurrentItem('root'); + $this->setBase($this->baseToDN['root']); $this->addItem('PuppetModule','test1', array( @@ -129,7 +131,7 @@ class DeviceConfig extends management function openEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") { - $this->base = $this->currentItemValues[$target[0]]['base']; + $this->setBase($this->currentItemValues[$target[0]]['base']); } @@ -243,15 +245,19 @@ class DeviceConfig extends management $this->idToName[] = $name; $base = (isset($current['base']))? ",".$current['base'] : ''; + $base = "cn={$name}{$base}"; $new = array( - 'base' => "cn={$name}{$base}", + 'base' => $base, 'children' => array(), 'type' => $type, 'name' => $name, 'values' => $values); $this->currentItemValues[$name] = $new; $current['children'][$name] = &$this->currentItemValues[$name]; + + $this->baseToDN[$name] = $base; + $this->baseToDN[$base] = $name; } @@ -329,9 +335,17 @@ class DeviceConfig extends management // Get selected Items $this->itemContainerSelector->update(); - $this->base = $this->itemContainerSelector->getBase(); + $this->setBase($this->itemContainerSelector->getBase()); + } + + + function setBase($base) + { + $this->base = $base; + $item = $this->currentItemValues[$this->baseToDN[$base]]; } + /*! \brief Forward plugin acls */ function set_acl_base($base)