Octavian Rasnita
Mon, 01 Feb 2010 10:40:50 -0800
From: "Kiffin Gish" <kiffin.g...@planet.nl>
I have a number of user-defined actions which are described with the user id like this: settings/user_id/(view|edit) Where user_id is the primary key into the users resultset. However, I do not want this to be visible to the end-user for security reasons (if I'm admin it's alright). Is it possible to retain these, but for users who are logged in the /user_id/ is removed to get this visible instead: settings/(view|edit) Thanks alot in advance. -- Kiffin Gish <kiffin.g...@planet.nl> Gouda, The Netherlands
If your users have an ID, they're probably logged in. If they are logged in, you can get and use that ID in your app by getting it with:
my $user_id = $c->user->obj->id
or
my $user_id = $c->user->get('id');
(And the second way is recommended).
Octavian
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/