Project

General

Profile

Bug #19998 » bug_10410_v4.diff

Administrator Admin, 2009-02-17 22:27

View differences:

typo3/sysext/install/mod/install.js (working copy)
parameters: '?eID=' + this.eID,
onComplete: function(xhr) {
document.getElementsByName('TYPO3_INSTALL[localconf.php][encryptionKey]').item(0).value=xhr.responseText;
}.bind(this),
}.bind(this)
});
},
};
}
};
typo3/sysext/install/mod/class.tx_install.php (working copy)
$out.=$this->wrapInCells('', '<br />');
if ($this->mode!='123') {
$this->headerStyle .= chr(10) . '
<script type="text/javascript" src="' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'contrib/prototype/prototype.js"></script>
<script type="text/javascript" src="' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'sysext/install/mod/install.js"></script>
';
$out.=$this->wrapInCells('Site name:', '<input type="text" name="TYPO3_INSTALL[localconf.php][sitename]" value="'.htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']).'">');
$out.=$this->wrapInCells('', '<br />');
$out.='<script type="text/javascript" src="../sysext/install/mod/install.js"></script>';
$out.='<script type="text/javascript" src="../contrib/prototype/prototype.js"></script>';
$out.=$this->wrapInCells('Encryption key:', '<a name="set_encryptionKey"></a><input type="text" name="TYPO3_INSTALL[localconf.php][encryptionKey]" value="'.htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']).'"><br /><input type="button" onclick="EncryptionKey.load(this)" value="Generate random key">');
$out.=$this->wrapInCells('', '<br />');
typo3/sysext/install/mod/class.tx_install_eid.php (working copy)
function main() {
// Create output:
$this->content = $this->createEncryptionKey();
$this->addTempContentHttpHeaders();
}
/**
......
* @return void
*/
function printContent() {
if (!headers_sent()) {
header('Content-Length: '.strlen($this->content));
}
echo $this->content;
}
......
* @return string
*/
function createEncryptionKey($keyLength = 96) {
if (!headers_sent()) {
header("Content-type: text/plain");
}
$bytes = t3lib_div::generateRandomBytes($keyLength);
return substr(bin2hex($bytes), -96);
}
/**
* Sends cache control headers that prevent caching in user agents.
*
*/
function addTempContentHttpHeaders() {
if (!headers_sent()) {
// see RFC 2616
// see Microsoft Knowledge Base #234067
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header('Expires: -1');
}
}
}
// Make instance:
(4-4/5)