Tuesday, March 12, 2013

Re: Auth->allow( * ) not working

As mentioned in IRC, allow() for 2.1 and above
see http://book.cakephp.org/2.0/en/appendices/2-1-migration-guide.html#authcomponent


Am Dienstag, 12. März 2013 18:23:23 UTC+1 schrieb Ighor Martins:
Hello.

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('*');
        }
    }
}


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.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate