You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Eigen Technology Pty Ltd <mi...@eigentechnology.com> on 2003/01/06 12:21:36 UTC

Smart Login..? -- revisited.

I found this script in the Archive. Just a couple of questions on the
script as given below.

I have created a MySecureScreen.java file (extends SecrureScreen.java) and
put the suggested code in it. I then change my Index.java to extended
MySecureScreen.java instead of SecureScreen.java.

I run the Login.vm using the added lines:

> #if($oldurl)
> action="$oldurl.setAction("LoginUser")"
> #else
> action="$link.setPage("Index.vm").setAction("LoginUser")"
> #end

But I did not get the intended result, i.e. redirect to the right page.

where have I done wrong?

thankx for any in put.
michael





Leon Messerschmidt wrote:

> Hi Matt,
>
> This works well for me.  I have a secure screen and in isAutorized() I do
> something like this:
>
> if (user != null && user.hasLoggedIn())
> {
> doBuildSecureTemplate (data,context);
> }
> else
> {
> try
> {
> data.setMessage("invalid_login");
> DynamicURI lastUrl = new DynamicURI (data);
> lastUrl.addPathInfo (data.getParameters());
> lastUrl.addPathInfo
> ("template",data.getTemplateInfo().getScreenTemplate());
> context.put("oldurl",lastUrl);
> data.getTemplateInfo().setScreenTemplate("Login.vm");
> }
> catch (Exception e)
> {
> Log.error (e);
> }
>
> return;
>
> }
>
> In my login screen I simply use something like this:
>
> #if($oldurl)
> action="$oldurl.setAction("LoginUser")"
> #else
> action="$link.setPage("Index.vm").setAction("LoginUser")"
> #end
>
> This works pretty cool because any screen that requires a login will go to
> the login screen if your are not logged in and return to the right screen
> when you have successfully logged in without any extra logic.
>
> Hope it helps.
>
> ~ Leon
>
> ----- Original Message






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>