You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Sam Joseph <ga...@yha.att.ne.jp> on 2002/05/01 09:35:12 UTC
Showing different screen/template after a user logs in to TDK
Hi there,
So I'm beginning to get the hang of the TDK security setup, but I can't
quite qork out how to show a different screen/template to a user when
they first log in.
At the moment the FluxLogin class seems to do this in response to a
correct login attempt
data.setMessage(TurbineResources.getString("login.welcome"));
but I can't find any reference to login.welcome anywhere in the tdk
I'm assuming that the FluxLogin class is just displaying the default
page described in the Turbine properties file
services.VelocityService.default.page.template = /Default.vm
services.VelocityService.default.layout.template = /Default.vm
Now, I guess I could extend FluxLogin and create a new login class that
would display a template based on the user's role, but it's not clear to
me how FluxLogin and turbines LoginUser interact, if at all ....
Any help greatly appreciated.
CHEERS> SAM
p.s. and yes I have read
http://jakarta.apache.org/turbine/turbine-2/howto/security-howto.html
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Showing different screen/template after a user logs in to TDK
Posted by Naga Pappireddi <na...@jalvamedia.com>.
William,
If you are refering to the issue on how to land the user to different
page...
You could store role based url's in a db table and based on the user role or
other criteria you can pick the landing page and use setTemplate API to
effect the change
Naga
----- Original Message -----
From: "William Lee" <wl...@sendmail.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, May 01, 2002 9:06 AM
Subject: Re: Showing different screen/template after a user logs in to TDK
> Sam Joseph wrote:
> > Hi there,
> >
> > So I'm beginning to get the hang of the TDK security setup, but I can't
> > quite qork out how to show a different screen/template to a user when
> > they first log in.
>
> I'm not sure it's absolutely the right way to do it. The problem is
> that you don't have the ACL unless you get into the the AccessController
> and after you log in. I overrided the AccessController and have a
> variable in the session saying whether the user has logged on for the
> first time. If so, my AccessController will determine the first page
> based on the ACL of the user.
>
> There may be other solutions, but it works for me for now.
>
> --
> William Lee (Will) | Sendmail Inc.
> Email: wlee@sendmail.com | http://www.sendmail.com
> Tel: (510) 594-5505 |
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Showing different screen/template after a user logs in to TDK
Posted by Sam Joseph <ga...@yha.att.ne.jp>.
Hi William
I came up with a different solution that involved taking the following code:
AccessControlList acl = data.getACL();
if ( acl == null )
{
acl = TurbineSecurity.getACL( data.getUser() );
data.getSession().setAttribute(
AccessControlList.SESSION_KEY,
(Object)acl );
}
data.setACL(acl);
data.save();
if (acl!=null && acl.hasRole("turbine_root"))
{
data.setScreenTemplate("Index.vm");
}
else
{
data.setScreenTemplate("Welcome.vm");
}
and placing it in a copy of LoginUser.java, which I then placed in my
application as AppLoginUser extends Action. I have the first login page
call AppLoginUser instead of LoginUser, and now I have control over
which screen is displayed to which user.
I also placed this in Default.vm
#if($data.getACL().hasRole("turbine_root"))
$navigation.setTemplate("/Menu.vm")
#elseif($data.getACL().hasRole("content_manager"))
$navigation.setTemplate("/ContentManagerMenu.vm")
#end
which allows me to show different menus to different users.
It's probably all the wrong way to go, but it seems to work so far :-)
CHEERS> SAM
William Lee wrote:
> Sam Joseph wrote:
>
>> Hi there,
>>
>> So I'm beginning to get the hang of the TDK security setup, but I
>> can't quite qork out how to show a different screen/template to a
>> user when they first log in.
>
>
> I'm not sure it's absolutely the right way to do it. The problem is
> that you don't have the ACL unless you get into the the
> AccessController and after you log in. I overrided the
> AccessController and have a variable in the session saying whether the
> user has logged on for the first time. If so, my AccessController
> will determine the first page based on the ACL of the user.
>
> There may be other solutions, but it works for me for now.
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Showing different screen/template after a user logs in to TDK
Posted by William Lee <wl...@sendmail.com>.
Sam Joseph wrote:
> Hi there,
>
> So I'm beginning to get the hang of the TDK security setup, but I can't
> quite qork out how to show a different screen/template to a user when
> they first log in.
I'm not sure it's absolutely the right way to do it. The problem is
that you don't have the ACL unless you get into the the AccessController
and after you log in. I overrided the AccessController and have a
variable in the session saying whether the user has logged on for the
first time. If so, my AccessController will determine the first page
based on the ACL of the user.
There may be other solutions, but it works for me for now.
--
William Lee (Will) | Sendmail Inc.
Email: wlee@sendmail.com | http://www.sendmail.com
Tel: (510) 594-5505 |
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>