Skip to content

Commit

Permalink
[BUGFIX] Show always Install Tool's login form if permanently enabled
Browse files Browse the repository at this point in the history
If the file `ENABLE_INSTALL_TOOL` with the content `KEEP_FILE` is
available, the login form must be shown instead of the template
`ShowEnableInstallToolFile`.

Additionally the button to lock the Install Tool is switched to a
warning instead.

Resolves: #85656
Releases: master, 9.5
Change-Id: I3aed824d099f23b48be0bed890935b9d244953b0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63853
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Susanne Moog <look@susi.dev>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Susanne Moog <look@susi.dev>
  • Loading branch information
susannemoog committed Mar 23, 2020
1 parent 05a62e5 commit 41488ce
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 2 additions & 0 deletions typo3/sysext/install/Classes/Controller/LoginController.php
Expand Up @@ -20,6 +20,7 @@
use TYPO3\CMS\Core\FormProtection\FormProtectionFactory;
use TYPO3\CMS\Core\FormProtection\InstallToolFormProtection;
use TYPO3\CMS\Core\Http\JsonResponse;
use TYPO3\CMS\Install\Service\EnableFileService;

/**
* Login controller
Expand Down Expand Up @@ -55,6 +56,7 @@ public function showLoginAction(ServerRequestInterface $request): ResponseInterf
$view->assignMultiple([
'siteName' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
'loginToken' => $formProtection->generateToken('installTool', 'login'),
'installToolEnableFilePermanent' => EnableFileService::isInstallToolEnableFilePermanent(),
]);
return new JsonResponse([
'success' => true,
Expand Down
5 changes: 5 additions & 0 deletions typo3/sysext/install/Classes/Http/RequestHandler.php
Expand Up @@ -97,6 +97,11 @@ public function handle(ServerRequestInterface $request): ResponseInterface
{
$controllerName = $request->getQueryParams()['install']['controller'] ?? 'layout';
$actionName = $request->getParsedBody()['install']['action'] ?? $request->getQueryParams()['install']['action'] ?? 'init';

if ($actionName === 'showEnableInstallToolFile' && EnableFileService::isInstallToolEnableFilePermanent()) {
$actionName = 'showLogin';
}

$action = $actionName . 'Action';

$session = $this->initializeSession();
Expand Down
Expand Up @@ -17,15 +17,28 @@ <h1 class="logo-pageheader">
<button type="button" class="btn btn-default btn-success t3js-login-login">
Login
</button>
<button type="button" class="btn btn-default btn-danger pull-right t3js-login-lockInstallTool">
<i class="fa fa-lock"></i> Lock Install Tool again
</button>
<f:if condition="!{installToolEnableFilePermanent}">
<button type="button" class="btn btn-default btn-danger pull-right t3js-login-lockInstallTool">
<i class="fa fa-lock"></i> Lock Install Tool again
</button>
</f:if>
</form>
</div>
<div id="t3-install-box-border-bottom">&nbsp;</div>

<div class="t3js-login-output"></div>

<f:if condition="{installToolEnableFilePermanent}">
<div class="panel panel-danger">
<div class="panel-heading"><h3 class="panel-title">Install Tool is permanently enabled</h3></div>
<div class="panel-body">
The Install Tool is permanently enabled because our <code>ENABLE_INSTALL_TOOL</code> file contains
the text <em>KEEP_FILE</em>.<br />
Never use this on production systems!
</div>
</div>
</f:if>

<div class="panel panel-info">
<div class="panel-heading"><h3 class="panel-title">Information</h3></div>
<div class="panel-body">
Expand Down

0 comments on commit 41488ce

Please sign in to comment.