Public Member Functions | Data Fields

ilHTTPS Class Reference

Public Member Functions

 ilHTTPS ()
 checkPort ()
 __readProtectedScripts ()
 __readProtectedClasses ()
 _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()

Detailed Description

Definition at line 34 of file class.ilHTTPS.php.


Member Function Documentation

ilHTTPS::__readProtectedClasses (  ) 

Definition at line 83 of file class.ilHTTPS.php.

Referenced by ilHTTPS().

        {
                $this->protected_classes[] = 'ilstartupgui';
                $this->protected_classes[] = 'ilregistrationgui';
        }

Here is the caller graph for this function:

ilHTTPS::__readProtectedScripts (  ) 

Definition at line 73 of file class.ilHTTPS.php.

Referenced by ilHTTPS().

        {
                $this->protected_scripts[] = 'login.php';
                $this->protected_scripts[] = 'index.php';
                $this->protected_scripts[] = 'start_bmf.php';
                $this->protected_scripts[] = 'register.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

Returns:
boolean

Definition at line 112 of file class.ilHTTPS.php.

Referenced by ilObjSystemFolderGUI::saveSettingsObject().

        {
                $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

Returns:
boolean

Definition at line 94 of file class.ilHTTPS.php.

Referenced by ilObjSystemFolderGUI::saveSettingsObject().

        {
                // 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 50 of file class.ilHTTPS.php.

References $_GET, and exit.

        {
                if(!$this->enabled)
                {
                        return true;
                }
                if((in_array(basename($_SERVER["SCRIPT_NAME"]),$this->protected_scripts) or
                        in_array($_GET['cmdClass'],$this->protected_classes)) 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
                        !in_array($_GET['cmdClass'],$this->protected_classes)) and
                   $_SERVER["HTTPS"] == 'on')
                {
                        header("location: http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
                        exit;
                }
                return true;
        }

ilHTTPS::ilHTTPS (  ) 

Definition at line 39 of file class.ilHTTPS.php.

References $ilias, __readProtectedClasses(), and __readProtectedScripts().

        {
                global $ilias;

                if($this->enabled = (bool) $ilias->getSetting('https'))
                {
                        $this->__readProtectedScripts();
                        $this->__readProtectedClasses();
                }
        }

Here is the call graph for this function:


Field Documentation

ilHTTPS::$enabled = false

Definition at line 36 of file class.ilHTTPS.php.

ilHTTPS::$protected_scripts = array()

Definition at line 37 of file class.ilHTTPS.php.


The documentation for this class was generated from the following file: