/** * @inheritdoc */ public function authenticate() { $userData = 0; if ($this->sessionHandler->has(AuthenticationModel::AUTH_NAME)) { $userData = $this->sessionHandler->get(AuthenticationModel::AUTH_NAME, []); } elseif ($this->request->getCookies()->has(AuthenticationModel::AUTH_NAME)) { list($userId, $token) = explode('|', $this->request->getCookies()->get(AuthenticationModel::AUTH_NAME, '')); $userData = $this->verifyCredentials($userId, $token); } $this->authenticationModel->authenticate($userData); }
/** * @param string $path * * @return \Symfony\Component\HttpFoundation\Response */ public function execute($path) { $this->response->headers->set('Content-type', 'image/gif'); $this->response->headers->addCacheControlDirective('no-cache', true); $this->response->headers->addCacheControlDirective('must-revalidate', true); $this->response->headers->add(['Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT']); if ($this->sessionHandler->has('captcha_' . $path)) { $this->generateCaptcha($this->sessionHandler->get('captcha_' . $path)); } return $this->response; }