summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0fc5d06)
raw | patch | inline | side by side (parent: 0fc5d06)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 May 2010 08:27:27 +0000 (08:27 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 May 2010 08:27:27 +0000 (08:27 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18069 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_configRegistry.inc | patch | blob | history | |
gosa-core/include/class_core.inc | patch | blob | history |
diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc
index c3f2ddbd977b97aea5b939a10bfa9d58dbd2b958..7520310d7f0acc3b7555a24c4a83263627bbd260 100644 (file)
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');
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()
$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)){
$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();
}
index 11804369f3f15a793b826837cfc585838db29664..ec6e97e6fbf92bf6b6be4caab9e8404c400a70aa 100644 (file)
"group" => "core",
"mandatory" => FALSE),
- array(
- "name" => "sudoRDN",
- "type" => "string",
- "default" => "",
- "description" => "",
- "check" => "",
- "migrate" => "",
- "group" => "core",
- "mandatory" => FALSE),
-
array(
"name" => "gosaSupportURI",
"type" => "string",