From 79cfbb472af41af9c6a7eb62d39d11191f41dcff Mon Sep 17 00:00:00 2001 From: hzerres Date: Mon, 22 Nov 2010 14:55:05 +0000 Subject: [PATCH] (groupware) repaired forwarding addresses. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20323 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/groupware/class_Groupware.inc | 24 +++++++++++++------ .../personal/groupware/class_GroupwareDao.inc | 6 ++++- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc index f3078002a..ebb823412 100644 --- a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc @@ -835,10 +835,14 @@ class Groupware extends plugin // Save alternateAddresses if($this->isFeatureEnabled("alternateAddresses")&& $this->hasFeaturebeenChanged("alternateAddresses")){ - if(!empty($this->alternateAddresses) - && isset($this->alternateAddresses) - && is_array($this->alternateAddresses)){ - $res = $this->groupwareDao->save("alternateAddresses", $this->uid, array($this->alternateAddresses)); + if(isset($this->alternateAddresses) && is_array($this->alternateAddresses)){ + if(!empty($this->alternateAddresses)){ + $res = $this->groupwareDao->save("alternateAddresses", $this->uid, array($this->alternateAddresses)); + } + else{ + echo "deleting AltAddresses."; + $res = $this->groupwareDao->save("alternateAddresses", $this->uid, array(array())); + } if($res === NULL){ $message = _("Saving alternate addresses failed!"); msg_dialog::display(_("Error"),$message."
".sprintf(_("Error was: '%s'."),$this->rpcErrorMessage),ERROR_DIALOG); @@ -851,9 +855,15 @@ class Groupware extends plugin // Transform simple address array into, $addresses[address] = ForwardFlag; $addresses = array(); - foreach($this->forwardingAddresses as $address) $addresses[$address] = TRUE; - - $res = $this->groupwareDao->save("forwardingAddresses", $this->uid, array($addresses)); + if(!empty($this->forwardingAddresses)){ + foreach($this->forwardingAddresses as $address) $addresses[$address] = TRUE; + + $res = $this->groupwareDao->save("forwardingAddresses", $this->uid, array($addresses)); + } + else{ + $res = $this->groupwareDao->save("forwardingAddresses", $this->uid, array(array())); + } + if($res === NULL){ $message = _("Saving forward addresses failed!"); msg_dialog::display(_("Error"),$message."
".sprintf(_("Error was: '%s'."),$this->rpcErrorMessage),ERROR_DIALOG); diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc index 3bebc00a6..965885324 100644 --- a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc +++ b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc @@ -108,11 +108,15 @@ class GroupwareDao{ $valueArray = array($function, $uid, $valueArray); } else{ + //omit otherwise $valueArray = array($function, $uid); } } - + //TODO: Remove the debug output + //echo "----call_user_func_array:
";
+		//var_dump($valueArray);
+		//echo "
"; $result = call_user_func_array(array($this->groupwarePluginRef, 'rpcExec'), $valueArray); return $result; } -- 2.30.2