I reversed the order
> var $components = array('Auth', 'Session');
but it's still not working as expected,


i'm running it on cake 1.3.5


On 13 nov, 17:28, cricket <[email protected]> wrote:
> On Fri, Nov 12, 2010 at 8:20 PM, huoxito <[email protected]> wrote:
> > I have this in my app_controller
>
> > var $components = array('Session', 'Auth');
>
> The order of those should be reversed:
>
> var $components = array('Auth', 'Session');
>
> At least, at one time that was important. I don't know if it's still 
> necessary.
>
>
>
> > function beforeFilter(){
> >        parent::beforeFilter();
>
> >        # thanks 
> > tohttp://padariadodenilson.wordpress.com/2010/10/04/criando-uma-area-ad...
> >        if (isset($this->params['admin'])) {
> >            $this->Auth->deny('*');
> >        } else {
> >            $this->Auth->allow('*');
> >        }
>
> >        $this->Auth->fields = array('username' => 'name', 'password'
> > => 'password');
> >        //$this->Auth->loginError = "No, you fool!  That's not the
> > right password!";
> >        //$this->Auth->loginAction = array('admin' => false,
> > 'controller' => 'users', 'action' => 'login');
> >        //$this->Auth->loginRedirect = array('controller' =>
> > 'usuarios', 'action' => 'afterLogin');
> >        $this->Auth->authError = "Você precisa estar logado para
> > entrar no sistema.";
> >    }
>
> > My routes config are:
>
> > Router::connect("/admin/:controller/:action/*", array('prefix' =>
> > 'admin', 'admin' => true));
>
> What version are you running? In 1.2.x you should have the following
> in core.php:
>
> Configure::write('Routing.admin', 'admin');
>
> For 1.3.x:
>
> Configure::write('Routing.prefixes', array('admin'));
>
>
>
> > this way admin methods are protected but if I take off that condition
> > e Auth allows really everything,
> > thanks for helping
>
> > On 12 nov, 15:50, cricket <[email protected]> wrote:
> >> On Thu, Nov 11, 2010 at 11:44 PM, huoxito <[email protected]> wrote:
> >> > Thats what I thought as well, but it doesnt happen,
>
> >> > If I just let $this->Auth->allow(‘*’) in my app_controller all actions
> >> > are accessible without being logged in, even my admin_* methods
>
> >> Perhaps Auth isn't properly configured in
> >> AppController::beforeFilter(). Could you post that?
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" 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 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> That's odd. On a lark, I just added:
>
> $this->Auth->allow('*');
>
> .. to my AppController::beforeFilter() and it still redirected me to
> login when trying to access an admin action. As it's supposed to work.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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

Reply via email to