Commit f3850767 authored by Gabriel Guardincerri's avatar Gabriel Guardincerri Committed by gguardin

[JM-1410] Inconsistent error messages in new user creation from OF Admin...

[JM-1410] Inconsistent error messages in new user creation from OF Admin Console when CS is connected. To be reviewed.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10638 b35dd754-fafc-0310-a699-88a17e54d16e
parent 36f61d00
...@@ -64,8 +64,7 @@ ...@@ -64,8 +64,7 @@
// Trim the password. This means we don't accept spaces as passwords. We don't // Trim the password. This means we don't accept spaces as passwords. We don't
// trim the passwordConfirm as well since not trimming will ensure the user doesn't // trim the passwordConfirm as well since not trimming will ensure the user doesn't
// think space is an ok password character. // think space is an ok password character.
password = password.trim(); if (password == null || password.trim().equals("")) {
if (password == null || password.equals("")) {
errors.put("password",""); errors.put("password","");
} }
if (passwordConfirm == null) { if (passwordConfirm == null) {
...@@ -76,7 +75,7 @@ ...@@ -76,7 +75,7 @@
} }
// If provider requires email, validate // If provider requires email, validate
if (UserManager.getUserProvider().isEmailRequired()) { if (UserManager.getUserProvider().isEmailRequired()) {
if (StringUtils.isValidEmailAddress(email)) { if (!StringUtils.isValidEmailAddress(email)) {
errors.put("email",""); errors.put("email","");
} }
} }
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
if (save) { if (save) {
// If provider requires email, validate // If provider requires email, validate
if (UserManager.getUserProvider().isEmailRequired()) { if (UserManager.getUserProvider().isEmailRequired()) {
if (StringUtils.isValidEmailAddress(email)) { if (!StringUtils.isValidEmailAddress(email)) {
errors.put("email",""); errors.put("email","");
} }
} }
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
} }
} }
if (errors.size() == 0) {
user.setEmail(email); user.setEmail(email);
user.setName(name); user.setName(name);
...@@ -80,6 +81,7 @@ ...@@ -80,6 +81,7 @@
response.sendRedirect("user-properties.jsp?editsuccess=true&username=" + URLEncoder.encode(username, "UTF-8")); response.sendRedirect("user-properties.jsp?editsuccess=true&username=" + URLEncoder.encode(username, "UTF-8"));
return; return;
} }
}
%> %>
<html> <html>
......
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