diff --git typo3/sysext/cms/tslib/class.tslib_fe.php typo3/sysext/cms/tslib/class.tslib_fe.php index a416143..71f36db 100644 --- typo3/sysext/cms/tslib/class.tslib_fe.php +++ typo3/sysext/cms/tslib/class.tslib_fe.php @@ -487,6 +487,13 @@ * @return void */ function connectToDB() { + // jump into Install Tool if database host and database is not defined + if (!TYPO3_db_host && !TYPO3_db) { + t3lib_utility_Http::redirect(TYPO3_mainDir.'install/index.php?mode=123&step=1&password=joh316'); + } elseif (!TYPO3_db) { + throw new RuntimeException('Database Error: No database selected'); + } + try { $link = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password); } catch (RuntimeException $e) { @@ -497,16 +504,7 @@ $link = FALSE; } if ($link !== FALSE) { - if (!TYPO3_db) { - throw new RuntimeException('Database Error: No database selected'); - // Redirects to the Install Tool: - echo ''; - exit; - } elseif (!$GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db)) { + if (!$GLOBALS['TYPO3_DB']->sql_select_db(TYPO3_db)) { if ($this->checkPageUnavailableHandler()) { $this->pageUnavailableAndExit('Cannot connect to the current database, "'.TYPO3_db.'"'); } else { @@ -517,16 +515,6 @@ } } } else { - if (!TYPO3_db) { - // Redirects to the Install Tool: - echo ''; - exit; - } - if ($this->checkPageUnavailableHandler()) { $this->pageUnavailableAndExit('The current username, password or host was not accepted when the connection to the database was attempted to be established!'); } else {