summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-10-01 14:57:43 +0000
committeralecpl <alec@alec.pl>2008-10-01 14:57:43 +0000
commitfd51e0fea582da90f344bfb56ba797da1baa30f9 (patch)
tree06996af3b1bd692d3fab8c39784caa2a11c7bc1e /program/js
parent56cf503a1b57b9fbf453a051c44cd12750b99cc0 (diff)
- Better handling of "no identity" and "no email in identity" situations (#1485117)
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/program/js/app.js b/program/js/app.js
index bcc5e5071..ef9d1c51c 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1924,9 +1924,18 @@ function rcube_webmail()
var input_to = rcube_find_object('_to');
var input_cc = rcube_find_object('_cc');
var input_bcc = rcube_find_object('_bcc');
+ var input_from = rcube_find_object('_from');
var input_subject = rcube_find_object('_subject');
var input_message = rcube_find_object('_message');
+ // check sender (if have no identities)
+ if (input_from.type == 'text' && !rcube_check_email(input_from.value, true))
+ {
+ alert(this.get_label('nosenderwarning'));
+ input_from.focus();
+ return false;
+ }
+
// check for empty recipient
var recipients = input_to.value ? input_to.value : (input_cc.value ? input_cc.value : input_bcc.value);
if (!rcube_check_email(recipients.replace(/^\s+/, '').replace(/[\s,;]+$/, ''), true))