From fd51e0fea582da90f344bfb56ba797da1baa30f9 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 01 Oct 2008 10:57:43 -0400
Subject: [PATCH] - Better handling of "no identity" and "no email in identity" situations (#1485117)

---
 program/js/app.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index bcc5e50..ef9d1c5 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1924,9 +1924,18 @@
     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))

--
Gitblit v1.9.1