Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes

ilSecuritySettings Class Reference

Singleton class that stores all security settings. More...

Collaboration diagram for ilSecuritySettings:

Public Member Functions

 _getInstance ()
 Get instance of ilSecuritySettings.
 getSecuritySettingsRefId ()
 setAutomaticHTTPSEnabled ($varname)
 write access to enable automatic https detection
 setAutomaticHTTPSHeaderName ($varname)
 set header name for automatic https detection
 setAutomaticHTTPSHeaderValue ($varname)
 set header value for automatic https detection
 getAutomaticHTTPSHeaderName ()
 read access to header name for automatic https detection
 getAutomaticHTTPSHeaderValue ()
 read access to header value for automatic https detection
 isAutomaticHTTPSEnabled ()
 read access to switch if automatic https detection is enabled
 setHTTPSEnabled ($value)
 Enable https for certain scripts.
 isHTTPSEnabled ()
 read access to https enabled property
 save ()
 Save settings.
 validate ()
 validate settings

Static Public Attributes

static $SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS = 1
static $SECURITY_SETTINGS_ERR_CODE_HTTP_NOT_AVAILABLE = 2
static $SECURITY_SETTINGS_ERR_CODE_HTTPS_NOT_AVAILABLE = 3

Private Member Functions

 __construct ()
 Private constructor: use _getInstance().
 read ()
 read settings

Private Attributes

 $db
 $settings
 $https_header_enable
 $https_header_name
 $https_header_value
 $https_enable

Static Private Attributes

static $instance = null

Detailed Description

Singleton class that stores all security settings.

Author:
Roland Küstermann <roland@kuestermann.com>
Version:
$Id$

/

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


Constructor & Destructor Documentation

ilSecuritySettings::__construct (  )  [private]

Private constructor: use _getInstance().

private

Parameters:
 

Definition at line 56 of file class.ilSecuritySettings.php.

References $ilSetting, and read().

        {
                global $ilSetting,$ilDB;

                $this->db = $ilDB;
                $this->settings = $ilSetting;

                $this->read();
        }

Here is the call graph for this function:


Member Function Documentation

ilSecuritySettings::_getInstance (  ) 

Get instance of ilSecuritySettings.

Returns:
ilSecuritySettings instance public

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

Referenced by ilObjPrivacySecurityGUI::showSecurity().

        {
                if(is_object(self::$instance))
                {
                        return self::$instance;
                }
                return self::$instance = new ilSecuritySettings();
        }

Here is the caller graph for this function:

ilSecuritySettings::getAutomaticHTTPSHeaderName (  ) 

read access to header name for automatic https detection

Returns:
string header name

Definition at line 124 of file class.ilSecuritySettings.php.

Referenced by save(), and validate().

        {
            return $this->https_header_name;
        }

Here is the caller graph for this function:

ilSecuritySettings::getAutomaticHTTPSHeaderValue (  ) 

read access to header value for automatic https detection

Returns:
string header value

Definition at line 134 of file class.ilSecuritySettings.php.

Referenced by save(), and validate().

        {
            return $this->https_header_value;
        }

Here is the caller graph for this function:

ilSecuritySettings::getSecuritySettingsRefId (  ) 

Definition at line 82 of file class.ilSecuritySettings.php.

        {
                return $this->ref_id;
        }

ilSecuritySettings::isAutomaticHTTPSEnabled (  ) 

read access to switch if automatic https detection is enabled

Returns:
boolean true, if detection is enabled, false otherwise

Definition at line 144 of file class.ilSecuritySettings.php.

Referenced by save(), and validate().

        {
            return $this->https_header_enable;
        }

Here is the caller graph for this function:

ilSecuritySettings::isHTTPSEnabled (  ) 

read access to https enabled property

Returns:
boolean true, if enabled, false otherwise

Definition at line 165 of file class.ilSecuritySettings.php.

Referenced by save(), and validate().

    {
        return $this->https_enable;
    }

Here is the caller graph for this function:

ilSecuritySettings::read (  )  [private]

read settings

private

Parameters:
 

Definition at line 188 of file class.ilSecuritySettings.php.

References $res.

Referenced by __construct().

        {
                global $ilDB;
                
            $query = "SELECT object_reference.ref_id FROM object_reference,tree,object_data ".
                                "WHERE tree.parent = ".$ilDB->quote(SYSTEM_FOLDER_ID)." ".
                                "AND object_data.type = 'ps' ".
                                "AND object_reference.ref_id = tree.child ".
                                "AND object_reference.obj_id = object_data.obj_id";
                $res = $this->db->query($query);
                $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
                $this->ref_id = $row["ref_id"];

        $this->https_header_enable = (bool) $this->settings->get('ps_auto_https_enabled',false);
                $this->https_header_name = (string) $this->settings->get('ps_auto_https_headername',"ILIAS_HTTPS_ENABLED");
                $this->https_header_value = (string) $this->settings->get('ps_auto_https_headervalue',"1");
                $this->https_enable = (boolean) $this->settings->get('https', false);
        }

Here is the caller graph for this function:

ilSecuritySettings::save (  ) 

Save settings.

Definition at line 174 of file class.ilSecuritySettings.php.

References getAutomaticHTTPSHeaderName(), getAutomaticHTTPSHeaderValue(), isAutomaticHTTPSEnabled(), and isHTTPSEnabled().

        {
                $this->settings->set('ps_auto_https_enabled',(bool) $this->isAutomaticHTTPSEnabled());
                $this->settings->set('ps_auto_https_headername',(string) $this->getAutomaticHTTPSHeaderName());
                $this->settings->set('ps_auto_https_headervalue',(string) $this->getAutomaticHTTPSHeaderValue());
                $this->settings->set('https',(string) $this->isHTTPSEnabled());
        }

Here is the call graph for this function:

ilSecuritySettings::setAutomaticHTTPSEnabled ( varname  ) 

write access to enable automatic https detection

Parameters:
boolean $varname

Definition at line 93 of file class.ilSecuritySettings.php.

        {
            $this->https_header_enable = $varname;
        }

ilSecuritySettings::setAutomaticHTTPSHeaderName ( varname  ) 

set header name for automatic https detection

Parameters:
string $varname

Definition at line 104 of file class.ilSecuritySettings.php.

        {
            $this->https_header_name = $varname;
        }

ilSecuritySettings::setAutomaticHTTPSHeaderValue ( varname  ) 

set header value for automatic https detection

Parameters:
string $varname

Definition at line 114 of file class.ilSecuritySettings.php.

        {
            $this->https_header_value = $varname;
        }

ilSecuritySettings::setHTTPSEnabled ( value  ) 

Enable https for certain scripts.

Parameters:
boolean $value

Definition at line 154 of file class.ilSecuritySettings.php.

    {
        $this->https_enable = $value;
    }

ilSecuritySettings::validate (  ) 

Field Documentation

ilSecuritySettings::$db [private]

Definition at line 41 of file class.ilSecuritySettings.php.

ilSecuritySettings::$https_enable [private]

Definition at line 47 of file class.ilSecuritySettings.php.

ilSecuritySettings::$https_header_enable [private]

Definition at line 44 of file class.ilSecuritySettings.php.

ilSecuritySettings::$https_header_name [private]

Definition at line 45 of file class.ilSecuritySettings.php.

ilSecuritySettings::$https_header_value [private]

Definition at line 46 of file class.ilSecuritySettings.php.

ilSecuritySettings::$instance = null [static, private]

Definition at line 40 of file class.ilSecuritySettings.php.

ilSecuritySettings::$SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS = 1 [static]

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

Referenced by ilObjPrivacySecurityGUI::__construct(), and validate().

ilSecuritySettings::$SECURITY_SETTINGS_ERR_CODE_HTTP_NOT_AVAILABLE = 2 [static]

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

Referenced by ilObjPrivacySecurityGUI::__construct(), and validate().

ilSecuritySettings::$SECURITY_SETTINGS_ERR_CODE_HTTPS_NOT_AVAILABLE = 3 [static]

Definition at line 38 of file class.ilSecuritySettings.php.

Referenced by ilObjPrivacySecurityGUI::__construct(), and validate().

ilSecuritySettings::$settings [private]

Definition at line 42 of file class.ilSecuritySettings.php.


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