Code

Fixed property removal
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 14 May 2010 12:37:59 +0000 (12:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 14 May 2010 12:37:59 +0000 (12:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18475 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_configRegistry.inc

index d2c71a5946dadc093e145ef78618a49b79bb6d5b..f5b51d861d4d2013664aafc7e286d24808aaf09a 100644 (file)
@@ -418,7 +418,6 @@ class gosaProperty
 
     private function _restoreCurrentValue()
     {
-    
         // First check for values in the LDAP Database.
         if(isset($this->parent->ldapStoredProperties[$this->class][$this->name])){
             $this->setStatus('ldap');
@@ -463,7 +462,7 @@ class gosaProperty
 
     function getValue($temporary = FALSE) 
     { 
-        if($temporary && in_array($this->getStatus(), array('modified'))){
+        if($temporary && in_array($this->getStatus(), array('modified','removed'))){
             return($this->tmp_value); 
         }else{ 
             return($this->value); 
@@ -474,8 +473,13 @@ class gosaProperty
     {
         if(in_array($this->getStatus(),array('ldap'))){
             $this->setStatus('removed'); 
-        }elseif(in_array($this->getStatus(),array('modified'))){
-            $this->_restoreCurrentValue();
+
+            // Second check for values in the config file.
+            if(isset($this->parent->fileStoredProperties[strtolower($this->class)][strtolower($this->name)])){
+                $this->tmp_value = $this->parent->fileStoredProperties[strtolower($this->class)][strtolower($this->name)];
+            }else{
+                $this->tmp_value = $this->getDefault();
+            }
         }
     }