From 0464db4899321b401a9fa67bef56a32e60419761 Mon Sep 17 00:00:00 2001 From: hzerres Date: Mon, 13 Sep 2010 09:25:22 +0000 Subject: [PATCH] added checks for "alternateEmail" and "forward Email" git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19616 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/groupware/class_groupware.inc | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/groupware/personal/groupware/class_groupware.inc b/gosa-plugins/groupware/personal/groupware/class_groupware.inc index 181eb9494..4c33d27b2 100644 --- a/gosa-plugins/groupware/personal/groupware/class_groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_groupware.inc @@ -311,7 +311,7 @@ class groupware extends plugin } } } - + $this->check(); /**************** Forward addresses ****************/ @@ -394,6 +394,7 @@ class groupware extends plugin Alternate addresses ****************/ + // Add manually inserted alternate mail address. if (isset($_POST['addAlternateAddress'])){ $valid= FALSE; @@ -461,6 +462,8 @@ class groupware extends plugin $smarty->assign("initFailed", !$this->accountInitialized); $smarty->assign("rpcError", $this->rpcError); $smarty->assign("rpcErrorMessage", $this->rpcErrorMessage); + + return($display.$smarty->fetch(get_template_path("generic.tpl",TRUE,dirname(__FILE__)))); } @@ -688,7 +691,7 @@ class groupware extends plugin msg_dialog::display(_("Error"), _("Groupware account creation failed!"), ERROR_DIALOG); } } - + /* * Trying to save the primary Email Address. */ @@ -731,6 +734,19 @@ class groupware extends plugin if(!tests::is_email ($this->mailAddress)){ $messages[] = msgPool::invalid(_("Email"),$this->mailAddress , "", _("Example: user@excom.intranet.gonicus.de")); } + /* + * forwarding Addresses + * $alternateAddresses + * $forwardingAddresses + */ + if(isset($this->forwardingAddresses) && is_array($this->forwardingAddresses)){ + foreach($this->forwardingAddresses as $fAddress){ + if(!tests::is_email ($fAddress)){ + $messages[] = msgPool::invalid(_("Email"),$fAddress, "", _("Example: user@excom.intranet.gonicus.de")); + } + } + } + return($messages); } @@ -814,7 +830,7 @@ class groupware_dao{ /* * TODO: Remove the debug */ - private $debug = true; + private $debug = false; /* * TODO: fill the following vars on init. */ -- 2.30.2