mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 05:23:21 +00:00
PHRAS-350 Deprecate client
This commit is contained in:

committed by
Benoît Burnichon

parent
03d3975d87
commit
0007bf58be
@@ -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']);
|
||||
}
|
||||
|
@@ -174,7 +174,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if app.getAuthenticator().isAuthenticated() and (module == "client" or module == "prod") %}
|
||||
{% if app.getAuthenticator().isAuthenticated() and module == "prod" %}
|
||||
<div style="display:none;z-index:30000;" id="notification_box">
|
||||
{% set notifications = app['events-manager'].get_notifications %}
|
||||
{% include 'prod/notifications.html.twig' %}
|
||||
|
@@ -185,7 +185,6 @@
|
||||
$('#clientModal').modal();
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{% set ratio = app['settings'].getUserSetting(app.getAuthenticatedUser(), 'search_window') %}
|
||||
{% if ratio == 0 %}
|
||||
{% set ratio = '0.333' %}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Controller\Client;
|
||||
use Symfony\Bundle\FrameworkBundle\Client;
|
||||
|
||||
/**
|
||||
* @group functional
|
||||
@@ -10,12 +11,12 @@ namespace Alchemy\Tests\Phrasea\Controller\Client;
|
||||
*/
|
||||
class RootTest extends \PhraseanetAuthenticatedWebTestCase
|
||||
{
|
||||
protected $client;
|
||||
|
||||
public function testGetClient()
|
||||
{
|
||||
$this->authenticate(self::$DI['app']);
|
||||
self::$DI['client']->request("GET", "/client/");
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isRedirect());
|
||||
/** @var Client $client */
|
||||
$client = self::$DI['client'];
|
||||
$client->request("GET", "/client/");
|
||||
$this->assertTrue($client->getResponse()->isRedirect());
|
||||
}
|
||||
}
|
||||
|
@@ -4983,4 +4983,4 @@ ui-dialog-titlebar {
|
||||
margin-right: 8px;
|
||||
width: 26px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user