From 38b036cc2f228c90e0822a76149ca2db2c48ee4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20D?= Date: Sat, 18 Jun 2022 19:33:46 +0200 Subject: [PATCH] fix: Allow to install on database error. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rubén D --- .../Controllers/Install/IndexController.php | 4 ++- app/modules/web/Init.php | 4 +-- .../views/error/error-database.inc | 25 ++++++++++++++++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/app/modules/web/Controllers/Install/IndexController.php b/app/modules/web/Controllers/Install/IndexController.php index 78995962..464fee0c 100644 --- a/app/modules/web/Controllers/Install/IndexController.php +++ b/app/modules/web/Controllers/Install/IndexController.php @@ -38,7 +38,9 @@ final class IndexController extends ControllerBase { public function indexAction(): void { - if ($this->configData->isInstalled()) { + $skipInstalled = $this->request->analyzeBool('skipInstalled', false); + + if ($skipInstalled === false && $this->configData->isInstalled()) { $this->router->response()->redirect('index.php?r=login'); return; diff --git a/app/modules/web/Init.php b/app/modules/web/Init.php index c5c0465c..f5bf77c0 100644 --- a/app/modules/web/Init.php +++ b/app/modules/web/Init.php @@ -4,7 +4,7 @@ * * @author nuxsmin * @link https://syspass.org - * @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org + * @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org * * This file is part of sysPass. * @@ -86,7 +86,7 @@ final class Init extends HttpModuleBase * List of controllers that don't need to update the user's session activity */ private const NO_SESSION_ACTIVITY = ['items', 'login']; - public const ROUTE_INSTALL = 'install/index'; + public const ROUTE_INSTALL = 'install'; public const ROUTE_ERROR_DATABASE_CONNECTION = 'error/databaseConnection'; public const ROUTE_ERROR_MAINTENANCE = 'error/maintenanceError'; public const ROUTE_ERROR_DATABASE = 'error/databaseError'; diff --git a/app/modules/web/themes/material-blue/views/error/error-database.inc b/app/modules/web/themes/material-blue/views/error/error-database.inc index 8c454fee..ed9c0298 100644 --- a/app/modules/web/themes/material-blue/views/error/error-database.inc +++ b/app/modules/web/themes/material-blue/views/error/error-database.inc @@ -1,4 +1,27 @@ . + */ + /** * @var ThemeIcons $icons * @var \SP\Mvc\View\TemplateInterface $this @@ -19,7 +42,7 @@ use SP\Mvc\View\Template; + href="index.php?r=install&skipInstalled=true"> getIconPlay()->getIcon(); ?>