Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Commit

Permalink
Fix CS errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jun 29, 2014
1 parent 8cbc2a1 commit 39c9704
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions Controller/Component/Auth/CookieAuthenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
*/
class CookieAuthenticate extends BaseAuthenticate {

/**
* Constructor
*
* @param ComponentCollection $collection Components collection.
* @param array $settings Settings
*/
public function __construct(ComponentCollection $collection, $settings) {
$this->settings['cookie'] = array(
'name' => 'RememberMe',
Expand All @@ -42,9 +48,11 @@ public function __construct(ComponentCollection $collection, $settings) {
}

/**
* Authenticates the identity contained in the cookie. Will use the `settings.userModel`, and `settings.fields`
* to find COOKIE data that is used to find a matching record in the `settings.userModel`. Will return false if
* there is no cookie data, either username or password is missing, of if the scope conditions have not been met.
* Authenticates the identity contained in the cookie. Will use the
* `settings.userModel`, and `settings.fields` to find COOKIE data that is used
* to find a matching record in the `settings.userModel`. Will return false if
* there is no cookie data, either username or password is missing, of if the
* scope conditions have not been met.
*
* @param CakeRequest $request The unused request object
* @return mixed False on login failure. An array of User data on success.
Expand Down Expand Up @@ -76,10 +84,23 @@ public function getUser(CakeRequest $request) {
return false;
}

/**
* Authenticate user
*
* @param CakeRequest $request Request object.
* @param CakeResponse $response Response object.
* @return array|boolean Array of user info on success, false on falure.
*/
public function authenticate(CakeRequest $request, CakeResponse $response) {
return $this->getUser($request);
}

/**
* Called from AuthComponent::logout()
*
* @param array $user User record
* @return void
*/
public function logout($user) {
$this->_Collection->Cookie->destroy();
}
Expand Down

0 comments on commit 39c9704

Please sign in to comment.