Fixed bug #15042: Accessing BE in fresh install fails with "No database selected...
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 29 Oct 2010 15:58:44 +0000 (15:58 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 29 Oct 2010 15:58:44 +0000 (15:58 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9227 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/init.php

index 84cf0e3..2b87684 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 
 2010-10-29  Christian Kuhn  <lolli@schwarzbu.ch>
 
+       * Fixed bug #15042: Accessing BE in fresh install fails with "No database selected" (Thanks to Lars Peipmann)
        * Fixed bug #16140: [reports] PHP warning on missing array in reports system extension (Thanks to Rudi Meyer)
        * Added feature #16137: [em] Task to update extension list
        * Fixed bug #4272: Inconsistent return values of ini_get() produce false positives for safe_mode detection (Thanks to Peter Beernink)
index 3b4df39..425224c 100644 (file)
@@ -366,7 +366,10 @@ if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL) {
 // *************************
 // Connect to the database
 // *************************
-if ($TYPO3_DB->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password))      {
+       // Redirect to install tool if database host and database are not defined
+if (!TYPO3_db_host && !TYPO3_db) {
+       t3lib_utility_Http::redirect('install/index.php?mode=123&step=1&password=joh316');
+} elseif ($TYPO3_DB->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) {
        if (!TYPO3_db)  {
                throw new RuntimeException('Database Error: No database selected', time());
        } elseif (!$TYPO3_DB->sql_select_db(TYPO3_db))  {