I have this function in my app_controller that looks like:
function Authorize(){
// If the session info hasn't been set...
if ($this->Session->check('User')){
$this->set('authorized', true);
}
else{
// Force the user to login
$this->redirect('/login');
}
}
but when I try:
echo isset($authorized) ? $html->link('Logout', '/login/logout') :
$html->link('Log in', '/login');
in my layout, it doesn't recognize $authorized as being set. How can I
accomplish this? I need a variable to test against to show/not show
things if somebody is logged in.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---