From 2783790b8f13eb84785f1930bce56569c2f63f64 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Fri, 30 Mar 2012 14:58:43 +0200 Subject: [PATCH 1/2] Remove upload access when useless --- templates/web/common/menubar.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/web/common/menubar.twig b/templates/web/common/menubar.twig index 3dc85e9d3b..a38bf668c6 100644 --- a/templates/web/common/menubar.twig +++ b/templates/web/common/menubar.twig @@ -76,6 +76,7 @@ {# MODULE #} + {% if user.ACL.has_access_to_module('upload') %}
  • @@ -83,6 +84,7 @@
  • + {% endif %} {# MODULE #} {% if module == "prod" or module == "client" %} From c953190ed65afbbbcde2ade6d6809ca720f541bb Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Fri, 30 Mar 2012 14:59:38 +0200 Subject: [PATCH 2/2] Fix error page --- www/include/error.php | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/www/include/error.php b/www/include/error.php index 8583f9b657..eeddafcffd 100644 --- a/www/include/error.php +++ b/www/include/error.php @@ -14,11 +14,27 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -$Core = include_once __DIR__ . '/../../lib/bootstrap.php'; +$request = Symfony\Component\HttpFoundation\Request::createFromGlobals(); -$appbox = appbox::get_instance($Core); -$session = $appbox->get_session(); -phrasea::use_i18n(Session_Handler::get_locale()); +$locales = \Alchemy\Phrasea\Core::getAvailableLanguages(); + +$current_locale = \Session_Handler::get_locale(); + +if (!$current_locale) +{ + foreach ($locales as $code => $locale) + { + if ($request->getLocale() == $locale) + { + $current_locale = $locale; + break; + } + } + if (!$current_locale) + $current_locale = 'fr_FR'; +} + +phrasea::use_i18n($current_locale); $request = http_request::getInstance();