Commit 7eb06aad authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Improved error checking to ensure that the entered JID is a bare JID.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@162 b35dd754-fafc-0310-a699-88a17e54d16e
parent cd422108
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
Map errors = new HashMap(); Map errors = new HashMap();
if (add) { if (add) {
// do validation // do validation
if (userJID == null) { if (userJID == null || userJID.indexOf('@') == -1) {
errors.put("userJID","userJID"); errors.put("userJID","userJID");
} }
if (errors.size() == 0) { if (errors.size() == 0) {
...@@ -198,7 +198,7 @@ Total Users: <%= userCount %>. ...@@ -198,7 +198,7 @@ Total Users: <%= userCount %>.
<% if (errors.get("userJID") != null) { %> <% if (errors.get("userJID") != null) { %>
<span class="jive-error-text"> <span class="jive-error-text">
Please enter a valid bare JID. Please enter a valid bare JID (e.g. johndoe@company.org).
</span> </span>
<% } %> <% } %>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
Map errors = new HashMap(); Map errors = new HashMap();
if (add) { if (add) {
// do validation // do validation
if (userJID == null) { if (userJID == null || userJID.indexOf('@') == -1) {
errors.put("userJID","userJID"); errors.put("userJID","userJID");
} }
if (errors.size() == 0) { if (errors.size() == 0) {
...@@ -190,7 +190,7 @@ Total Users: <%= userCount %>. ...@@ -190,7 +190,7 @@ Total Users: <%= userCount %>.
<% if (errors.get("userJID") != null) { %> <% if (errors.get("userJID") != null) { %>
<span class="jive-error-text"> <span class="jive-error-text">
Please enter a valid bare JID. Please enter a valid bare JID (e.g. johndoe@company.org).
</span> </span>
<% } %> <% } %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment