You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by gw...@apache.org on 2006/10/11 17:09:13 UTC

svn commit: r462826 - /incubator/wicket/branches/wicket-1.x/wicket-auth-roles/src/main/java/wicket/authentication/panel/SignInPanel.java

Author: gwynevans
Date: Wed Oct 11 08:09:12 2006
New Revision: 462826

URL: http://svn.apache.org/viewvc?view=rev&rev=462826
Log:
Modified SignInPanel to allow optional modification of the post-SignIn processing, e.g. add a possible redirect to a ChangePassword page, etc.

Modified:
    incubator/wicket/branches/wicket-1.x/wicket-auth-roles/src/main/java/wicket/authentication/panel/SignInPanel.java

Modified: incubator/wicket/branches/wicket-1.x/wicket-auth-roles/src/main/java/wicket/authentication/panel/SignInPanel.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket-auth-roles/src/main/java/wicket/authentication/panel/SignInPanel.java?view=diff&rev=462826&r1=462825&r2=462826
==============================================================================
--- incubator/wicket/branches/wicket-1.x/wicket-auth-roles/src/main/java/wicket/authentication/panel/SignInPanel.java (original)
+++ incubator/wicket/branches/wicket-1.x/wicket-auth-roles/src/main/java/wicket/authentication/panel/SignInPanel.java Wed Oct 11 08:09:12 2006
@@ -104,20 +104,11 @@
 		{
 			if (signIn(getUsername(), getPassword()))
 			{
-				// If login has been called because the user was not yet
-				// logged in, than continue to the original destination,
-				// otherwise to the Home page
-				if (!continueToOriginalDestination())
-				{
-					setResponsePage(getApplication().getSessionSettings().getPageFactory().newPage(
-							getApplication().getHomePage(), (PageParameters)null));
-				}
+			    onSignInSucceeded();
 			}
 			else
 			{
-				// Try the component based localizer first. If not found try the
-				// application localizer. Else use the default
-				error(getLocalizer().getString("signInFailed", this, "Sign in failed"));
+			    onSignInFailed();
 			}
 		}
 	}
@@ -228,4 +219,24 @@
 	{
 		return AuthenticatedWebSession.get().signIn(username, password);
 	}
+
+	protected void onSignInFailed()
+	{
+		// Try the component based localizer first. If not found try the
+		// application localizer. Else use the default
+		error(getLocalizer().getString("signInFailed", this, "Sign in failed"));
+	}
+
+	protected void onSignInSucceeded()
+	{
+		// If login has been called because the user was not yet
+		// logged in, than continue to the original destination,
+		// otherwise to the Home page
+		if (!continueToOriginalDestination())
+		{
+			setResponsePage(getApplication().getSessionSettings().getPageFactory().newPage(
+					getApplication().getHomePage(), (PageParameters)null));
+		}
+	}
+
 }