Commit 9b8540eb authored by Oliver Hader's avatar Oliver Hader
Browse files

Fixed bug #15265: InstallTool-login not possible after Update to 4.4.1 due to...

Fixed bug #15265: InstallTool-login not possible after Update to 4.4.1 due to session_start() in extensions

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-1@8473 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 5c9dc6ff
2010-08-03 Oliver Hader <oliver@typo3.org>
* Fixed bug #15311: t3lib_div::sanitizeLocalUrl() leads to fatal error on PHP4 systems
* Fixed bug #15265: InstallTool-login not possible after Update to 4.4.1 due to session_start() in extensions (thanks to Ernesto Baschny and Helmut Hummel)
2010-08-02 Oliver Hader <oliver@typo3.org>
......
......@@ -301,6 +301,10 @@ class tx_install extends t3lib_install {
}
$this->session = t3lib_div::makeInstance('tx_install_session');
$sessionCreationError = $this->session->getErrorCreationMessage();
if ($sessionCreationError !== NULL) {
$this->outputErrorAndExit('<p>' . $sessionCreationError . '</p>');
}
// *******************
// Check authorization
......@@ -4870,6 +4874,23 @@ a:hover {color: #006; text-decoration:underline;}
return $out;
}
/**
* Outputs an error and dies.
* Should be used by all errors that occur before even starting the install tool process.
*
* @param string The content of the error
* @return void
*/
function outputErrorAndExit($content, $title = 'Install Tool error') {
// Output the warning message and exit
header('Content-Type: text/html; charset=utf-8');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
echo '<h1>' . $title . '</h1>';
echo $content;
exit();
}
/**
* [Describe function...]
*
......
......@@ -74,6 +74,13 @@ class tx_install_session {
*/
var $regenerateSessionIdTime = 5;
/**
* On creation of the session, store a potential error message here
*
* @var string
*/
var $sessionCreationError = NULL;
/**
* Constructor. Starts PHP session handling in our own var store
*
......@@ -113,9 +120,26 @@ class tx_install_session {
if (version_compare(phpversion(), '5.2', '<')) {
ini_set('session.cookie_httponly', TRUE);
}
if (ini_get('session.auto_start')) {
$this->sessionCreationError = '<p><strong>Error: session.auto-start is enabled</strong></p>';
$this->sessionCreationError .= '<p>The PHP option session.auto-start is enabled. Disable this option in php.ini or .htaccess:</p>';
$this->sessionCreationError .= '<pre>php_value session.auto_start Off</pre>';
} else if (defined('SID')) {
$this->sessionCreationError = '<p><strong>Error: Session already started by session_start().</strong></p>';
$this->sessionCreationError .= '<p>Make sure no installed extension is starting a session in its ext_localconf.php or ext_tables.php.</p>';
}
session_start();
}
/**
* Returns a potential error message for session handling.
*
* @return string Error message on creating our session or NULL if there is no error
*/
function getErrorCreationMessage() {
return $this->sessionCreationError;
}
/**
* Returns the path where to store our session files
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment