Re: Redirect a user if he wants to see a page when logged in

2012-01-03 Thread J.
Actually I still can't solve my problem. Here is simply what I want : - If a non logged in users goes to my site he sees homepage A - If a logged in user goes to my site he sees homepage B I have the code for the two homepages ready, but I can't do : ?php if

Re: Redirect a user if he wants to see a page when logged in

2012-01-03 Thread J.
Ok I reread some of the above comment, didn't knew what render was, so I searched a little, and this works: ?php if ($this-Session-check('Auth.User.id')) { echo $this-element('home_logged'); } else { echo $this-element('home'); } ? Thanks ! On 3 jan, 19:33, J.

Redirect a user if he wants to see a page when logged in

2012-01-02 Thread J.
I want to display a complete other homepage when user is logged in, but I don't want him to access the logged out user. I thought I could use something like this : ?php if ($this-Session-check('Auth.User.id')) { echo(logged); } ? and replacing the echo by $this-redirect, but this doesn't work

Re: Redirect a user if he wants to see a page when logged in

2012-01-02 Thread Tilen Majerle
you want to display some content only, if user is logged in right ? you can do in a view something like that if ($this-Session-check('Auth.User.id')) { //render element for example } -- Lep pozdrav, Tilen Majerle http://majerle.eu 2012/1/2 J. contact.mysparet...@gmail.com I want to display

Re: Redirect a user if he wants to see a page when logged in

2012-01-02 Thread luca capra
In the controller you can use either: if($this-Auth-user(User.id)){ $this-redirect(/homepage2); // or $this-render(homepage2); } Il 02/01/2012 14:42, Tilen Majerle ha scritto: you want to display some content only, if user is logged in right ? you can do in a view something like that

Re: Redirect a user if he wants to see a page when logged in

2012-01-02 Thread J.
Thanks a lot ! On 2 jan, 15:32, luca capra luca.ca...@gmail.com wrote: In the controller you can use either: if($this-Auth-user(User.id)){    $this-redirect(/homepage2);    // or    $this-render(homepage2); } Il 02/01/2012 14:42, Tilen Majerle ha scritto: you want to display