/** * Similar to AuthComponent::user() except if the session user cannot be found, connected authentication * objects will have their getUser() methods called. This lets stateless authentication methods function correctly. * * @return bool true if a user can be found, false if one cannot. */ protected function _getUser() { $user = $this->user(); if ($user) { $this->Session->delete('Auth.redirect'); return true; } if (empty($this->_authenticateObjects)) { $this->constructAuthenticate(); } foreach ($this->_authenticateObjects as $auth) { $result = $auth->getUser($this->request); if (!empty($result) && is_array($result)) { self::$_user = $result; return true; } } return false; }