Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Http cakephp仅对基本有效用户进行身份验证_Http_Cakephp_Authentication - Fatal编程技术网

Http cakephp仅对基本有效用户进行身份验证

Http cakephp仅对基本有效用户进行身份验证,http,cakephp,authentication,Http,Cakephp,Authentication,我正在使用Auth和authenticate Basic。 是否有方法检查用户是否处于活动状态=1? 我想检查一下表格和基本方法。 当用户通过http头发送用户名和密码从iphone应用程序登录时,使用基本方法 public $components = array('Session', 'RequestHandler', 'Auth' => array( 'loginAction' => array( 'controller' => 'a

我正在使用Auth和authenticate Basic。 是否有方法检查用户是否处于活动状态=1? 我想检查一下表格和基本方法。 当用户通过http头发送用户名和密码从iphone应用程序登录时,使用基本方法

public $components = array('Session', 'RequestHandler', 'Auth' => array(
        'loginAction' => array(
            'controller' => 'api',
            'action' => 'login'
        ),
        'authenticate' => array(
            'Basic' => array(
                'userModel' => 'Appuser',
                'fields' => array(
                    'username' => 'name'
                )
            ),
            'Form' => array(
                'userModel' => 'Appuser',
                'fields' => array(
                    'username' => 'name'
                )
            )
        )
    ));

使用AuthComponent的
scope
设置,并使用
ALL
常量进行设置:

public $components = array(
    'Auth' => array(
        'loginAction' => array(
            'controller' => 'api',
            'action' => 'login'
        ),
        'authenticate' => array(
            AuthComponent::ALL => array(      // Use this to apply common settings
                'userModel' => 'Appuser',
                'fields' => array(
                    'username' => 'name'
                ),
                'scope' => array(
                    'Appuser.active' => 1       // This is the check you need
                )
            ),
            'Basic',
            'Form'
        )
    )
);
有关更多信息,请参阅