Bug #23873 » 16172_v1.patch
typo3/sysext/cms/tslib/class.tslib_fe.php | ||
---|---|---|
* @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) {
|
||
... | ... | |
$link = FALSE;
|
||
}
|
||
if ($link !== FALSE) {
|
||
if (!TYPO3_db) {
|
||
throw new RuntimeException('Database Error: No database selected');
|
||
// Redirects to the Install Tool:
|
||
echo '<script type="text/javascript">
|
||
/*<![CDATA[*/
|
||
window.location.href = "'.TYPO3_mainDir.'install/index.php?mode=123&step=1&password=joh316";
|
||
/*]]>*/
|
||
</script>';
|
||
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 {
|
||
... | ... | |
}
|
||
}
|
||
} else {
|
||
if (!TYPO3_db) {
|
||
// Redirects to the Install Tool:
|
||
echo '<script type="text/javascript">
|
||
/*<![CDATA[*/
|
||
window.location.href = "'.TYPO3_mainDir.'install/index.php?mode=123&step=1&password=joh316";
|
||
/*]]>*/
|
||
</script>';
|
||
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 {
|