Re: Auth problem with '/' and "You are not authorized to access that location."

2009-06-28 Thread mike karthauser



On 27 Jun 2009, at 23:11, tpynegar  wrote:

>
> Hi,
>
> I've got a setup where i've got a login action at /users/login. If you
> go directly to that
> controller, action there is no error message wereas if you goto '/' as
> in the site
> address with no controller or action and then follow the routes i've
> got setup for '/'
> to /users/login you get this message.
>
> I've tried putting this into the beforeFilter
>
>$this->Auth->allow( '/' );
>

You need to allow the action that is called when you go to /. Check in  
routes it's probably default set to display action in the pages  
controller.


> but doesn't seem to help.
>
> Thanks,
> Tim.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth problem with '/' and "You are not authorized to access that location."

2009-06-27 Thread jitka (poLK)

Url '/' points by default routes to PagesController::display(), so you
should call either

a) in PagesController::beforeFilter():
parent::beforeFilter();
$this->Auth->allow('display');
or
b) in AppController::beforeFilter():
if ($this->name == 'Pages') {
$this->Auth->allow('display');
}

Your usage $this->Auth->allow('/') is wrong, this is not valid
argument.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth problem with '/' and "You are not authorized to access that location."

2009-06-27 Thread tpynegar

Hi,

I've got a setup where i've got a login action at /users/login. If you
go directly to that
controller, action there is no error message wereas if you goto '/' as
in the site
address with no controller or action and then follow the routes i've
got setup for '/'
to /users/login you get this message.

I've tried putting this into the beforeFilter

$this->Auth->allow( '/' );

but doesn't seem to help.

Thanks,
Tim.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---