Commit 85b6c60d authored by Carsten  Rose's avatar Carsten Rose
Browse files

Variables.php: fixed access to variables without apache

parent 92d93c0f
......@@ -108,10 +108,23 @@ class Variables {
public function collectGlobalVariables() {
$arr = array();
//TODO: Variablen sollten vom STORE_TYPO3 genommen werden
$arr["REMOTE_ADDR"] = $_SERVER["REMOTE_ADDR"];
$arr["HTTP_HOST"] = $_SERVER["HTTP_HOST"];
$arr["REQUEST_URI"] = $_SERVER["REQUEST_URI"];
if (isset($_SERVER["REMOTE_ADDR"])) {
//TODO: Variablen sollten vom STORE_TYPO3 genommen werden
$arr["REMOTE_ADDR"] = $_SERVER["REMOTE_ADDR"];
$arr["HTTP_HOST"] = $_SERVER["HTTP_HOST"];
$arr["REQUEST_URI"] = $_SERVER["REQUEST_URI"];
$protocol = 'http';
if (isset($_SERVER['HTTPS'])) {
if ($_SERVER["HTTPS"] != "off")
$protocol = 'https';
}
$arr["url"] = $protocol . "://" . $_SERVER["HTTP_HOST"];
if ($_SERVER["SERVER_PORT"] != 80)
$arr["url"] .= ":" . $_SERVER["SERVER_PORT"];
$arr["url"] .= $arr["REQUEST_URI"];
}
if (isset($GLOBALS["TSFE"]->fe_user)) {
$arr["fe_user_uid"] = $GLOBALS["TSFE"]->fe_user->user["uid"] ?: '-';
$arr["fe_user"] = $GLOBALS["TSFE"]->fe_user->user["username"] ?: '-';
......@@ -125,15 +138,6 @@ class Variables {
$arr["page_type"] = $GLOBALS["TSFE"]->type;
$arr["page_language_uid"] = $GLOBALS["TSFE"]->sys_language_uid;
$arr["ttcontent_uid"] = $this->tt_content_uid;
$protocol = 'http';
if (isset($_SERVER['HTTPS'])) {
if ($_SERVER["HTTPS"] != "off")
$protocol = 'https';
}
$arr["url"] = $protocol . "://" . $_SERVER["HTTP_HOST"];
if ($_SERVER["SERVER_PORT"] != 80)
$arr["url"] .= ":" . $_SERVER["SERVER_PORT"];
$arr["url"] .= $arr["REQUEST_URI"];
// Add all variables from ext_localconf
// database aliases can be used in form sql queries (e.g. select * from "{{global.t3_name}}".fe_users...)
......
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