From 2c9f54272813a92164ba682aa9d1967754c3246f Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 3 Feb 2014 15:49:15 +0100 Subject: [PATCH 1/4] Move jquery context menu files to their directory --- .../cmenu-gloss-cyan-menu-item-hover.gif | Bin .../cmenu-gloss-menu-item-hover.gif | Bin .../cmenu-gloss-semitransparent-menu-item-hover.png | Bin .../cmenu-human-menu-item-hover.gif | Bin .../cmenu-osx-menu-item-hover.gif | Bin .../jquery.contextmenu.images/cmenu-vista-bg.gif | Bin .../cmenu-vista-menu-item-hover.gif | Bin .../jquery.contextmenu.images/cmenu-xp-bg.gif | Bin 8 files changed, 0 insertions(+), 0 deletions(-) rename www/include/{ => jslibs}/jquery.contextmenu.images/cmenu-gloss-cyan-menu-item-hover.gif (100%) rename www/include/{ => jslibs}/jquery.contextmenu.images/cmenu-gloss-menu-item-hover.gif (100%) rename www/include/{ => jslibs}/jquery.contextmenu.images/cmenu-gloss-semitransparent-menu-item-hover.png (100%) rename www/include/{ => jslibs}/jquery.contextmenu.images/cmenu-human-menu-item-hover.gif (100%) rename www/include/{ => jslibs}/jquery.contextmenu.images/cmenu-osx-menu-item-hover.gif (100%) rename www/include/{ => jslibs}/jquery.contextmenu.images/cmenu-vista-bg.gif (100%) rename www/include/{ => jslibs}/jquery.contextmenu.images/cmenu-vista-menu-item-hover.gif (100%) rename www/include/{ => jslibs}/jquery.contextmenu.images/cmenu-xp-bg.gif (100%) diff --git a/www/include/jquery.contextmenu.images/cmenu-gloss-cyan-menu-item-hover.gif b/www/include/jslibs/jquery.contextmenu.images/cmenu-gloss-cyan-menu-item-hover.gif similarity index 100% rename from www/include/jquery.contextmenu.images/cmenu-gloss-cyan-menu-item-hover.gif rename to www/include/jslibs/jquery.contextmenu.images/cmenu-gloss-cyan-menu-item-hover.gif diff --git a/www/include/jquery.contextmenu.images/cmenu-gloss-menu-item-hover.gif b/www/include/jslibs/jquery.contextmenu.images/cmenu-gloss-menu-item-hover.gif similarity index 100% rename from www/include/jquery.contextmenu.images/cmenu-gloss-menu-item-hover.gif rename to www/include/jslibs/jquery.contextmenu.images/cmenu-gloss-menu-item-hover.gif diff --git a/www/include/jquery.contextmenu.images/cmenu-gloss-semitransparent-menu-item-hover.png b/www/include/jslibs/jquery.contextmenu.images/cmenu-gloss-semitransparent-menu-item-hover.png similarity index 100% rename from www/include/jquery.contextmenu.images/cmenu-gloss-semitransparent-menu-item-hover.png rename to www/include/jslibs/jquery.contextmenu.images/cmenu-gloss-semitransparent-menu-item-hover.png diff --git a/www/include/jquery.contextmenu.images/cmenu-human-menu-item-hover.gif b/www/include/jslibs/jquery.contextmenu.images/cmenu-human-menu-item-hover.gif similarity index 100% rename from www/include/jquery.contextmenu.images/cmenu-human-menu-item-hover.gif rename to www/include/jslibs/jquery.contextmenu.images/cmenu-human-menu-item-hover.gif diff --git a/www/include/jquery.contextmenu.images/cmenu-osx-menu-item-hover.gif b/www/include/jslibs/jquery.contextmenu.images/cmenu-osx-menu-item-hover.gif similarity index 100% rename from www/include/jquery.contextmenu.images/cmenu-osx-menu-item-hover.gif rename to www/include/jslibs/jquery.contextmenu.images/cmenu-osx-menu-item-hover.gif diff --git a/www/include/jquery.contextmenu.images/cmenu-vista-bg.gif b/www/include/jslibs/jquery.contextmenu.images/cmenu-vista-bg.gif similarity index 100% rename from www/include/jquery.contextmenu.images/cmenu-vista-bg.gif rename to www/include/jslibs/jquery.contextmenu.images/cmenu-vista-bg.gif diff --git a/www/include/jquery.contextmenu.images/cmenu-vista-menu-item-hover.gif b/www/include/jslibs/jquery.contextmenu.images/cmenu-vista-menu-item-hover.gif similarity index 100% rename from www/include/jquery.contextmenu.images/cmenu-vista-menu-item-hover.gif rename to www/include/jslibs/jquery.contextmenu.images/cmenu-vista-menu-item-hover.gif diff --git a/www/include/jquery.contextmenu.images/cmenu-xp-bg.gif b/www/include/jslibs/jquery.contextmenu.images/cmenu-xp-bg.gif similarity index 100% rename from www/include/jquery.contextmenu.images/cmenu-xp-bg.gif rename to www/include/jslibs/jquery.contextmenu.images/cmenu-xp-bg.gif From 40506247f3d5152f0a48127c566cc4e464a4d2af Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 3 Feb 2014 15:49:24 +0100 Subject: [PATCH 2/4] Fix client template --- templates/web/client/index.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/web/client/index.html.twig b/templates/web/client/index.html.twig index 7e9ffae0ec..dfa0ca581d 100644 --- a/templates/web/client/index.html.twig +++ b/templates/web/client/index.html.twig @@ -197,16 +197,16 @@ {% set status_bit_filters = '' %} {% for bit, data in databox.get_statusbits() if data['searchable'] %} {% set html_status_bit %} -
' . +
- + - +
From 5a8d60ab86a50085f15b7a630d4915a7b7cd77c5 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 3 Feb 2014 16:15:26 +0100 Subject: [PATCH 3/4] Pimp error message --- lib/Alchemy/Phrasea/Controller/Datafiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Controller/Datafiles.php b/lib/Alchemy/Phrasea/Controller/Datafiles.php index be7a734321..49b5848efa 100644 --- a/lib/Alchemy/Phrasea/Controller/Datafiles.php +++ b/lib/Alchemy/Phrasea/Controller/Datafiles.php @@ -33,7 +33,7 @@ class Datafiles extends AbstractDelivery $controllers->before(function (Request $request) use ($app) { if (!$app['authentication']->isAuthenticated()) { - $app->abort(403, 'You are not autorized to see this'); + $app->abort(403, sprintf('You are not authorized to access %s', $request->getRequestUri())); } }); From cb82e6047db89187fc516371220350c78b225aca Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 3 Feb 2014 16:16:20 +0100 Subject: [PATCH 4/4] Enhance error messages --- lib/Alchemy/Phrasea/Application.php | 7 +++++++ lib/Alchemy/Phrasea/Application/Api.php | 7 +++++++ lib/Alchemy/Phrasea/Application/Root.php | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index b5710d03aa..428b9392ba 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -105,6 +105,8 @@ use Alchemy\Phrasea\Twig\JSUniqueID; use Alchemy\Phrasea\Twig\Camelize; use Alchemy\Phrasea\Twig\BytesConverter; use FFMpeg\FFMpegServiceProvider; +use Monolog\Logger; +use Monolog\Processor\IntrospectionProcessor; use Neutron\Silex\Provider\ImagineServiceProvider; use MediaVorus\MediaVorusServiceProvider; use MediaVorus\Utils\RawImageMimeTypeGuesser; @@ -250,6 +252,11 @@ class Application extends SilexApplication $this['monolog.handler'] = $this->share(function () { return new NullHandler(); }); + $this['monolog'] = $this->share($this->extend('monolog', function (Logger $monolog) { + $monolog->pushProcessor(new IntrospectionProcessor()); + + return $monolog; + })); $this->register(new MP4BoxServiceProvider()); $this->register(new NotificationDelivererServiceProvider()); $this->register(new ORMServiceProvider()); diff --git a/lib/Alchemy/Phrasea/Application/Api.php b/lib/Alchemy/Phrasea/Application/Api.php index 98034a0875..431c81bba3 100644 --- a/lib/Alchemy/Phrasea/Application/Api.php +++ b/lib/Alchemy/Phrasea/Application/Api.php @@ -19,6 +19,8 @@ use Alchemy\Phrasea\Core\Event\ApiLoadEndEvent; use Alchemy\Phrasea\Core\Event\ApiLoadStartEvent; use Alchemy\Phrasea\Core\Event\Subscriber\ApiOauth2ErrorsSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\ApiExceptionHandlerSubscriber; +use Monolog\Logger; +use Monolog\Processor\WebProcessor; use Silex\Application as SilexApplication; use Symfony\Component\HttpFoundation\Request; @@ -30,6 +32,11 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) { $app['exception_handler'] = $app->share(function ($app) { return new ApiExceptionHandlerSubscriber($app); }); + $app['monolog'] = $app->share($app->extend('monolog', function (Logger $monolog) { + $monolog->pushProcessor(new WebProcessor()); + + return $monolog; + })); $app->register(new \API_V1_Timer()); $app['dispatcher']->dispatch(PhraseaEvents::API_LOAD_START, new ApiLoadStartEvent()); diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php index 2f51f99379..ee8d47e912 100644 --- a/lib/Alchemy/Phrasea/Application/Root.php +++ b/lib/Alchemy/Phrasea/Application/Root.php @@ -17,6 +17,8 @@ use Alchemy\Phrasea\Core\Event\Subscriber\BridgeExceptionSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\FirewallSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\JsonRequestSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\DebuggerSubscriber; +use Monolog\Logger; +use Monolog\Processor\WebProcessor; use Silex\Provider\WebProfilerServiceProvider; use Symfony\Component\HttpFoundation\Request; @@ -28,6 +30,11 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) { $app['exception_handler'] = $app->share(function ($app) { return new PhraseaExceptionHandlerSubscriber($app['phraseanet.exception_handler']); }); + $app['monolog'] = $app->share($app->extend('monolog', function (Logger $monolog) { + $monolog->pushProcessor(new WebProcessor()); + + return $monolog; + })); $app->before(function (Request $request) use ($app) { if (0 === strpos($request->getPathInfo(), '/setup')) {