Public Member Functions | |
| ilHTTPS () | |
| checkPort () | |
| __readProtectedScripts () | |
| _checkHTTPS () | |
| static method to check if https connections are possible for this server public | |
| _checkHTTP () | |
| static method to check if http connections are possible for this server | |
Data Fields | |
| $enabled = false | |
| $protected_scripts = array() | |
Definition at line 33 of file class.ilHTTPS.php.
| ilHTTPS::__readProtectedScripts | ( | ) |
Definition at line 69 of file class.ilHTTPS.php.
Referenced by ilHTTPS().
{
$this->protected_scripts[] = 'login.php';
$this->protected_scripts[] = 'start_bmf.php';
return true;
}
Here is the caller graph for this function:| ilHTTPS::_checkHTTP | ( | ) |
static method to check if http connections are possible for this server
public
Definition at line 100 of file class.ilHTTPS.php.
Referenced by ilObjSystemFolderGUI::displayBasicSettings().
{
$port = 80;
if(($sp = @fsockopen($_SERVER["SERVER_NAME"],$port,$errno,$error)) === false)
{
return false;
}
fclose($sp);
return true;
}
Here is the caller graph for this function:| ilHTTPS::_checkHTTPS | ( | ) |
static method to check if https connections are possible for this server public
Definition at line 82 of file class.ilHTTPS.php.
Referenced by ilObjSystemFolderGUI::displayBasicSettings().
{
// only check standard port in the moment
$port = 443;
if(($sp = @fsockopen($_SERVER["SERVER_NAME"],$port,$errno,$error)) === false)
{
return false;
}
fclose($sp);
return true;
}
Here is the caller graph for this function:| ilHTTPS::checkPort | ( | ) |
Definition at line 48 of file class.ilHTTPS.php.
References exit.
{
if(!$this->enabled)
{
return true;
}
if(in_array(basename($_SERVER["SCRIPT_NAME"]),$this->protected_scripts) and
$_SERVER["HTTPS"] != 'on')
{
header("location: https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
exit;
}
if(!in_array(basename($_SERVER["SCRIPT_NAME"]),$this->protected_scripts) and
$_SERVER["HTTPS"] == 'on')
{
header("location: http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
exit;
}
return true;
}
| ilHTTPS::ilHTTPS | ( | ) |
Definition at line 38 of file class.ilHTTPS.php.
References $ilias, and __readProtectedScripts().
{
global $ilias;
if($this->enabled = (bool) $ilias->getSetting('https'))
{
$this->__readProtectedScripts();
}
}
Here is the call graph for this function:| ilHTTPS::$enabled = false |
Definition at line 35 of file class.ilHTTPS.php.
| ilHTTPS::$protected_scripts = array() |
Definition at line 36 of file class.ilHTTPS.php.
1.7.1