Code

(groupware) repaired deletion of forewarding address.
authorhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Oct 2010 13:06:03 +0000 (13:06 +0000)
committerhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Oct 2010 13:06:03 +0000 (13:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20045 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/class_Groupware.inc
gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc

index 56422ba679ccf0d15e5637358b53b3bd768a485d..2f99b1cb73c4a4f78af66a12c0a56a27b6fa614c 100644 (file)
@@ -225,7 +225,6 @@ class Groupware extends plugin
         $this->vacationStop= date('d.m.Y', $this->vacationStop);
     }
 
-
     /*! \brief  Generates the HTML user interface for the groupware plugin
      *           and take of several ui actions like adding or removing 
      *           forward addresses, filters and the account itself.
@@ -786,8 +785,10 @@ class Groupware extends plugin
                }
                // Save forwardingAddresses
                if($this->isFeatureEnabled("forwardingAddresses") && $this->hasFeaturebeenChanged("forwardingAddresses")){
-                       if(!empty($this->forwardingAddresses) 
-                                       && isset($this->forwardingAddresses) 
+                       if(empty($this->forwardingAddresses)){
+                               $this->groupwareDao->save("forwardingAddresses", $this->uid, array(array()));
+                       }
+                       if(             isset($this->forwardingAddresses) 
                                        && is_array($this->forwardingAddresses)){
                                        
                                        // Only the first Address will be set as forward Address.
@@ -795,6 +796,7 @@ class Groupware extends plugin
                                        $fw[$this->forwardingAddresses[0]] = true;
                                        $this->groupwareDao->save("forwardingAddresses", $this->uid, array($fw));
                        }
+                       
                }
                //Save quota
                if( ($this->isFeatureEnabled("mailBoxWarnLimit") ||
@@ -843,7 +845,6 @@ class Groupware extends plugin
         if(!tests::is_email ($this->mailAddress)){
             $messages[] = msgPool::invalid(_("Mail address"),$this->mailAddress , "", "user@exdom.intranet.gonicus.de knibbel");
         }
-
         if(isset($this->forwardingAddresses) && is_array($this->forwardingAddresses)){
             foreach($this->forwardingAddresses as $fAddress){
                 if(!tests::is_email ($fAddress)){
index 287baff8bb60b83b4a3c3017e5f7a0f5b0864f3a..5b080a1bcf22ba263c0fac44cf5539bbc3e23bf3 100644 (file)
@@ -173,7 +173,7 @@ class GroupwareDao{
         if($this->groupwarePluginRef->isFeatureEnabled("forwardingAddresses")){
                $FWaddresses = $this->get("forwardingAddresses", array($uid));          
             if($FWaddresses) {
-                $resultArr["forwardingAddresses"] = key($FWaddresses);
+                $resultArr["forwardingAddresses"] = array(key($FWaddresses));
             }
         }