[gatein-commits] gatein SVN: r7652 - portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Oct 4 10:54:49 EDT 2011
Author: mwringe
Date: 2011-10-04 10:54:49 -0400 (Tue, 04 Oct 2011)
New Revision: 7652
Modified:
portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/GateinWCIController.java
Log:
JBEPP-1104: Check to make sure that an InitialURL value is not already set when using the ErrorLoginForm. This will prevent an issue where the user gets redirected to a 404 page instead of the InitialURL when they enter the wrong password on the ErrorLoginForm multiple times.
Modified: portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/GateinWCIController.java
===================================================================
--- portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/GateinWCIController.java 2011-10-04 13:31:34 UTC (rev 7651)
+++ portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/GateinWCIController.java 2011-10-04 14:54:49 UTC (rev 7652)
@@ -66,11 +66,18 @@
public void showErrorLoginForm(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
- String initialURI = req.getHeader("referer");
+ //we need to check of the 'initialURI' value is specified or not already for the request. This can occur if an
+ //incorrect login was used on the ErrorLoginForm itself, since we don't want to redirect back to the errorloginform
+ //when the correct login is entered.
+ String initialURI = req.getParameter("initialURI");
if (initialURI == null || initialURI.length() == 0)
{
- initialURI = req.getContextPath();
- }
+ initialURI = req.getHeader("referer");
+ if (initialURI == null || initialURI.length() == 0)
+ {
+ initialURI = req.getContextPath();
+ }
+ }
//
try
More information about the gatein-commits
mailing list