diff --git a/Phraseanet-production-client/config/config.js b/Phraseanet-production-client/config/config.js index a80d4c2d74..4d14f1e9e7 100644 --- a/Phraseanet-production-client/config/config.js +++ b/Phraseanet-production-client/config/config.js @@ -13,5 +13,5 @@ module.exports = { setupDir: _root + 'tests/setup/node.js', karmaConf: _root + 'config/karma.conf.js', // change this version when you change JS file for lazy loading - assetFileVersion: 95 + assetFileVersion: 96 }; diff --git a/Phraseanet-production-client/dist/authenticate.js b/Phraseanet-production-client/dist/authenticate.js index c481923e4c..d0cca781fb 100644 --- a/Phraseanet-production-client/dist/authenticate.js +++ b/Phraseanet-production-client/dist/authenticate.js @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=95"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=96"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/authenticate.min.js b/Phraseanet-production-client/dist/authenticate.min.js index 8e97739776..52711bcba4 100644 --- a/Phraseanet-production-client/dist/authenticate.min.js +++ b/Phraseanet-production-client/dist/authenticate.min.js @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=95"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=96"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/commons.js b/Phraseanet-production-client/dist/commons.js index fcaf2f0225..4cc1a64f11 100644 --- a/Phraseanet-production-client/dist/commons.js +++ b/Phraseanet-production-client/dist/commons.js @@ -91,7 +91,7 @@ /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=95"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=96"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/commons.min.js b/Phraseanet-production-client/dist/commons.min.js index ab39527929..75d2c8e4f3 100644 --- a/Phraseanet-production-client/dist/commons.min.js +++ b/Phraseanet-production-client/dist/commons.min.js @@ -91,7 +91,7 @@ /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=95"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=96"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/lightbox.js b/Phraseanet-production-client/dist/lightbox.js index aac0a3a98f..5f1b857913 100644 --- a/Phraseanet-production-client/dist/lightbox.js +++ b/Phraseanet-production-client/dist/lightbox.js @@ -1249,6 +1249,11 @@ var download = function download(services) { success: function success(data) { $dialog.setContent(data); _onDownloadReady($dialog, window.exportConfig); + }, + error: function error(data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } } }); diff --git a/Phraseanet-production-client/dist/lightbox.min.js b/Phraseanet-production-client/dist/lightbox.min.js index aac0a3a98f..5f1b857913 100644 --- a/Phraseanet-production-client/dist/lightbox.min.js +++ b/Phraseanet-production-client/dist/lightbox.min.js @@ -1249,6 +1249,11 @@ var download = function download(services) { success: function success(data) { $dialog.setContent(data); _onDownloadReady($dialog, window.exportConfig); + }, + error: function error(data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } } }); diff --git a/Phraseanet-production-client/dist/production.js b/Phraseanet-production-client/dist/production.js index 1f4247784a..b56a199c35 100644 --- a/Phraseanet-production-client/dist/production.js +++ b/Phraseanet-production-client/dist/production.js @@ -4391,6 +4391,10 @@ var sharebasketModal = function sharebasketModal(services, datas) { $dialog.setContent(data); _onDialogReady(); return; + }).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } }); return true; @@ -5543,8 +5547,11 @@ var editRecord = function editRecord(services) { (0, _jquery2.default)('#tooltip').hide(); return; }, - error: function error(XHR, textStatus, errorThrown) { - if (XHR.status === 0) { + error: function error(data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } + if (data.status === 0) { return false; } } @@ -7487,6 +7494,11 @@ var exportRecord = function exportRecord(services) { } else { _onExportReady($dialog, window.exportConfig); } + }, + error: function error(data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } } }); @@ -19941,6 +19953,10 @@ var basketCreate = function basketCreate(services) { $dialog.setContent(data); _onDialogReady(); return; + }).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } }); }; @@ -20073,6 +20089,11 @@ var storyCreate = function storyCreate(services) { _onDialogReady(); return; + }, + error: function error(data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } } }); }; @@ -20280,6 +20301,10 @@ var basketUpdate = function basketUpdate(services) { $dialog.setContent(data); _onDialogReady(); return; + }).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } }); }; @@ -62758,6 +62783,10 @@ var recordToolsModal = function recordToolsModal(services, datas) { $dialog.setOption('contextArgs', datas); _onModalReady(data, window.toolsConfig, activeTab); return; + }).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } }); }; diff --git a/Phraseanet-production-client/dist/production.min.js b/Phraseanet-production-client/dist/production.min.js index 1f4247784a..b56a199c35 100644 --- a/Phraseanet-production-client/dist/production.min.js +++ b/Phraseanet-production-client/dist/production.min.js @@ -4391,6 +4391,10 @@ var sharebasketModal = function sharebasketModal(services, datas) { $dialog.setContent(data); _onDialogReady(); return; + }).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } }); return true; @@ -5543,8 +5547,11 @@ var editRecord = function editRecord(services) { (0, _jquery2.default)('#tooltip').hide(); return; }, - error: function error(XHR, textStatus, errorThrown) { - if (XHR.status === 0) { + error: function error(data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } + if (data.status === 0) { return false; } } @@ -7487,6 +7494,11 @@ var exportRecord = function exportRecord(services) { } else { _onExportReady($dialog, window.exportConfig); } + }, + error: function error(data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } } }); @@ -19941,6 +19953,10 @@ var basketCreate = function basketCreate(services) { $dialog.setContent(data); _onDialogReady(); return; + }).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } }); }; @@ -20073,6 +20089,11 @@ var storyCreate = function storyCreate(services) { _onDialogReady(); return; + }, + error: function error(data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } } }); }; @@ -20280,6 +20301,10 @@ var basketUpdate = function basketUpdate(services) { $dialog.setContent(data); _onDialogReady(); return; + }).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } }); }; @@ -62758,6 +62783,10 @@ var recordToolsModal = function recordToolsModal(services, datas) { $dialog.setOption('contextArgs', datas); _onModalReady(data, window.toolsConfig, activeTab); return; + }).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } }); }; diff --git a/Phraseanet-production-client/src/components/basket/create.js b/Phraseanet-production-client/src/components/basket/create.js index f32d125b58..45a4438b50 100644 --- a/Phraseanet-production-client/src/components/basket/create.js +++ b/Phraseanet-production-client/src/components/basket/create.js @@ -40,7 +40,13 @@ const basketCreate = (services) => { $dialog.setContent(data); _onDialogReady(); return; - }); + }) + .fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } + }) + ; }; const _onDialogReady = () => { diff --git a/Phraseanet-production-client/src/components/basket/update.js b/Phraseanet-production-client/src/components/basket/update.js index a6d08e2750..ebbb1d666a 100644 --- a/Phraseanet-production-client/src/components/basket/update.js +++ b/Phraseanet-production-client/src/components/basket/update.js @@ -43,7 +43,12 @@ const basketUpdate = (services) => { $dialog.setContent(data); _onDialogReady(); return; - }); + }).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } + }) + ; }; const _onDialogReady = () => { diff --git a/Phraseanet-production-client/src/components/lightbox/download.js b/Phraseanet-production-client/src/components/lightbox/download.js index 6c88005555..3059e7c1fb 100644 --- a/Phraseanet-production-client/src/components/lightbox/download.js +++ b/Phraseanet-production-client/src/components/lightbox/download.js @@ -32,6 +32,11 @@ const download = (services) => { success: function (data) { $dialog.setContent(data); _onDownloadReady($dialog, window.exportConfig); + }, + error: function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } } }); diff --git a/Phraseanet-production-client/src/components/record/edit.js b/Phraseanet-production-client/src/components/record/edit.js index 0a234334b1..7e060e60da 100644 --- a/Phraseanet-production-client/src/components/record/edit.js +++ b/Phraseanet-production-client/src/components/record/edit.js @@ -74,8 +74,11 @@ const editRecord = (services) => { $('#tooltip').hide(); return; }, - error: function (XHR, textStatus, errorThrown) { - if (XHR.status === 0) { + error: function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } + if (data.status === 0) { return false; } } diff --git a/Phraseanet-production-client/src/components/record/export.js b/Phraseanet-production-client/src/components/record/export.js index ada1d1fe66..7d73bf6756 100644 --- a/Phraseanet-production-client/src/components/record/export.js +++ b/Phraseanet-production-client/src/components/record/export.js @@ -58,6 +58,11 @@ const exportRecord = services => { } else { _onExportReady($dialog, window.exportConfig); } + }, + error: function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } } }); diff --git a/Phraseanet-production-client/src/components/record/sharebasketModal.js b/Phraseanet-production-client/src/components/record/sharebasketModal.js index 3ea16070be..751f954331 100644 --- a/Phraseanet-production-client/src/components/record/sharebasketModal.js +++ b/Phraseanet-production-client/src/components/record/sharebasketModal.js @@ -25,7 +25,12 @@ const sharebasketModal = (services, datas) => { $dialog.setContent(data); _onDialogReady(); return; - }); + }).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } + }) + ; return true; }; diff --git a/Phraseanet-production-client/src/components/record/tools/index.js b/Phraseanet-production-client/src/components/record/tools/index.js index 8343e2a825..23f4be3454 100644 --- a/Phraseanet-production-client/src/components/record/tools/index.js +++ b/Phraseanet-production-client/src/components/record/tools/index.js @@ -36,7 +36,11 @@ const recordToolsModal = (services, datas, activeTab = false) => { _onModalReady(data, window.toolsConfig, activeTab); return; } - ); + ).fail(function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } + }); }; diff --git a/Phraseanet-production-client/src/components/story/create.js b/Phraseanet-production-client/src/components/story/create.js index aceb208888..504ee821eb 100644 --- a/Phraseanet-production-client/src/components/story/create.js +++ b/Phraseanet-production-client/src/components/story/create.js @@ -50,7 +50,12 @@ const storyCreate = (services) => { _onDialogReady(); return; - } + }, + error: function (data) { + if (data.status === 403 && data.getResponseHeader('x-phraseanet-end-session')) { + self.location.replace(self.location.href); // refresh will redirect to login + } + }, }); }; diff --git a/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php b/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php index ffca44fd5d..a2a2391d84 100644 --- a/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php +++ b/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php @@ -62,7 +62,7 @@ public function getGlobals() { return [ // change this version when you change JS file to force the navigation to reload js file - 'assetFileVersion' => 95 + 'assetFileVersion' => 96 ]; }