From 0007bf58be1de14b3a902096589957a2a3bf9e3d Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Mon, 12 Jan 2015 15:10:46 +0100 Subject: [PATCH] PHRAS-350 Deprecate client --- .../Controller/Client/RootController.php | 17 ++++++++++++++++- templates/web/common/menubar.html.twig | 2 +- templates/web/prod/index.html.twig | 1 - .../Phrasea/Controller/Client/RootTest.php | 9 +++++---- www/skins/prod/000000/prodcolor.css | 2 +- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Client/RootController.php b/lib/Alchemy/Phrasea/Controller/Client/RootController.php index e79bf389a1..e288d5e997 100644 --- a/lib/Alchemy/Phrasea/Controller/Client/RootController.php +++ b/lib/Alchemy/Phrasea/Controller/Client/RootController.php @@ -13,6 +13,7 @@ use Alchemy\Phrasea\Controller\Controller; use Alchemy\Phrasea\Security\Firewall; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Session\Session; class RootController extends Controller { @@ -25,13 +26,27 @@ class RootController extends Controller } /** - * Gets client main page + * @return Session + */ + private function getSession() + { + return $this->app['session']; + } + + /** + * /!\/!\/!\/!\/!\/!\/!\/!\/!\ + * + * Client is no longer used + * + * Redirect to production with a nice message * * @param Request $request * @return Response */ public function getClientAction(Request $request) { + $this->getSession()->getFlashBag()->add('client_deprecated'); + if (!$this->getAuthenticator()->isAuthenticated() && null !== $request->query->get('nolog')) { return $this->app->redirectPath('login_authenticate_as_guest', ['redirect' => 'client']); } diff --git a/templates/web/common/menubar.html.twig b/templates/web/common/menubar.html.twig index 6aa912eb11..bc524865b3 100644 --- a/templates/web/common/menubar.html.twig +++ b/templates/web/common/menubar.html.twig @@ -174,7 +174,7 @@ - {% if app.getAuthenticator().isAuthenticated() and (module == "client" or module == "prod") %} + {% if app.getAuthenticator().isAuthenticated() and module == "prod" %}