From: helge Date: Mon, 18 Jul 2005 20:21:03 +0000 (+0000) Subject: added some email validation X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=641832e147fb535bc8992b6702abbcdf89a56698;p=scalable-opengroupware.org added some email validation git-svn-id: http://svn.opengroupware.org/SOGo/trunk@811 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/Contacts/ChangeLog b/SOGo/UI/Contacts/ChangeLog index 584c1514..554d45fd 100644 --- a/SOGo/UI/Contacts/ChangeLog +++ b/SOGo/UI/Contacts/ChangeLog @@ -1,3 +1,8 @@ +2005-07-18 Helge Hess + + * English.lproj/Localizable.strings: added text for invalid emails + (v0.9.25) + 2005-07-13 Helge Hess * UIxContactEditorBase.m: added a safeguard for vCard contacts diff --git a/SOGo/UI/Contacts/English.lproj/Localizable.strings b/SOGo/UI/Contacts/English.lproj/Localizable.strings index ceac8d48..bfe7e055 100644 --- a/SOGo/UI/Contacts/English.lproj/Localizable.strings +++ b/SOGo/UI/Contacts/English.lproj/Localizable.strings @@ -34,3 +34,7 @@ "Save" = "Save"; "Cancel" = "Cancel"; "Copy from Anais" = "Copy from Anaïs"; + +/* error */ + +"invalidemailwarn" = "Invalid E-Mail Field, Continue?"; diff --git a/SOGo/UI/Contacts/Version b/SOGo/UI/Contacts/Version index 097fb071..931bb074 100644 --- a/SOGo/UI/Contacts/Version +++ b/SOGo/UI/Contacts/Version @@ -1,6 +1,6 @@ # GNUstep makefile -SUBMINOR_VERSION:=24 +SUBMINOR_VERSION:=25 # v0.9.18 requires NGExtensions v4.5.136 # v0.9.16 requires libSOGoUI v0.9.16 diff --git a/SOGo/UI/WebServerResources/ChangeLog b/SOGo/UI/WebServerResources/ChangeLog index 574cdefc..8bb43e21 100644 --- a/SOGo/UI/WebServerResources/ChangeLog +++ b/SOGo/UI/WebServerResources/ChangeLog @@ -1,5 +1,7 @@ 2005-07-18 Helge Hess + * generic.js: added regex for email field checks + * uix.css: added .homepagefont class (as it was used in the deprecated uix.css inside Common diff --git a/SOGo/UI/WebServerResources/generic.js b/SOGo/UI/WebServerResources/generic.js index aec909d2..2c2b0a0e 100644 --- a/SOGo/UI/WebServerResources/generic.js +++ b/SOGo/UI/WebServerResources/generic.js @@ -20,6 +20,8 @@ */ /* some generic JavaScript code for SOGo */ +// TODO: replace things with Prototype where applicable + /* generic stuff */ function ml_stripActionInURL(url) { @@ -34,6 +36,16 @@ function ml_stripActionInURL(url) { return url; } +/* emails */ + +var uixEmailUsr = + "([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")"; +var uixEmailDomain = + "([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]*\\.[a-zA-Z]{2,5}"; +var uixEmailRegex = new RegExp("^"+uixEmailUsr+"\@"+uixEmailDomain+"$"); + +/* escaping */ + function escapeHTML(s) { s = s.replace(/&/g, "&"); s = s.replace(/