[FEATURE][INSTALL] Automatically create INSTALL_TOOL_ENABLE file
authorSteffen Gebert <steffen.gebert@typo3.org>
Sun, 31 Jul 2011 19:10:41 +0000 (21:10 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Tue, 2 Aug 2011 08:39:17 +0000 (10:39 +0200)
The INSTALL_TOOL_ENABLE file is automatically created, if a backend
administrator opens the Install Tool from the backend.

Change-Id: I10ccf35f787ffdfec7becfd182b13e986258fe4a
Resolves: #28621
Reviewed-on: http://review.typo3.org/3959
Reviewed-by: Chris Zepernick
Reviewed-by: Ingo Pfennigstorf
Tested-by: Ingo Pfennigstorf
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
typo3/sysext/install/ext_autoload.php
typo3/sysext/install/ext_tables.php
typo3/sysext/install/mod/conf.php
typo3/sysext/install/mod/index.php [new file with mode: 0755]
typo3/sysext/install/mod/install.gif [changed mode: 0755->0644]

index 6c5a956..a1d0f38 100644 (file)
@@ -6,6 +6,7 @@
 $extPath = t3lib_extMgm::extPath('install');
 return array(
        'tx_install_report_installstatus' => $extPath . 'report/class.tx_install_report_installstatus.php',
+       'tx_install_service_basicservice' => $extPath . 'Classes/Service/BasicService.php',
        'tx_install_updates_base' => $extPath . 'Classes/Updates/Base.php'
 );
 
index 2d0250a..bcb97d4 100755 (executable)
@@ -1,7 +1,8 @@
 <?php
 if (!defined ('TYPO3_MODE'))   die ('Access denied.');
 
-if (TYPO3_MODE=='BE') {
+if (TYPO3_MODE === 'BE') {
+       t3lib_extMgm::addModulePath('tools_install',t3lib_extMgm::extPath ($_EXTKEY) . 'mod/');
        t3lib_extMgm::addModule('tools', 'install', '', t3lib_extMgm::extPath($_EXTKEY) . 'mod/');
 
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['typo3'][] = 'tx_install_report_InstallStatus';
index d9455bc..28508f3 100755 (executable)
@@ -5,8 +5,9 @@ $BACK_PATH='../../../';
 $MLANG['default']['tabs_images']['tab'] = 'install.gif';
 $MLANG['default']['ll_ref']='LLL:EXT:install/mod/locallang_mod.xml';
 
-$MCONF['script']=$BACK_PATH.'install/index.php';
-$MCONF['access']='admin';
 $MCONF['name']='tools_install';
+$MCONF['script']='_DISPATCH';
+
+$MCONF['access']='admin';
 $MCONF['workspaces']='online';
 ?>
\ No newline at end of file
diff --git a/typo3/sysext/install/mod/index.php b/typo3/sysext/install/mod/index.php
new file mode 100755 (executable)
index 0000000..8875a0a
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2011 Steffen Gebert <steffen.gebert@typo3.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script 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.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+       // This checks permissions and exits if the users has no permission for entry.
+$BE_USER->modAccess($MCONF, 1);
+
+
+/**
+ * Backend module of the 'install' extension, which automatically enables the
+ * Install Tool, if it's accessed by an authenticated Backend user.
+ *
+ * @author Steffen Gebert <steffen.gebert@typo3.org>
+ * @package TYPO3
+ * @subpackage install
+ */
+class tx_install_mod1 extends t3lib_SCbase {
+
+       /**
+        * Entry point for the backend module
+        *
+        * @throws t3lib_error_Exception
+        * @return void
+        */
+       public function main() {
+               if (!$GLOBALS['BE_USER']->user['admin']) {
+                       throw new t3lib_error_Exception('Access denied', 1306866845);
+               }
+
+               if (!Tx_Install_Service_BasicService::checkInstallToolEnableFile()) {
+                       Tx_Install_Service_BasicService::createInstallToolEnableFile();
+               }
+               t3lib_utility_Http::redirect('install/');
+       }
+}
+
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/install/mod/index.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/install/mod/index.php']);
+}
+
+/** @var $SOBE tx_install_mod1 */
+$SOBE = t3lib_div::makeInstance('tx_install_mod1');
+$SOBE->init();
+
+$SOBE->main();
+
+?>
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index e0183e6..5458ec9
Binary files a/typo3/sysext/install/mod/install.gif and b/typo3/sysext/install/mod/install.gif differ