fix: Allow to install on database error.

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2022-06-18 19:33:46 +02:00
parent 7ad4ed42b0
commit 38b036cc2f
3 changed files with 29 additions and 4 deletions

View File

@@ -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;

View File

@@ -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';

View File

@@ -1,4 +1,27 @@
<?php
/*
* sysPass
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
* sysPass is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* sysPass is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with sysPass. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @var ThemeIcons $icons
* @var \SP\Mvc\View\TemplateInterface $this
@@ -19,7 +42,7 @@ use SP\Mvc\View\Template;
<?php echo __('Back'); ?>
</button>
<a class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored"
href="index.php?r=install">
href="index.php?r=install&skipInstalled=true">
<?php echo __('Install'); ?>
<i class="material-icons"
title="<?php echo __('Install'); ?>"><?php echo $icons->getIconPlay()->getIcon(); ?></i>