Ah. I'm not sure how many people actually use SignInPanel. Indeed,
that component doesn't look particularly flexible. I guess what you're
looking for is something like:


Index: 
/Users/eelcohillenius/Documents/workspace/wicket-auth-roles/src/main/java/wicket/authentication/panel/SignInPanel.java
===================================================================
--- 
/Users/eelcohillenius/Documents/workspace/wicket-auth-roles/src/main/java/wicket/authentication/panel/SignInPanel.java
      (revision
7587)
+++ 
/Users/eelcohillenius/Documents/workspace/wicket-auth-roles/src/main/java/wicket/authentication/panel/SignInPanel.java
      (working
copy)
@@ -108,20 +108,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();
                        }
                }
        }
@@ -235,4 +226,23 @@
        {
                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));
+               }
+       }
 }


If you agree with that, or something similar, please feel free to
update the project Gwyn.

Eelco


On 10/10/06, Gwyn Evans <[EMAIL PROTECTED]> wrote:
> Unless I'm missing something, not without some major cut & pasting (or
> a  custom version or Wicket).  The actual onSubmit() is down in
> SignInForm, which is in SignInPanel, which is in SignInPage. Even if
> it wasn't final, (which it is,) then there doesn't seem to be a way of
> getting to it to override it.
>
> It didn't seem that unusual a requirement, so I'm slightly surprised
> that I'm the first to be asking about this, so wondering if there's a
> better way of handling it!
>
> /Gwyn
>
> On 10/10/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > if it is after login. Can't you handle it then in the login.onSubmit code?
> >
> >
> > johan
> > \
> >
> > On 10/9/06, Gwyn Evans < [EMAIL PROTECTED]> wrote:
> > > After the login's how I was hoping to go...  Currently checking the
> > > (session) stored user details in the BasePage.
> > >
> > > /Gwyn
> > >
> > > On 09/10/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > > > So before the user is logs in?
> > > > so in the end you have 2 login pages?
> > > > Or after the users logs in, so 2 different directions when the login
> > > > succeeds?
> > > >
> > > > johan
> > > >
> > > >
> > > >
> > > > On 10/9/06, Gwyn Evans <[EMAIL PROTECTED] > wrote:
> > > > > On a related note, can anyone suggest a good way of adding a way of
> > > > > changing the 'destination' page as part of the logging in?
> > > > >
> > > > > The scenario is that after authenticating the user, I may to redirect
> > > > > them to a 'ChangePassword' page.  Is there a better answer than a
> > > > > RestartResponseException in my
> > > > AuthenticatedWebSession.authenticate()
> > > > > implementation?
> > > > >
> > > > > /Gwyn
> > > > >
> > > > > On 09/10/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > > > > > The difference is that
> > > > RestartResponseAtInterceptPageException records
> > > > > > the current request first, which then later - after logging in -
> > could
> > > > > > be redirected to again.
> > > > > >
> > > > > >         if (!continueToOriginalDestination()) {
> > > > > >
> > > > setResponsePage(getApplication().getHomePage());
> > > > > >         }
> > > > > >
> > > > > > Eelco
> > > > > >
> > > > > >
> > > > > > On 10/9/06, Jan Willem Janssen < [EMAIL PROTECTED] > wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > The login-example uses
> > > > RestartResponseAtInterceptPageException to forward
> > > > > > > a user to the login page when he's not authorized.
> > > > > > > What is the difference with throwing an
> > > > RestartResponseAtInterceptPageException
> > > > > > > instead of a RestartResponseException exception? The latter
> > appears to
> > > > give the
> > > > > > > same behaviour, as far as I can see...
>
> --
> Download Wicket 1.2.2 now! - http://wicketframework.org
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to