46 if($this->enabled = (
bool) $ilSetting->get(
'https'))
51 if ($this->automaticHTTPSDetectionEnabled = (
bool) $ilSetting->get(
"ps_auto_https_enabled"))
53 $this->headerName = $ilSetting->get(
"ps_auto_https_headername");
54 $this->headerValue = $ilSetting->get(
"ps_auto_https_headervalue");
68 if((in_array(basename($_SERVER[
"SCRIPT_NAME"]),$this->protected_scripts) or
69 in_array(
$_GET[
'cmdClass'],$this->protected_classes)) and
70 $_SERVER[
"HTTPS"] !=
"on")
72 header(
"location: https://".$_SERVER[
"SERVER_NAME"].$_SERVER[
"REQUEST_URI"]);
75 if((!in_array(basename($_SERVER[
"SCRIPT_NAME"]),$this->protected_scripts) and
76 !in_array(
$_GET[
'cmdClass'],$this->protected_classes)) and
77 $_SERVER[
"HTTPS"] ==
"on")
79 header(
"location: http://".$_SERVER[
"SERVER_NAME"].$_SERVER[
"REQUEST_URI"]);
88 $this->protected_scripts[] =
'login.php';
89 $this->protected_scripts[] =
'index.php';
90 $this->protected_scripts[] =
'payment.php';
91 $this->protected_scripts[] =
'register.php';
93 $this->protected_scripts[] =
'webdav.php';
106 if ($_SERVER[
"HTTPS"] ==
"on")
109 if ($this->automaticHTTPSDetectionEnabled)
111 $headerName =
"HTTP_".str_replace(
"-",
"_",$this->headerName);
114 if (strcasecmp($_SERVER[
$headerName],$this->headerValue)==0)
116 $_SERVER[
"HTTPS"] =
"on";
133 $this->protected_classes[] =
'ilstartupgui';
134 $this->protected_classes[] =
'ilregistrationgui';
147 if(($sp = @fsockopen($_SERVER[
"SERVER_NAME"],$port,$errno,$error)) ===
false)
164 if(($sp = @fsockopen($_SERVER[
"SERVER_NAME"],$port,$errno,$error)) ===
false)
181 global
$ilLog,$ilClientIniFile;
183 $secure_disabled = $ilClientIniFile->readVariable(
'session',
'disable_secure_cookies');
184 if(!$secure_disabled and !$this->enabled and $this->
isDetected() and !session_id())
186 $ilLog->write(__CLASS__.
': Enabled secure cookies');
187 session_set_cookie_params(0,
'/',
'',
true);