PHP 클래스 FOC\Authenticate\Auth\CookieAuthenticate

Provides the ability to authenticate using COOKIE $this->Auth->config('authenticate', [ 'Authenticate.Cookie' => [ 'fields' => [ 'username' => 'username', 'password' => 'password' ], 'userModel' => 'Users', 'scope' => ['Users.active' => 1], 'crypt' => 'aes', 'cookie' => [ 'name' => 'RememberMe', 'time' => '+2 weeks', ] ] ]); Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt
상속: extends Cake\Auth\BaseAuthenticate
파일 보기 프로젝트 열기: friendsofcake/authenticate

공개 메소드들

메소드 설명
__construct ( Cake\Controller\ComponentRegistry $registry, array $config ) Constructor
authenticate ( Cake\Network\Request $request, Response $response ) : array | boolean Authenticate user
getUser ( Cake\Network\Request $request ) : mixed Authenticates the identity contained in the cookie. Will use the userModel config, and fields config to find COOKIE data that is used to find a matching record in the model specified by userModel. Will return false if there is no cookie data, either username or password is missing, or if the scope conditions have not been met.
logout ( Cake\Event\Event $event, array $user ) : void Called from AuthComponent::logout()

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( Cake\Controller\ComponentRegistry $registry, array $config )
$registry Cake\Controller\ComponentRegistry The Component registry used on this request.
$config array Array of config to use.

authenticate() 공개 메소드

Authenticate user
public authenticate ( Cake\Network\Request $request, Response $response ) : array | boolean
$request Cake\Network\Request Request object.
$response Cake\Network\Response Response object.
리턴 array | boolean Array of user info on success, false on falure.

getUser() 공개 메소드

Authenticates the identity contained in the cookie. Will use the userModel config, and fields config to find COOKIE data that is used to find a matching record in the model specified by userModel. Will return false if there is no cookie data, either username or password is missing, or if the scope conditions have not been met.
public getUser ( Cake\Network\Request $request ) : mixed
$request Cake\Network\Request The unused request object.
리턴 mixed False on login failure. An array of User data on success.

logout() 공개 메소드

Called from AuthComponent::logout()
public logout ( Cake\Event\Event $event, array $user ) : void
$event Cake\Event\Event The dispatched Auth.logout event.
$user array User record.
리턴 void