Hi,
I've used the authentication and authorization examples and I need to
add some easy extra behavior to the loginPage. A user can sign up the site
and then he gets an email to confirm it. When he clicked the link to
confirm his/her singing up, some parameters are sent. As he/she didn't have
a session,
// Force sign in
throw new
RestartResponseAtInterceptPageException(PaginaLogIn.class);
Nevertheless, the pages is instantiated without any parameter, despite the
link mail has one.
I imagine that the redirect by this exception clean the parameters. Which is
the easiest solution?
This is the full code for method init in the Application class,
protected void init()
{
super.init();
getSecuritySettings().setAuthorizationStrategy(new
IAuthorizationStrategy()
{
public boolean isActionAuthorized(Component component, Action
action)
{
return true;
}
public boolean isInstantiationAuthorized(Class componentClass)
{
System.out.println("Entre
SignIn2Application.isInstantiationAuthorized("+ componentClass + ")");
if
(AuthenticatedWebPage.class.isAssignableFrom(componentClass))
{
// Is user signed in?
if (SesionMisPartidos.isSignedIn())
{
// okay to proceed
return true;
}
System.out.println("Redirijo la pagina a SignIn2");
// Force sign in
throw new
RestartResponseAtInterceptPageException(PaginaLogIn.class);
}
return true;
}
});
crearCarpetaUsuarios();
}
--
Fernando Wermus.
www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/