Regards,
Matt
----
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")"
#endThis 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 -----
From: "Matthew Forder" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 29, 2001 1:41 PM
Subject: Smart Login..?> First of all, I just wanted to thank everyone who has taken the time to
> answer my (dumb!) questions over the last few weeks. As a new developer
> using both Java and Turbine for the first time I've found your responses
> very helpfull!
>
> And now, the real reason for this mail...
>
> I want to be able to include http links to secure pages in the emails to
> users. The problem is that if the user is not already authenticated
> he/she will be prompted to login (which is fine) but once the login is
> accomplised the Index.vm page is loaded instead of the link that was
> included in the email. Is there a way to use the standard LoginUser
> module and get it to "remember" where it should be going, or must I go
> and extend (or re-write) the LoginUser action to do this?
>
> Regards,
>
> Matt
>
-- ____ | Matthew J. Forder | Data Center Supervisor / / () | Seagate Techology | Tel:+31 20 316 7468 \ \ \ | Koolhovenlaan 1 | Fax:+31 20 653 5537 ()_/_/ | 1119 NB Schiphol-Rijk, NL | [EMAIL PROTECTED]
begin:vcard n:Forder;Matthew tel;cell:+31 65 350 8743 tel;fax:+31 20 653 5537 tel;work:+31 20 316 7468 x-mozilla-html:TRUE url:http://www.seagate.com/ org:<i>Seagate Technology LLC</i>;<a href="http://www.seagate.com/"><img src="http://www.seagate.com/images/doors/frontdoor/logo.gif" width=99 height=24 border=0 vspace=3 alt="Seagate" align=right></a> adr:;;Koolhovenlaan 1;Schiphol-Rijk;North Holland;1119 NB;Netherlands version:2.1 email;internet:[EMAIL PROTECTED] title:<b>Datacenter Supervisor</b> x-mozilla-cpt:;-25048 fn:Matthew Forder end:vcard
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
