Fixed bug #12175: User Setup don't check file time of ENABLE_INSTALL_TOOL
authorSteffen Kamper <info@sk-typo3.de>
Wed, 21 Oct 2009 08:52:36 +0000 (08:52 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 21 Oct 2009 08:52:36 +0000 (08:52 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6209 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index d6c5aba..4a0c56d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-10-21  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #12175: User Setup don't check file time of ENABLE_INSTALL_TOOL
        * Fixed bug #12237: Use flash-messages in user-settings (thanks to Georg Ringer)
        * Follow-up to bug #12272: reverted renaming of step
        * Fixed bug #12272: Steps disregarded in t3lib_lock (thanks to Dan Osipov)
index 4b990b5..e5e7b2b 100755 (executable)
@@ -711,7 +711,19 @@ class SC_mod_user_setup_index {
         */
        public function renderInstallToolEnableFileButton(array $params, SC_mod_user_setup_index $parent) {
                // Install Tool access file
-               $installToolEnableFileExists = is_file(PATH_typo3conf . 'ENABLE_INSTALL_TOOL');
+               $installToolEnableFile = PATH_typo3conf . 'ENABLE_INSTALL_TOOL';
+               $installToolEnableFileExists = is_file($installToolEnableFile);
+               if ($installToolEnableFileExists && (time() - filemtime($installToolEnableFile) > 3600)) {
+                       $content = file_get_contents($installToolEnableFile);
+                       $verifyString = 'KEEP_FILE';
+
+                       if (trim($content) !== $verifyString) {
+                                       // Delete the file if it is older than 3600s (1 hour)
+                               unlink($installToolEnableFile);
+                               $installToolEnableFileExists = is_file($installToolEnableFile);
+                       }
+               }
+
                if ($installToolEnableFileExists) {
                        return '<input type="submit" name="deleteInstallToolEnableFile" value="' . $GLOBALS['LANG']->sL('LLL:EXT:setup/mod/locallang.xml:enableInstallTool.deleteFile') . '" />';
                } else {