Skip to content
Snippets Groups Projects
Commit 4907c200 authored by Ernesto Baschny's avatar Ernesto Baschny Committed by Christian Kuhn
Browse files

[FEATURE] Allow to disable "Core Updater": not only optically

Follow-up to "Allow to disable the "Core Updater" through an env-variable".
Now it's not even possible to call the individual Ajax requests that do the
update if it is disabled.

Resolves: #52639
Releases: 6.2
Change-Id: Icfa18d619bbb8aabf1896920f28fe5a63bd5c345
Reviewed-on: https://review.typo3.org/24661
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
parent 7fff86d8
No related merge requests found
......@@ -62,6 +62,12 @@ abstract class AbstractCoreUpdate extends Action\AbstractAction {
* @return void
*/
protected function initializeCoreUpdate() {
if (!$this->coreUpdateService->isCoreUpdateEnabled()) {
throw new \TYPO3\CMS\Install\Controller\Exception(
'Core Update disabled in this environment',
1381609294
);
}
$this->loadExtLocalconfDatabaseAndExtTables();
}
......
......@@ -78,8 +78,10 @@ class ImportantActions extends Action\AbstractAction implements Action\ActionInt
? TRUE
: FALSE;
/** @var \TYPO3\CMS\Install\Service\CoreUpdateService $coreUpdateService */
$coreUpdateService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\CoreUpdateService');
$this->view
->assign('enableCoreUpdate', $this->isCoreUpdateEnabled())
->assign('enableCoreUpdate', $coreUpdateService->isCoreUpdateEnabled())
->assign('operatingSystem', $operatingSystem)
->assign('cgiDetected', $cgiDetected)
->assign('databaseName', $GLOBALS['TYPO3_CONF_VARS']['DB']['database'])
......@@ -93,15 +95,6 @@ class ImportantActions extends Action\AbstractAction implements Action\ActionInt
return $this->view->render();
}
/**
* Check if this installation wants to enable the core updater
*
* @return boolean
*/
protected function isCoreUpdateEnabled() {
return (getenv('TYPO3_DISABLE_CORE_UPDATER') !== '1');
}
/**
* Set new password if requested
*
......
......@@ -88,6 +88,15 @@ class CoreUpdateService {
$this->downloadBaseUri = $this->coreVersionService->getDownloadBaseUri();
}
/**
* Check if this installation wants to enable the core updater
*
* @return boolean
*/
public function isCoreUpdateEnabled() {
return (getenv('TYPO3_DISABLE_CORE_UPDATER') !== '1');
}
/**
* In future implementations we might implement some sarter logic here
*
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment