From 5a0a77e21adce90dc4e28fbf5497645c9ecf801a Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 5 May 2010 08:27:27 +0000 Subject: [PATCH] Updated core plugin and config registry git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18069 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_configRegistry.inc | 31 +++++++++++----------- gosa-core/include/class_core.inc | 10 ------- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc index c3f2ddbd9..7520310d7 100644 --- a/gosa-core/include/class_configRegistry.inc +++ b/gosa-core/include/class_configRegistry.inc @@ -208,8 +208,15 @@ class gosaProperty if(isset($data[$aName])){ $this->$aName = $data[$aName]; } - } + } + // Initialize with the current value + $this->_restoreCurrentValue(); + } + + private function _restoreCurrentValue() + { + // First check for values in the LDAP Database. if(isset($this->parent->ldapStoredProperties[$this->class][$this->name])){ $this->setStatus('ldap'); @@ -250,7 +257,11 @@ class gosaProperty function restoreDefault() { - $this->setStatus('removed'); + if(in_array($this->getStatus(),array('ldap'))){ + $this->setStatus('removed'); + }elseif(in_array($this->getStatus(),array('modified'))){ + $this->_restoreCurrentValue(); + } } function save() @@ -301,7 +312,7 @@ class gosaProperty $dn = "cn={$this->class},".$this->parent->config->current['CONFIG']; $ldap->cat($dn); $attrs = $ldap->fetch(); - $data = array(); + $data = array('gosaSetting' => array()); for($i = 0;$i<$attrs['gosaSetting']['count']; $i ++){ $set = $attrs['gosaSetting'][$i]; if(preg_match("/^{$this->name}:/", $set)){ @@ -312,19 +323,7 @@ class gosaProperty $ldap->cd($dn); $ldap->modify($data); if($ldap->success()){ - $this->status = 'undefined'; - - // Second check for values in the config file. - if(isset($this->parent->fileStoredProperties[$this->class][$this->name])){ - $this->setStatus('file'); - $this->value = $this->parent->fileStoredProperties[$this->class][$this->name]; - } - - // If there still wasn't found anything then fallback to the default. - if($this->getStatus() == 'undefined'){ - $this->value = $this->getDefault(); - } - + $this->_restoreCurrentValue(); }else{ echo $ldap->get_error(); } diff --git a/gosa-core/include/class_core.inc b/gosa-core/include/class_core.inc index 11804369f..ec6e97e6f 100644 --- a/gosa-core/include/class_core.inc +++ b/gosa-core/include/class_core.inc @@ -350,16 +350,6 @@ class core extends plugin { "group" => "core", "mandatory" => FALSE), - array( - "name" => "sudoRDN", - "type" => "string", - "default" => "", - "description" => "", - "check" => "", - "migrate" => "", - "group" => "core", - "mandatory" => FALSE), - array( "name" => "gosaSupportURI", "type" => "string", -- 2.30.2