Index: typo3/install/index.php =================================================================== --- typo3/install/index.php (Revision 7992) +++ typo3/install/index.php (Arbeitskopie) @@ -49,9 +49,15 @@ $PATH_thisScript = str_replace('//','/', str_replace('\\','/', (PHP_SAPI=='cgi'||PHP_SAPI=='isapi' ||PHP_SAPI=='cgi-fcgi')&&($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):($_SERVER['ORIG_SCRIPT_FILENAME']?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))); $PATH_site = dirname(dirname(dirname($PATH_thisScript))); - // Only allow Install Tool access if the file "typo3conf/ENABLE_INSTALL_TOOL" is found +$quickstartFile = $PATH_site . '/typo3conf/FIRST_INSTALL'; $enableInstallToolFile = $PATH_site . '/typo3conf/ENABLE_INSTALL_TOOL'; + // If typo3conf/FIRST_INSTALL is present and can be deleted, automatically create typo3conf/ENABLE_INSTALL_TOOL +if (is_file($quickstartFile) && unlink($quickstartFile)) { + touch($enableInstallToolFile); +} + + // Only allow Install Tool access if the file "typo3conf/ENABLE_INSTALL_TOOL" is found if (is_file($enableInstallToolFile) && (time() - filemtime($enableInstallToolFile) > 3600)) { $content = file_get_contents($enableInstallToolFile); $verifyString = 'KEEP_FILE'; Index: typo3/sysext/install/mod/class.tx_install.php =================================================================== --- typo3/sysext/install/mod/class.tx_install.php (Revision 7992) +++ typo3/sysext/install/mod/class.tx_install.php (Arbeitskopie) @@ -259,11 +259,16 @@ // **************************** $this->INSTALL = t3lib_div::_GP('TYPO3_INSTALL'); $this->mode = t3lib_div::_GP('mode'); - if ($this->mode !== '123') { + $correctDatabaseSettings = $this->checkDatabaseSettings(); + if ($this->mode !== '123' && $correctDatabaseSettings === TRUE) { $this->mode = ''; + } else { + $this->mode = '123'; } if (t3lib_div::_GP('step') === 'go') { $this->step = 'go'; + } else if(intval(t3lib_div::_GP('step')) > 3 && $correctDatabaseSettings === FALSE) { + $this->step = 2; } else { $this->step = intval(t3lib_div::_GP('step')); } @@ -3194,6 +3199,25 @@ } } } + + /** + * Checks if database settings are correct + * + * @return boolean TRUE if settings can be used to connect and the database could be selected, FALSE if not + */ + function checkDatabaseSettings() { + if ($result = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) { + if($GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db)) { + $connected = TRUE; + } else { + $connected = FALSE; + } + } else { + $connected = FALSE; + } + + return $connected; + } /** * Prints form for updating localconf.php or updates localconf.php depending on $cmd