ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject incubator-ponymail git commit: validate email on association
Date Sat, 04 Jun 2016 09:28:30 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master ffc3aeaf3 -> 3efed647f


validate email on association

Email addresses should be validated.
min 7 chars long, must be foo@bar.tld
This fixes #49.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/3efed647
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/3efed647
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/3efed647

Branch: refs/heads/master
Commit: 3efed647f8a568aadf7c17a83b807fe4e2e75b9e
Parents: ffc3aea
Author: humbedooh <humbedooh@apache.org>
Authored: Sat Jun 4 11:27:51 2016 +0200
Committer: humbedooh <humbedooh@apache.org>
Committed: Sat Jun 4 11:27:51 2016 +0200

----------------------------------------------------------------------
 site/js/alts.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/3efed647/site/js/alts.js
----------------------------------------------------------------------
diff --git a/site/js/alts.js b/site/js/alts.js
index 82412b2..99a77ed 100644
--- a/site/js/alts.js
+++ b/site/js/alts.js
@@ -52,7 +52,12 @@ function listAlts() {
 }
 
 function newAlt(addr) {
-    GetAsync("/api/preferences.lua?associate=" + addr, null, function() { alert("An association
request has been sent to the specified email address. Please check your inbox! Depending on
grey-listing etc, it may take up to 15 minutes before your confirmation email arrives.")})
+    if (addr.match(/^([^\s@]+@[^\s@]+)$/) && addr.length > 6) {
+        GetAsync("/api/preferences.lua?associate=" + addr, null, function() { alert("An association
request has been sent to the specified email address. Please check your inbox! Depending on
grey-listing etc, it may take up to 15 minutes before your confirmation email arrives.")})
+    } else {
+        alert("Please enter a valid email address!")
+    }
+    
     return false;
 }
 


Mime
View raw message