/** * Single entry point for all JSON admin requests. * * @return Response Response object containing the generated output */ public function doAction() { $aimeos = app('\\Aimeos\\Shop\\Base\\Aimeos')->get(); $cntlPaths = $aimeos->getCustomPaths('controller/extjs'); $context = app('\\Aimeos\\Shop\\Base\\Context')->get(false); $context = $this->setLocale($context); $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); $response = $controller->process(\Input::instance()->request->all(), 'php://input'); return \View::make('shop::admin.do', array('output' => $response)); }
/** * Single entry point for all JSON admin requests. */ public function doAction() { $context = $this->context->get(null, 'backend'); $context->setLocale($this->locale->getBackend($context, 'default')); $context->setView($this->viewcontainer->create($context, $this->uriBuilder, array(), $this->request)); $cntlPaths = $this->aimeos->get()->getCustomPaths('controller/extjs'); $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); if (($content = file_get_contents('php://input')) === false) { throw new \Exception('Unable to get request content'); } return $controller->process($this->request->getArguments(), $content); }
/** * Single entry point for all JSON admin requests. * * @param Request $request Symfony request object * @return \Symfony\Component\HttpFoundation\Response 2.0 RPC message response */ public function doAction(Request $request) { $csrfProvider = $this->get('form.csrf_provider'); if ($csrfProvider->isCsrfTokenValid('aimeos_admin_token', $request->query->get('_token')) !== true) { throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException('CSRF token is invalid'); } $cntlPaths = $this->get('aimeos')->get()->getCustomPaths('controller/extjs'); $context = $this->get('aimeos_context')->get(false); $context = $this->setLocale($context); $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); $response = $controller->process($request->request->all(), 'php://input'); return $this->render('AimeosShopBundle:Admin:do.html.twig', array('output' => $response)); }
/** * Single entry point for all JSON admin requests. * * @param Request $request Symfony request object * @return Response JSON RPC message response */ public function doAction(Request $request) { $csrfProvider = $this->get('security.csrf.token_manager'); if ($csrfProvider->isTokenValid(new CsrfToken('aimeos_admin_token', $request->query->get('_token'))) !== true) { throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException('CSRF token is invalid'); } $cntlPaths = $this->get('aimeos')->get()->getCustomPaths('controller/extjs'); $context = $this->get('aimeos_context')->get(false, 'backend'); $context->setView($this->get('aimeos_view')->create($context, array())); $context->setLocale($this->get('aimeos_locale')->getBackend($context, 'default')); $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); $response = $controller->process($request->request->all(), $request->getContent()); return $this->render('AimeosShopBundle:Extadm:do.html.twig', array('output' => $response)); }
/** * Single entry point for all JSON admin requests. * * @param \Illuminate\Http\Request $request Laravel request object * @return \Illuminate\Contracts\View\View View for rendering the output */ public function doAction(Request $request) { if (config('shop.authorize', true)) { $this->authorize('admin', [['admin']]); } $site = Route::input('site', Input::get('site', 'default')); $aimeos = app('\\Aimeos\\Shop\\Base\\Aimeos')->get(); $cntlPaths = $aimeos->getCustomPaths('controller/extjs'); $context = app('\\Aimeos\\Shop\\Base\\Context')->get(false, 'backend'); $context->setView(app('\\Aimeos\\Shop\\Base\\View')->create($context, array())); $context->setLocale(app('\\Aimeos\\Shop\\Base\\Locale')->getBackend($context, $site)); $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); $response = $controller->process(Input::instance()->request->all(), $request->getContent()); return View::make('shop::extadm.do', array('output' => $response)); }
/** * Single entry point for all JSON admin requests * * @param ContainerInterface $container Dependency injection container * @param ServerRequestInterface $request Request object * @param ResponseInterface $response Response object * @param array $args Associative list of route parameters * @return ResponseInterface $response Modified response object with generated output */ public static function doAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) { $cntlPaths = $container->get('aimeos')->getCustomPaths('controller/extjs'); $context = $container->get('aimeos_context')->get(false, $args, 'backend'); $context->setView($container->get('aimeos_view')->create($context->getConfig(), $request, $response, $args, array())); $context = self::setLocale($context); $params = $request->getQueryParams(); if (($post = $request->getParsedBody()) !== null) { $params = array_merge($params, (array) $post); } $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); $output = $controller->process($params, (string) $request->getBody()); $response->getBody()->write($output); return $response; }