summaryrefslogtreecommitdiff
path: root/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-11-06 19:26:45 +0000
committerthomascube <thomas@roundcube.net>2005-11-06 19:26:45 +0000
commit10a699759d4f106f29c077a6d65d3b8d212825e5 (patch)
treed7a50bb94731e131a8a03c546ad3dbcaf0c4f1e1 /program/steps/mail/sendmail.inc
parente0ddd4e6c03d533cc3f8427624e026cc20c88fa6 (diff)
Added localized messages to client and check form input
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r--program/steps/mail/sendmail.inc13
1 files changed, 10 insertions, 3 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 48a5ccc6f..2bafaebc1 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -28,7 +28,7 @@ require_once('Mail/mime.php');
if (!isset($_SESSION['compose']['id']))
{
- $_action = 'list';
+ rcmail_overwrite_action('list');
return;
}
@@ -65,6 +65,14 @@ function rcmail_get_identity($id)
/****** check submission and compose message ********/
+if (empty($_POST['_to']) && empty($_POST['_subject']) && $_POST['_message'])
+ {
+ show_message("sendingfailed", 'error');
+ rcmail_overwrite_action('compose');
+ return;
+ }
+
+
$mailto_regexp = array('/,\s*[\r\n]+/', '/[\r\n]+/', '/,\s*$/m');
$mailto_replace = array(' ', ', ', '');
@@ -206,9 +214,8 @@ else
// return to compose page if sending failed
if (!$sent)
{
- $_action = 'compose';
- $OUTPUT->add_script(sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $_action));
show_message("sendingfailed", 'error');
+ rcmail_overwrite_action('compose');
return;
}