BcAuthComponent::login PHP Method

login() public method

Log a user in. If a $user is provided that data will be stored as the logged in user. If $user is empty or not specified, the request will be used to identify a user. If the identification was successful, the user record is written to the session key specified in AuthComponent::$sessionKey. Logging in will also change the session id in order to help mitigate session replays.
public login ( array $user = null ) : boolean
$user array Either an array of user data, or null to identify a user using the current request.
return boolean True on login success, false on failure
    public function login($user = null)
    {
        // CUSTOMIZE ADD 2011/09/25 ryuring
        // 簡単ログイン
        // >>>
        if (!empty($this->fields['serial']) && !$user) {
            $serial = $this->getSerial();
            $Model = $model = $this->getModel();
            if ($serial) {
                $user = $Model->find('first', array('conditions' => array($Model->alias . '.' . $this->fields['serial'] => $serial), 'recursive' => -1));
            }
        }
        // <<<
        // CUSTOMIZE ADD 2011/09/25 ryuring
        // ログイン時点でもモデルを保存しておく Session::user() のキーとして利用する
        // >>>
        return parent::login($user);
        // <<<
    }