Cleanup root

This commit is contained in:
Romain Neutron
2012-10-04 22:04:19 +02:00
parent 4b1623a548
commit 246376d72f

View File

@@ -55,7 +55,6 @@ use Alchemy\Phrasea\Controller\Prod\UsrLists;
use Alchemy\Phrasea\Controller\Prod\WorkZone; use Alchemy\Phrasea\Controller\Prod\WorkZone;
use Alchemy\Phrasea\Controller\Utils\ConnectionTest; use Alchemy\Phrasea\Controller\Utils\ConnectionTest;
use Alchemy\Phrasea\Controller\Utils\PathFileTest; use Alchemy\Phrasea\Controller\Utils\PathFileTest;
use Silex\Application as SilexApp;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -70,7 +69,7 @@ return call_user_func(function($environment = null) {
}); });
$app->before(function(Request $request) use ($app) { $app->before(function(Request $request) use ($app) {
if (!$app->isAuthenticated() && $request->cookies->has('persistent')) { if ($request->cookies->has('persistent') && !$app->isAuthenticated()) {
try { try {
$auth = new \Session_Authentication_PersistentCookie($app, $request->cookies->get('persistent')); $auth = new \Session_Authentication_PersistentCookie($app, $request->cookies->get('persistent'));
$app->openAccount($auth, $auth->getSessionId()); $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()) { if ($app['browser']->isMobile()) {
return $app->redirect("/login/?redirect=lightbox"); return $app->redirect("/login/?redirect=lightbox");
} elseif ($app['browser']->isNewGeneration()) { } 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) { if ($app['phraseanet.registry']->get('GV_allow_search_engine') === true) {
$buffer = "User-Agent: *\n" . "Allow: /\n"; $buffer = "User-Agent: *\n" . "Allow: /\n";