I think you'll find that the $this->name is "Users", not "User".

For our applications with simple authentication, I define another
controller variable called $public_actions, which is an array of
action names that do not need any authentication (as there are usually
only a couple of these).  So, in your UsersController have

var $public_actions = array('login', 'logout');

and in your app_controller have
        function beforeFilter()
        {
                $public_action = true;
                if ( $this->name != 'Pages' && $this->name != 'App' ){
                        // all pages are public, 'App' is for missing 
model/view/controller
errors
                        if ( !isset($this->public_actions) or !is_array($this-
>public_actions) or !in_array($this->action, $this->public_actions) ){
                                $this->checkSession();
                        }
                }
        }


On Nov 2, 8:32 am, Anoop <[EMAIL PROTECTED]> wrote:
> Hi
> I have using the app_controller to redirect the request if the session
> is not valid.But
> the page isn't redirecting properly .Firefox has detected that the
> server is redirecting the request for this address in a way that will
> never complete.
> if I comment the lines:
> $this->redirect('/users/login');
> exit();
> That is also error if the page is currently /user/login...
>
> I think it can be tracked out if it is able to check the
> controller.But how can I check the controller.I have checked like
>
>         public function beforeFilter(){
>         if($this->name !="User" || $this->name !="Pages")
>         $this->checkSession();
>         }
> But not working.Is there any way to do this by using the single
> app_controller for every action for checking the session without
> affecting the pages_controller and the user/login?


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