diff --git a/Dockerfile b/Dockerfile index b8b7abe7eb538c38d3706d84f00ba004b39809f6..cdb5caac0e1f709e33404c746ad9a1087a7f0c1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -220,6 +220,7 @@ RUN patch -u ${BASE_DIR}/apps/dav/lib/Connector/Sabre/Principal.php -i ${TMP_PAT RUN patch -u ${BASE_DIR}/apps/dav/lib/HookManager.php -i ${TMP_PATCH_DIR}/028-default-task-calendar.patch RUN patch -u ${BASE_DIR}/apps/provisioning_api/lib/Controller/UsersController.php -i ${TMP_PATCH_DIR}/029-restrict-user-to-change-primary-email.patch RUN patch -u ${BASE_DIR}/lib/private/Security/VerificationToken/VerificationToken.php -i ${TMP_PATCH_DIR}/033-verification-token-private.patch +RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/035-display-back-to-login.patch RUN rm -rf ${TMP_PATCH_DIR} RUN curl -fsSL -o ldap_write_support.tar.gz \ diff --git a/patches/035-display-back-to-login.patch b/patches/035-display-back-to-login.patch new file mode 100644 index 0000000000000000000000000000000000000000..5078e214de33739e549e1e25a0c0ad63901d2941 --- /dev/null +++ b/patches/035-display-back-to-login.patch @@ -0,0 +1,36 @@ +Subject: [PATCH] This patch display a back to login link in error page when encountering a 401 HTTP Error code + +diff --git a/core/templates/error.php b/core/templates/error.php +index 2e5488ae8d..72c58e3bcf 100644 +--- core/templates/error.php ++++ core/templates/error.php +@@ -10,4 +10,7 @@ + + + ++ ++ t('Back to login')) ?> ++ + +diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php +index 0c9fa1ccc0..6792f2268e 100644 +--- lib/private/legacy/OC_Template.php ++++ lib/private/legacy/OC_Template.php +@@ -279,7 +279,7 @@ class OC_Template extends \OC\Template\Base { + * @param int $statusCode + * @suppress PhanAccessMethodInternal + */ +- public static function printErrorPage($error_msg, $hint = '', $statusCode = 500) { ++ public static function printErrorPage($error_msg, $hint = '', $statusCode = 500, $logoutUrl = null) { + if (\OC::$server->getAppManager()->isEnabledForUser('theming') && !\OC_App::isAppLoaded('theming')) { + \OC_App::loadApp('theming'); + } +@@ -295,6 +295,8 @@ class OC_Template extends \OC\Template\Base { + $content = new \OC_Template('', 'error', 'error', false); + $errors = [['error' => $error_msg, 'hint' => $hint]]; + $content->assign('errors', $errors); ++ if($statusCode === 401) ++ $content->assign('logout_url', $logoutUrl != null ? $logoutUrl : OC_User::getLogoutUrl(\OC::$server->getURLGenerator())); + $content->printPage(); + } catch (\Exception $e) { + $logger = \OC::$server->getLogger();