You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Matthew Forder <fo...@ams.neth.seagate.com> on 2001/08/29 13:41:09 UTC
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 | matthew.forder@seagate.com
Re: Smart Login..?
Posted by Matthew Forder <fo...@ams.neth.seagate.com>.
Leon,
That seems to have done the trick!!! Woo-hoo!! Once again, thanks for your help
on this one.
The only problem I'm having now is if the user types in the wrong password that
the "oldurl" becomes the login screen and the username/password gets put in the
current URL. I guess I'll have to put some extra logic in to prevent that...ah
well...back to the grindstone!!!
Regards,
Matt
Leon Messerschmidt wrote:
> Hi Matt,
>
> It's been a while since I looked at parameter parser so I'm taking a wild
> guess. Try this and see if it works:
>
> http://my.server/app/servlet/app/template/secure/Document.vm/id/100/mode/ins
> ert
>
> ~ Leon
>
> ----- Original Message -----
> From: "Matthew Forder" <fo...@ams.neth.seagate.com>
> To: <tu...@jakarta.apache.org>
> Sent: Friday, August 31, 2001 12:06 PM
> Subject: Re: Smart Login..?
>
> > Leon,
> >
> > I managed to get this working for simple URLs such as:
> >
> > http://my.server/app/servlet/app/template/secure/Document.vm
> >
> > But what I really need to able to do is give an url like this...
> >
> >
> http://my.server/app/servlet/app/template/secure/Document.vm?id=100&mode=ins
> ert
> >
> > But try as I might I can't make it happen. Do you (or anybody) have any
> > suggestions?? Please, before I rip *all* my hair out !?!
> >
> > Regards,
> >
> >
> > Matt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
--
____ | 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 | matthew.forder@seagate.com
Re: Smart Login..?
Posted by Leon Messerschmidt <le...@opticode.co.za>.
Hi Matt,
It's been a while since I looked at parameter parser so I'm taking a wild
guess. Try this and see if it works:
http://my.server/app/servlet/app/template/secure/Document.vm/id/100/mode/ins
ert
~ Leon
----- Original Message -----
From: "Matthew Forder" <fo...@ams.neth.seagate.com>
To: <tu...@jakarta.apache.org>
Sent: Friday, August 31, 2001 12:06 PM
Subject: Re: Smart Login..?
> Leon,
>
> I managed to get this working for simple URLs such as:
>
> http://my.server/app/servlet/app/template/secure/Document.vm
>
> But what I really need to able to do is give an url like this...
>
>
http://my.server/app/servlet/app/template/secure/Document.vm?id=100&mode=ins
ert
>
> But try as I might I can't make it happen. Do you (or anybody) have any
> suggestions?? Please, before I rip *all* my hair out !?!
>
> Regards,
>
>
> Matt
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: Smart Login..?
Posted by Matthew Forder <fo...@ams.neth.seagate.com>.
Leon,
I managed to get this working for simple URLs such as:
http://my.server/app/servlet/app/template/secure/Document.vm
But what I really need to able to do is give an url like this...
http://my.server/app/servlet/app/template/secure/Document.vm?id=100&mode=insert
But try as I might I can't make it happen. Do you (or anybody) have any
suggestions?? Please, before I rip *all* my hair out !?!
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")"
> #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 -----
> From: "Matthew Forder" <fo...@ams.neth.seagate.com>
> To: <tu...@jakarta.apache.org>
> 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 | matthew.forder@seagate.com
Re: Smart Login..?
Posted by Matthew Forder <fo...@ams.neth.seagate.com>.
Thanks Leon, this looks exactly like the kinda magic I was looking for!!! I'll
give it whirl and let you know how I got on.
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")"
> #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 -----
> From: "Matthew Forder" <fo...@ams.neth.seagate.com>
> To: <tu...@jakarta.apache.org>
> 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 | matthew.forder@seagate.com
Re: Smart Login..?
Posted by Leon Messerschmidt <le...@opticode.co.za>.
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 -----
From: "Matthew Forder" <fo...@ams.neth.seagate.com>
To: <tu...@jakarta.apache.org>
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 | matthew.forder@seagate.com
>
>
>
----------------------------------------------------------------------------
----
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: Smart Login..?
Posted by Stefan Wagner <wa...@ixtern.de>.
Hi!
My first thought:
You've got to rewrite LoginUser. In the screen where you show the form, add
an hidden input, where you write the page you want to show after the login.
Then in the page get this hidden parameter and set the ScreenTemplate to it.
Hope this helps,
Stefan
Am Mittwoch, 29. August 2001 13:41 schrieben Sie:
> 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 | matthew.forder@seagate.com
----------------------------------------
Content-Type: text/x-vcard; charset="us-ascii"; name="forderm.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Matthew Forder
----------------------------------------
----------------------------------------
Content-Type: text/plain; charset="us-ascii"; name="Anhang: 2"
Content-Transfer-Encoding: 7bit
Content-Description:
----------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org