From 1db0b97da9754b21d1c7ea34d99cb86c5b25de4f Mon Sep 17 00:00:00 2001 From: hzerres Date: Thu, 14 Oct 2010 13:06:03 +0000 Subject: [PATCH] (groupware) repaired deletion of forewarding address. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20045 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../groupware/personal/groupware/class_Groupware.inc | 9 +++++---- .../groupware/personal/groupware/class_GroupwareDao.inc | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc index 56422ba67..2f99b1cb7 100644 --- a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc @@ -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)){ diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc index 287baff8b..5b080a1bc 100644 --- a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc +++ b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc @@ -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)); } } -- 2.30.2