37 if($this->enabled = (
bool)$ilSetting->get(
'https'))
43 if ($this->automaticHTTPSDetectionEnabled = (
bool)$ilIliasIniFile->readVariable(
'https',
"auto_https_detect_enabled"))
45 $this->headerName = $ilIliasIniFile->readVariable(
'https',
"auto_https_detect_header_name");
46 $this->headerValue = $ilIliasIniFile->readVariable(
'https',
"auto_https_detect_header_value");
58 return self::$instance;
60 return self::$instance =
new ilHTTPS();
71 case self::PROTOCOL_HTTP:
72 $should_switch_to_http = (
73 !in_array(basename(
$_SERVER[
'SCRIPT_NAME']), $this->protected_scripts) &&
74 !in_array(strtolower(
$_GET[
'cmdClass']), $this->protected_classes)
77 return $should_switch_to_http;
80 case self::PROTOCOL_HTTPS:
81 $should_switch_to_https = (
82 in_array(basename(
$_SERVER[
'SCRIPT_NAME']), $this->protected_scripts) ||
83 in_array(strtolower(
$_GET[
'cmdClass']), $this->protected_classes)
86 return $should_switch_to_https;
119 $this->protected_scripts[] =
'login.php';
120 $this->protected_scripts[] =
'index.php';
121 $this->protected_scripts[] =
'register.php';
123 $this->protected_scripts[] =
'webdav.php';
125 $this->protected_scripts[] =
'shib_login.php';
140 if ($this->automaticHTTPSDetectionEnabled)
142 $headerName =
"HTTP_".str_replace(
"-",
"_", strtoupper($this->headerName));
164 $this->protected_classes[] =
'ilstartupgui';
165 $this->protected_classes[] =
'ilaccountregistrationgui';
166 $this->protected_classes[] =
'ilpersonalsettingsgui';
179 if(($sp = fsockopen(
$_SERVER[
"SERVER_NAME"],$port,$errno,
$error)) ===
false)
196 if(($sp = fsockopen(
$_SERVER[
"SERVER_NAME"],$port,$errno,
$error)) ===
false)
213 global
$ilLog,$ilClientIniFile;
215 $secure_disabled = $ilClientIniFile->readVariable(
'session',
'disable_secure_cookies');
218 #$ilLog->write(__CLASS__.': Enabled secure cookies'); 219 session_set_cookie_params(
220 IL_COOKIE_EXPIRE,
IL_COOKIE_PATH, IL_COOKIE_DOMAIN,
true, IL_COOKIE_HTTPONLY
_checkHTTP()
static method to check if http connections are possible for this server
$automaticHTTPSDetectionEnabled
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
__construct()
use ilHTTPS::getInstance()
static _checkHTTPS()
static method to check if https connections are possible for this server public
const IL_COOKIE_PATH(isset($_GET["client_id"]))
Add a drawing to the header
Create styles array
The data for the language used.
static getInstance()
Get https instance.
isDetected()
check if https is detected
enableSecureCookies()
enable secure cookies
shouldSwitchProtocol($to_protocol)
checkPort()
check if current port usage is right: if https should be used than redirection is done...