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
if ($this->Session->check('Auth.User.id <http://Auth.User.id>'))
{
//render element for example
}
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2012/1/2 J. <contact.mysparet...@gmail.com
<mailto:contact.mysparet...@gmail.com>>
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 <http://Auth.User.id>')) {
echo("logged");
}
?>
and replacing the echo by $this->redirect, but this doesn't work in a
View.
Any help ?
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org
and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com
<mailto:cake-php%2bunsubscr...@googlegroups.com> For more options,
visit this group at http://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and
help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this
group at http://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php