1.2 Beta Auth Component, Allowing root to be public
Cake: 1.2.0.6311 beta, Mysql: 5.0
Ok, I have come so far, and I think this is my last hurdle. I can not
find the answer anywhere else, so here I am again.
Since I have put the code in my app controller, my main page now
requires login. How do I "allow" the main page to be public for all
(no login required)?
The Allow method of the Auth component seems to only work for actions
on the current controller. But I am talking about the root page.
(localhost).
Here is my simple app controller (and what I did to get the user name
available to the default layout).
<?php
class AppController extends Controller {
var $components = array('Auth');
function beforeFilter() {
$this->Auth->loginAction = array('controller' => 'echere',
'action'
=> 'login');
$this->Auth->loginRedirect = array('controller' => 'echere',
'action' => 'index');
$this->Auth->logoutRedirect = '/';
}
function beforeRender(){
$this->set('curUser', $this->Auth->user('username'));
}
}
?>
So, close, but so far.
-Rodney
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---