Added feature #11391: Add a button to let admins create the file ENABLE_INSTALL_TOOL...
authorMichael Stucki <michael.stucki@typo3.org>
Mon, 29 Jun 2009 15:40:44 +0000 (15:40 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Mon, 29 Jun 2009 15:40:44 +0000 (15:40 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2@5661 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/setup/mod/index.php
typo3/sysext/setup/mod/locallang.xml

index 2132330..074e46d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-29  Michael Stucki  <michael@typo3.org>
+
+       * Added feature #11391: Add a button to let admins create the file ENABLE_INSTALL_TOOL from the backend (since it is automatically removed after 1 hour since this version)
+
 2009-06-29  Benjamin Mack  <benni@typo3.org>
 
        * Fixed bug #6215: MENU before/after* might create invalid HTML output (Thanks to Nabil Saleh)
index 5247d75..9df38e2 100755 (executable)
@@ -269,6 +269,17 @@ class SC_mod_user_setup_index {
        function main() {
                global $BE_USER,$LANG,$BACK_PATH,$TBE_MODULES;
 
+               
+                       // file creation / delete
+               if ($this->isAdmin) {
+                       if (t3lib_div::_POST('deleteInstallToolEnableFile')) {
+                               unlink(PATH_typo3conf . 'ENABLE_INSTALL_TOOL');
+                       }
+                       if (t3lib_div::_POST('createInstallToolEnableFile')) {
+                               touch(PATH_typo3conf . 'ENABLE_INSTALL_TOOL');
+                       }
+               }
+               
                if ($this->languageUpdate) {
                        $this->doc->JScode.= '<script language="javascript" type="text/javascript">
        if(top.refreshMenu) {
@@ -564,6 +575,23 @@ class SC_mod_user_setup_index {
                        t3lib_BEfunc::cshItem('_MOD_user_setup', 'reset', $BACK_PATH)
                );
 
+                       // Install Tool access file
+               if ($this->isAdmin) {
+                       $installToolEnableFileExists = is_file(PATH_typo3conf . 'ENABLE_INSTALL_TOOL');
+                       $installToolEnableButton = $installToolEnableFileExists ?
+                               '<input type="submit" name="deleteInstallToolEnableFile" value="' . $LANG->getLL('enableInstallTool.deleteFile') . '" />' :
+                               '<input type="submit" name="createInstallToolEnableFile" value="' . $LANG->getLL('enableInstallTool.createFile') . '" />';
+
+                       $this->content .= $this->doc->spacer(30);
+                       $this->content .= $this->doc->section($LANG->getLL('enableInstallTool.headerTitle'),
+                               $LANG->getLL('enableInstallTool.description')
+                       );
+                       $this->content .= $this->doc->spacer(10);
+                       $this->content .= $this->doc->section('',
+                               $installToolEnableButton
+                       );
+               }
+
                        // Notice
                $this->content .= $this->doc->spacer(30);
                $this->content .= $this->doc->section('', $LANG->getLL('activateChanges'));
index 7a20d7d..298e942 100755 (executable)
                        <label index="newPassword_ok">Password was updated</label>
                        <label index="newPassword_failed">Password was NOT updated because you didn't enter the same password twice.</label>
                        <label index="adminFunctions">Admin functions</label>
+                       <label index="enableInstallTool.headerTitle">Admin control for re-enabling Install Tool access</label>
+                       <label index="enableInstallTool.description">By clicking this button, a file typo3conf/ENABLE_INSTALL_TOOL is created (or removed if it already exists).&lt;br /&gt;It unlocks the access to the Install Tool (password is still needed!) and will be removed automatically after 1 hour.</label>
+                       <label index="enableInstallTool.createFile">Create Install Tool Enable File</label>
+                       <label index="enableInstallTool.deleteFile">Delete Install Tool Enable File</label>
                </languageKey>
        </data>
 </T3locallang>