hello i have tried authcomponent but i dont know why it is not working for me.

i have two controller Doctors and Patients. Login methods are in
Doctors controller.

After hit the login form, the login form reappears with no flash/auth message.

Doctors Controller code

 var $name = 'Doctors';
 var $components = array('Auth');

    function beforeFilter(){
        $this->Auth->userModel = 'Doctor';
        $this->Auth->fields = array('username'=>'email',
'password'=>'password');
        $this->Auth->loginAction = array('controller' => 'Doctors',
'action' => 'login');
        $this->Auth->loginRedirect = array('controller' => 'Patients',
'action' => 'index');
        $this->Auth->allow('login');
        $this->Auth->authorize = 'controller';
        $this->Auth->userScope = array('Doctor.status'=>1);
    }

    function isAuthorized() {
         return true;
    }
    function login(){

    }

    function logout(){
        $this->Session->setFlash('You Have been Logged Out.');
        $this->redirect($this->Auth->logout());

    }


Patients Controller code

 var $name = 'Patients';
 var $components = array('Auth');

   function beforeFilter(){
        $this->Auth->userModel = 'Doctor';
        $this->Auth->fields = array('username'=>'email',
'password'=>'password');
        $this->Auth->loginAction = array('controller' => 'Doctors',
'action' => 'login');
        $this->Auth->loginRedirect = array('controller' => 'Patients',
'action' => 'index');
        $this->Auth->allow('login');
        $this->Auth->authorize = 'controller';
        $this->Auth->userScope = array('Doctor.status'=>1);
    }

    function isAuthorized() {
         return true;
    }



anyone please help me

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to