Code

Updated core plugin and config registry
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 May 2010 08:27:27 +0000 (08:27 +0000)
committerhickert <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
gosa-core/include/class_core.inc

index c3f2ddbd977b97aea5b939a10bfa9d58dbd2b958..7520310d7f0acc3b7555a24c4a83263627bbd260 100644 (file)
@@ -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();
             }
index 11804369f3f15a793b826837cfc585838db29664..ec6e97e6fbf92bf6b6be4caab9e8404c400a70aa 100644 (file)
@@ -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",