diff --git a/typo3/install/index.php b/typo3/install/index.php index 32a81de..d0daaff 100755 --- a/typo3/install/index.php +++ b/typo3/install/index.php @@ -83,34 +83,84 @@ if (1==2 || !is_file($enableInstallToolFile)) { // Get the template file $template = @file_get_contents($PATH_site . '/typo3/templates/install.html'); - // Define the markers content - $markers = array( - 'styleSheet' => $stylesheet, - 'javascript' => $javascript, - 'title' => 'The Install Tool is locked', - 'content' => ' -

- To enable the Install Tool, the file ENABLE_INSTALL_TOOL must be created. -

- -

- For security reasons, it is highly recommended that you either rename or delete the file after the operation is finished. -

-

- As an additional security measure, if the file is older than one hour, TYPO3 will automatically delete it. -

- ' + + + // check the write permissions of the following directories first + // this jumps in as the first message during installation process to force the user to fix this at first + $writeDirectories = array( + 'fileadmin', + 'typo3conf', + 'typo3temp', + 'uploads', ); + + // saves all directories with insufficient permissions + $missingWritePermissions = array(); + + foreach ($writeDirectories as $directory) { + if (!is_writable($PATH_site . '/' . $directory . '/')) { + $missingWritePermissions[] = $directory; + } + } + + // show warning, if one of the directories lacks write permissions + if (count($missingWritePermissions)) { + $markers = array( + 'styleSheet' => $stylesheet, + 'javascript' => $javascript, + 'title' => 'Insufficient permissions', + 'content' => ' +

+ To work properly, the following directories and their contents must be writable for the user, + under which the web server is running: +

+ +

+ On most systems, this can be achieved by executing the following commands: +

+
' .
+					implode(array_map(
+						function($directory) use ($PATH_site) {
+							return 'chown -R 777 ' . $PATH_site . '/' . $directory . '/
'; + }, + $missingWritePermissions + )) . '
+ ', + ); + } else { + // display the "Install Tool is locked" message + $markers = array( + 'styleSheet' => $stylesheet, + 'javascript' => $javascript, + 'title' => 'The Install Tool is locked', + 'content' => ' +

+ To enable the Install Tool, the file ENABLE_INSTALL_TOOL must be created. +

+ +

+ For security reasons, it is highly recommended that you either rename or delete the file after the operation is finished. +

+

+ As an additional security measure, if the file is older than one hour, TYPO3 will automatically delete it. +

+ ' + ); + } // Fill the markers $content = t3lib_parsehtml::substituteMarkerArray( $template,