Eric Martins
Eric Martins

Reputation: 460

Include filed CakePHP's Auth

Is there any way to include a field to be checked in CakePHP's Auth?

e.g.: if status_id == 1

Upvotes: 0

Views: 34

Answers (1)

Fazal Rasel
Fazal Rasel

Reputation: 4526

You need to add status_id =1 on auth components setting.. Like

public $components = array(
                        'Session',
                        'Auth' => array(
                            'loginRedirect' => array('controller' => 'posts', 'action' => 'index'),
                            'logoutRedirect' => array('controller' => 'pages', 'action' => 'display', 'home'),
                            'authorize' => array('Controller'),
                            'authenticate' => array(                                    
                                'Form' => array(
                                    'scope' => array(
                                        'status_id' => 1
                                    )
                                )
                            )
                        )   
                    );

Upvotes: 1

Related Questions