before(function () use ($app) { $app['phraseanet.core']['Firewall']->requireSetup($app); }); $app->get('/', function(SilexApp $app) { if ($app['browser']->isMobile()) { return $app->redirect("/login/?redirect=/lightbox"); } elseif ($app['browser']->isNewGeneration()) { return $app->redirect("/login/?redirect=/prod"); } else { return $app->redirect("/login/?redirect=/client"); } }); $app->get('/robots.txt', function(SilexApp $app) { if ($app['phraseanet.core']['Registry']->get('GV_allow_search_engine') === true) { $buffer = "User-Agent: *\n" . "Allow: /\n"; } else { $buffer = "User-Agent: *\n" . "Disallow: /\n"; } return new Response($buffer, 200, array('Content-Type' => 'text/plain')); })->bind('robots'); $app->mount('/feeds/', new RSSFeeds()); $app->mount('/account/', new Account()); $app->mount('/login/authenticate/', new AuthenticateController()); $app->mount('/login/', new Login()); $app->mount('/developers/', new Developers()); return $app; } );