/** * Setzt den internen Authentifizierungscookie * * @param int $userId * @param string $token * @param integer|null $expiry * * @return Cookie */ public function setRememberMeCookie($userId, $token, $expiry = null) { if ($expiry === null) { $expiry = static::REMEMBER_ME_COOKIE_LIFETIME; } return new Cookie(self::AUTH_NAME, $userId . '|' . $token, (new \DateTime())->modify('+' . $expiry . ' seconds'), $this->appPath->getWebRoot(), $this->getCookieDomain(), $this->request->getSymfonyRequest()->isSecure()); }
/** * @param \ACP3\Core\Controller\ActionInterface $controller * @param array $arguments * * @return mixed * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException */ private function executeControllerAction(ActionInterface $controller, array $arguments) { $callable = [$controller, 'execute']; if (empty($arguments)) { $arguments = $this->argumentResolver->getArguments($this->request->getSymfonyRequest(), $callable); } return call_user_func_array($callable, $arguments); }
/** * @inheritdoc */ public function destroy($sessionId) { $this->secureSession(); if ($this->request->getCookies()->has(self::SESSION_NAME)) { $cookie = new Cookie(self::SESSION_NAME, '', (new \DateTime())->modify('-3600 seconds'), $this->appPath->getWebRoot(), null, $this->request->getSymfonyRequest()->isSecure()); $this->response->headers->setCookie($cookie); } // Delete the session from the database $this->db->getConnection()->delete($this->db->getPrefix() . 'sessions', ['session_id' => $sessionId]); return true; }
/** * @param Core\Http\RequestInterface $request * @param bool $allModules * @return \Symfony\Component\DependencyInjection\ContainerBuilder */ public function updateServiceContainer(Core\Http\RequestInterface $request, $allModules = false) { return Core\DependencyInjection\ServiceContainerBuilder::create($this->appPath, $request->getSymfonyRequest(), $this->environment, $allModules); }
/** * @param RequestInterface $request */ public function updateContainer(RequestInterface $request) { $this->container = ServiceContainerBuilder::create($this->appPath, $request->getSymfonyRequest(), $this->container->getParameter('core.environment'), true); }