From 246376d72f545b740f83ecf624e35f800465e21c Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Thu, 4 Oct 2012 22:04:19 +0200 Subject: [PATCH] Cleanup root --- lib/Alchemy/Phrasea/Application/Root.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php index a89df966a4..3c93edf042 100644 --- a/lib/Alchemy/Phrasea/Application/Root.php +++ b/lib/Alchemy/Phrasea/Application/Root.php @@ -55,7 +55,6 @@ use Alchemy\Phrasea\Controller\Prod\UsrLists; use Alchemy\Phrasea\Controller\Prod\WorkZone; use Alchemy\Phrasea\Controller\Utils\ConnectionTest; use Alchemy\Phrasea\Controller\Utils\PathFileTest; -use Silex\Application as SilexApp; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -70,7 +69,7 @@ return call_user_func(function($environment = null) { }); $app->before(function(Request $request) use ($app) { - if (!$app->isAuthenticated() && $request->cookies->has('persistent')) { + if ($request->cookies->has('persistent') && !$app->isAuthenticated()) { try { $auth = new \Session_Authentication_PersistentCookie($app, $request->cookies->get('persistent')); $app->openAccount($auth, $auth->getSessionId()); @@ -80,7 +79,7 @@ return call_user_func(function($environment = null) { } }); - $app->get('/', function(SilexApp $app) { + $app->get('/', function(PhraseaApplication $app) { if ($app['browser']->isMobile()) { return $app->redirect("/login/?redirect=lightbox"); } elseif ($app['browser']->isNewGeneration()) { @@ -90,7 +89,7 @@ return call_user_func(function($environment = null) { } }); - $app->get('/robots.txt', function(SilexApp $app) { + $app->get('/robots.txt', function(PhraseaApplication $app) { if ($app['phraseanet.registry']->get('GV_allow_search_engine') === true) { $buffer = "User-Agent: *\n" . "Allow: /\n";