Project

General

Profile

Bug #23289 » 15265-trunk-v2.diff

Administrator Admin, 2010-08-02 13:44

View differences:

typo3/sysext/install/mod/class.tx_install.php (Arbeitskopie)
}
$this->session = t3lib_div::makeInstance('tx_install_session');
$sessionCreationError = $this->session->getErrorCreationMessage();
if ($sessionCreationError !== NULL) {
$this->outputErrorAndExit('<p>' . $sessionCreationError . '</p>');
}
// *******************
// Check authorization
......
}
/**
* 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') {
// Define the stylesheet
$stylesheet = '<link rel="stylesheet" type="text/css" href="' .
'../stylesheets/install/install.css" />';
$javascript = '<script type="text/javascript" src="' .
'../contrib/prototype/prototype.js"></script>' . LF;
$javascript .= '<script type="text/javascript" src="' .
'../sysext/install/Resources/Public/Javascript/install.js"></script>';
// Get the template file
$template = @file_get_contents(PATH_site . '/typo3/templates/install.html');
// Define the markers content
$markers = array(
'styleSheet' => $stylesheet,
'javascript' => $javascript,
'title' => $title,
'content' => $content,
);
// Fill the markers
$content = t3lib_parsehtml::substituteMarkerArray(
$template,
$markers,
'###|###',
1,
1
);
// 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 $content;
exit();
}
/**
* Sends the page to the client.
*
* @param string $content The HTML page
typo3/sysext/install/mod/class.tx_install_session.php (Arbeitskopie)
private $backendFile = 'backend.php';
/**
* On creation of the session, store a potential error message here
*
* @var string
*/
private $sessionCreationError = NULL;
/**
* Constructor. Starts PHP session handling in our own private store
*
* Side-effect: might set a cookie, so must be called before any other output.
......
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
*/
public function getErrorCreationMessage() {
return $this->sessionCreationError;
}
/**
* Returns the path where to store our session files
*/
private function getSessionSavePath() {
(3-3/10)