I'm using the basic authentication from the blog tutorial, it's pretty much like they wrote it on the Cakephp page. and it's working fine.
The problem is: This page I'm building won't have login for normal users, just Admins. So I want to allow everything but the admin prefix.
class AppController extends Controller {
public $components = array(
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'users', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'pages', 'action' => 'home')
)
);
public function beforeFilter() {
if (isset($this->params['prefix']) && $this->params['prefix'] == 'admin') {
$this->layout = 'admin';
}else{ // it works well and enter here when I'm not using any prefix
$this->Auth->allow(array('*'));
//$this->Auth->allow('*');
//$this->Auth->allow('*');
}
}
}
It just won't allow all actions. I already wrote the name of one action, and it works, but when I place a "*" there, it wont work. BTW it's on the appController as you can see, I want to allow * in * controllers.
Thanks.
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment