37 if ($this->enabled = (
bool) $ilSetting->get(
'https')) {
42 if ($this->automaticHTTPSDetectionEnabled = (
bool) $ilIliasIniFile->readVariable(
'https',
"auto_https_detect_enabled")) {
43 $this->headerName = $ilIliasIniFile->readVariable(
'https',
"auto_https_detect_header_name");
44 $this->headerValue = $ilIliasIniFile->readVariable(
'https',
"auto_https_detect_header_value");
54 if (self::$instance) {
55 return self::$instance;
57 return self::$instance =
new ilHTTPS();
66 switch ($to_protocol) {
67 case self::PROTOCOL_HTTP:
68 $should_switch_to_http = (
69 !in_array(basename(
$_SERVER[
'SCRIPT_NAME']), $this->protected_scripts) &&
70 !in_array(strtolower(
$_GET[
'cmdClass']), $this->protected_classes)
73 return $should_switch_to_http;
76 case self::PROTOCOL_HTTPS:
77 $should_switch_to_https = (
78 in_array(basename(
$_SERVER[
'SCRIPT_NAME']), $this->protected_scripts) ||
79 in_array(strtolower(
$_GET[
'cmdClass']), $this->protected_classes)
82 return $should_switch_to_https;
112 $this->protected_scripts[] =
'login.php';
113 $this->protected_scripts[] =
'index.php';
114 $this->protected_scripts[] =
'register.php';
116 $this->protected_scripts[] =
'webdav.php';
118 $this->protected_scripts[] =
'shib_login.php';
134 if ($this->automaticHTTPSDetectionEnabled) {
135 $headerName =
"HTTP_" . str_replace(
"-",
"_", strtoupper($this->headerName));
156 $this->protected_classes[] =
'ilstartupgui';
157 $this->protected_classes[] =
'ilaccountregistrationgui';
158 $this->protected_classes[] =
'ilpersonalsettingsgui';
171 if (($sp = fsockopen(
$_SERVER[
"SERVER_NAME"], $port, $errno,
$error)) ===
false) {
187 if (($sp = fsockopen(
$_SERVER[
"SERVER_NAME"], $port, $errno,
$error)) ===
false) {
203 global $ilClientIniFile;
205 $secure_disabled = $ilClientIniFile->readVariable(
'session',
'disable_secure_cookies');
206 if (!$secure_disabled && !$this->enabled && $this->
isDetected() && !session_id()) {
207 if (!
defined(
'IL_COOKIE_SECURE')) {
208 define(
'IL_COOKIE_SECURE',
true);
211 session_set_cookie_params(
_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
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
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
shouldSwitchProtocol($to_protocol)
checkPort()
check if current port usage is right: if https should be used than redirection is done...