Commit c399e891 authored by akrherz's avatar akrherz Committed by Guus der Kinderen

OF-1368 Display more-useful admin console msg on user@ login failures

parent 23fa6f11
...@@ -1088,6 +1088,9 @@ login.failed.unauthorized=Login failed: make sure your username and password are ...@@ -1088,6 +1088,9 @@ login.failed.unauthorized=Login failed: make sure your username and password are
or moderator. or moderator.
login.failed.connection=Login failed: make sure your the user and group system is up and running. login.failed.connection=Login failed: make sure your the user and group system is up and running.
login.failed.authentication=Login failed: Openfire wasn't able to authenticate itself to the users system. login.failed.authentication=Login failed: Openfire wasn't able to authenticate itself to the users system.
login.failed.lookslikeemail=Login failed: You provided what appears to be an email address, consider \
using just the user part (everything before the @). Typical installations use just 'admin' \
as the username.
login.username=username login.username=username
login.password=password login.password=password
login.login=Login login.login=Login
......
<%--
--%>
<%@ page import="org.jivesoftware.admin.AdminConsole, <%@ page import="org.jivesoftware.admin.AdminConsole,
org.jivesoftware.openfire.admin.AdminManager" org.jivesoftware.openfire.admin.AdminManager"
errorPage="error.jsp" errorPage="error.jsp"
...@@ -144,9 +141,14 @@ ...@@ -144,9 +141,14 @@
catch (UnauthorizedException ue) { catch (UnauthorizedException ue) {
Log.debug(ue); Log.debug(ue);
LoginLimitManager.getInstance().recordFailedAttempt(username, request.getRemoteAddr()); LoginLimitManager.getInstance().recordFailedAttempt(username, request.getRemoteAddr());
// Provide a special message if the user provided something containing @
if (username.contains("@")){
errors.put("unauthorized", LocaleUtils.getLocalizedString("login.failed.lookslikeemail"));
} else {
errors.put("unauthorized", LocaleUtils.getLocalizedString("login.failed.unauthorized")); errors.put("unauthorized", LocaleUtils.getLocalizedString("login.failed.unauthorized"));
} }
} }
}
// Escape HTML tags in username to prevent cross-site scripting attacks. This // Escape HTML tags in username to prevent cross-site scripting attacks. This
// is necessary because we display the username in the page below. // is necessary because we display the username in the page below.
......
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