Thursday, October 30, 2008

Re: 404 Errors Stop Working When Using Auth Component

Here is how I fixed the above problem:

cake/libs/controller/components/auth.php - startup():
$isAllowed = (
$this->allowedActions == array('*') ||
in_array($controller->action, $this->allowedActions) ||
!method_exists($controller, $controller->action) // Let the user in
if the method does not exist; preserve 404s
);


On Oct 29, 5:02 pm, Rahil <rahilson...@gmail.com> wrote:
> Hi everyone,
>
> I'm using the Auth component and here is my beforeFilter() in my
> controller:
>
> function beforeFilter() {
>         $this->Auth->allow('*');
>         $this->Auth->deny('add', 'delete', 'edit');
>         $this->Auth->loginAction = '/users/login';
>
> }
>
> Now the problem is if I go to /controller/testing123, instead of
> giving me a 404 error, Auth takes over and redirects me to
> loginAction. I don't want people stumbling across my login form
> accidentally.
>
> How can I get 404 errors to start working again? Thanks!
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: