Public Member Functions | Static Public Member Functions | Data Fields | Static Protected Attributes | Private Member Functions | Private Attributes

ilECSSettings Class Reference

Collaboration diagram for ilECSSettings:

Public Member Functions

 setEnabledStatus ($a_status)
 en/disable ecs functionality
 isEnabled ()
 is enabled
 setServer ($a_server)
 set server
 getServer ()
 get server
 getServerURI ()
 get complete server uri
 setProtocol ($a_prot)
 set protocol
 getProtocol ()
 get protocol
 setPort ($a_port)
 set port
 getPort ()
 get port
 setPollingTime ($a_time)
 set polling time
 getPollingTime ()
 get polling time
 getPollingTimeSeconds ()
 get polling time seconds (<60)
 getPollingTimeMinutes ()
 get polling time minutes
 setPollingTimeMS ($a_min, $a_sec)
 Set polling time.
 setClientCertPath ($a_path)
 set
 getClientCertPath ()
 get certificate path
 setCACertPath ($a_ca)
 set ca cert path
 getCACertPath ()
 get ca cert path
 getKeyPath ()
 get key path
 setKeyPath ($a_path)
 set key path
 getKeyPassword ()
 get key password
 setKeyPassword ($a_pass)
 set key password
 setImportId ($a_id)
 set import id Object of category, that store new remote courses
 getImportId ()
 get import id
 validate ()
 Validate settings.
 save ()
 save settings

Static Public Member Functions

static _getInstance ()
 singleton getInstance

Data Fields

const PROTOCOL_HTTP = 0
const PROTOCOL_HTTPS = 1
 $fisch = 5

Static Protected Attributes

static $instance = null

Private Member Functions

 __construct ()
 Singleton contructor.
 initStorage ()
 Init storage class (ilSetting) private.
 read ()
 Read settings.

Private Attributes

 $active = false
 $server
 $protocol
 $port
 $client_cert_path
 $ca_cert_path
 $key_path
 $key_pathword
 $polling
 $import_id

Detailed Description

Definition at line 33 of file class.ilECSSettings.php.


Constructor & Destructor Documentation

ilECSSettings::__construct (  )  [private]

Singleton contructor.

private

Definition at line 58 of file class.ilECSSettings.php.

References initStorage(), and read().

        {
                $this->initStorage();
                $this->read();
        }

Here is the call graph for this function:


Member Function Documentation

static ilECSSettings::_getInstance (  )  [static]

singleton getInstance

public

Definition at line 71 of file class.ilECSSettings.php.

Referenced by ilECSConnector::__construct(), and ilECSSettingsGUI::initSettings().

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

Here is the caller graph for this function:

ilECSSettings::getCACertPath (  ) 

get ca cert path

public

Definition at line 294 of file class.ilECSSettings.php.

Referenced by save(), and validate().

        {
                return $this->ca_cert_path;
        }

Here is the caller graph for this function:

ilECSSettings::getClientCertPath (  ) 

get certificate path

public

Definition at line 271 of file class.ilECSSettings.php.

Referenced by save(), and validate().

        {
                return $this->client_cert_path;
        }

Here is the caller graph for this function:

ilECSSettings::getImportId (  ) 

get import id

public

Definition at line 362 of file class.ilECSSettings.php.

Referenced by save().

        {
                return $this->import_id;
        }

Here is the caller graph for this function:

ilECSSettings::getKeyPassword (  ) 

get key password

public

Definition at line 328 of file class.ilECSSettings.php.

Referenced by save(), and validate().

        {
                return $this->key_password;
        }

Here is the caller graph for this function:

ilECSSettings::getKeyPath (  ) 

get key path

public

Definition at line 305 of file class.ilECSSettings.php.

Referenced by save(), and validate().

        {
                return $this->key_path;
        }

Here is the caller graph for this function:

ilECSSettings::getPollingTime (  ) 

get polling time

public

Definition at line 214 of file class.ilECSSettings.php.

Referenced by save().

        {
                return $this->polling;
        }

Here is the caller graph for this function:

ilECSSettings::getPollingTimeMinutes (  ) 

get polling time minutes

public

Definition at line 236 of file class.ilECSSettings.php.

        {
                return (int) ($this->polling / 60);
        }

ilECSSettings::getPollingTimeSeconds (  ) 

get polling time seconds (<60)

public

Definition at line 225 of file class.ilECSSettings.php.

        {
                return (int) ($this->polling % 60);
        }

ilECSSettings::getPort (  ) 

get port

public

Parameters:
 

Definition at line 191 of file class.ilECSSettings.php.

Referenced by getServerURI(), save(), and validate().

        {
                return $this->port;
        }

Here is the caller graph for this function:

ilECSSettings::getProtocol (  ) 

get protocol

public

Definition at line 167 of file class.ilECSSettings.php.

Referenced by getServerURI(), and save().

        {
                return $this->protocol;
        }

Here is the caller graph for this function:

ilECSSettings::getServer (  ) 

get server

public

Parameters:
 

Definition at line 122 of file class.ilECSSettings.php.

Referenced by getServerURI(), save(), and validate().

        {
                return $this->server;
        }

Here is the caller graph for this function:

ilECSSettings::getServerURI (  ) 

get complete server uri

public

Definition at line 133 of file class.ilECSSettings.php.

References getPort(), getProtocol(), and getServer().

        {
                switch($this->getProtocol())
                {
                        case self::PROTOCOL_HTTP:
                                $uri = 'http://';
                                break;
                                
                        case self::PROTOCOL_HTTPS:
                                $uri = 'https://';
                                break;
                }
                $uri .= $this->getServer().':'.$this->getPort();
                return $uri;
        }

Here is the call graph for this function:

ilECSSettings::initStorage (  )  [private]

Init storage class (ilSetting) private.

Definition at line 414 of file class.ilECSSettings.php.

Referenced by __construct().

        {
                include_once('./Services/Administration/classes/class.ilSetting.php');
                $this->storage = new ilSetting('ecs');
        }

Here is the caller graph for this function:

ilECSSettings::isEnabled (  ) 

is enabled

public

Definition at line 98 of file class.ilECSSettings.php.

Referenced by save(), and validate().

        {
                return $this->active;
        }

Here is the caller graph for this function:

ilECSSettings::read (  )  [private]

Read settings.

private

Definition at line 425 of file class.ilECSSettings.php.

References setCACertPath(), setClientCertPath(), setEnabledStatus(), setImportId(), setKeyPassword(), setKeyPath(), setPollingTime(), setPort(), setProtocol(), and setServer().

Referenced by __construct().

        {
                $this->setServer($this->storage->get('server'));
                $this->setProtocol($this->storage->get('protocol'));
                $this->setPort($this->storage->get('port'));
                $this->setClientCertPath($this->storage->get('client_cert_path'));
                $this->setCACertPath($this->storage->get('ca_cert_path'));
                $this->setKeyPath($this->storage->get('key_path'));
                $this->setKeyPassword($this->storage->get('key_password'));
                $this->setPollingTime($this->storage->get('polling',128));
                $this->setImportId($this->storage->get('import_id'));
                $this->setEnabledStatus((int) $this->storage->get('active'));
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilECSSettings::save (  ) 

save settings

public

Definition at line 395 of file class.ilECSSettings.php.

References getCACertPath(), getClientCertPath(), getImportId(), getKeyPassword(), getKeyPath(), getPollingTime(), getPort(), getProtocol(), getServer(), and isEnabled().

        {
                $this->storage->set('active',(int) $this->isEnabled());
                $this->storage->set('server',$this->getServer());
                $this->storage->set('port',$this->getPort());
                $this->storage->set('protocol',$this->getProtocol());
                $this->storage->set('client_cert_path',$this->getClientCertPath());
                $this->storage->set('ca_cert_path',$this->getCACertPath());
                $this->storage->set('key_path',$this->getKeyPath());
                $this->storage->set('key_password',$this->getKeyPassword());
                $this->storage->set('import_id',$this->getImportId());
                $this->storage->set('polling',$this->getPollingTime());
        }

Here is the call graph for this function:

ilECSSettings::setCACertPath ( a_ca  ) 

set ca cert path

public

Parameters:
string ca cert path

Definition at line 283 of file class.ilECSSettings.php.

Referenced by read().

        {
                $this->ca_cert_path = $a_ca;
        }

Here is the caller graph for this function:

ilECSSettings::setClientCertPath ( a_path  ) 

set

public

Parameters:
 

Definition at line 261 of file class.ilECSSettings.php.

Referenced by read().

        {
                $this->client_cert_path = $a_path;
        }

Here is the caller graph for this function:

ilECSSettings::setEnabledStatus ( a_status  ) 

en/disable ecs functionality

public

Parameters:
bool status

Definition at line 87 of file class.ilECSSettings.php.

Referenced by read().

        {
                $this->active = $a_status;
        }

Here is the caller graph for this function:

ilECSSettings::setImportId ( a_id  ) 

set import id Object of category, that store new remote courses

public

Definition at line 352 of file class.ilECSSettings.php.

Referenced by read().

        {
                $this->import_id = $a_id;
        }

Here is the caller graph for this function:

ilECSSettings::setKeyPassword ( a_pass  ) 

set key password

public

Parameters:
string key password

Definition at line 340 of file class.ilECSSettings.php.

Referenced by read().

        {
                $this->key_password = $a_pass;  
        }

Here is the caller graph for this function:

ilECSSettings::setKeyPath ( a_path  ) 

set key path

public

Parameters:
string key path

Definition at line 317 of file class.ilECSSettings.php.

Referenced by read().

        {
                $this->key_path = $a_path;
        }

Here is the caller graph for this function:

ilECSSettings::setPollingTime ( a_time  ) 

set polling time

public

Parameters:
int polling time

Definition at line 203 of file class.ilECSSettings.php.

Referenced by read(), and setPollingTimeMS().

        {
                $this->polling = $a_time;
        }

Here is the caller graph for this function:

ilECSSettings::setPollingTimeMS ( a_min,
a_sec 
)

Set polling time.

public

Parameters:
int minutes
int seconds

Definition at line 249 of file class.ilECSSettings.php.

References setPollingTime().

        {
                $this->setPollingTime(60 * $a_min + $a_sec);
        }

Here is the call graph for this function:

ilECSSettings::setPort ( a_port  ) 

set port

public

Parameters:
int port

Definition at line 179 of file class.ilECSSettings.php.

Referenced by read().

        {
                $this->port = $a_port;
        }

Here is the caller graph for this function:

ilECSSettings::setProtocol ( a_prot  ) 

set protocol

public

Parameters:
 

Definition at line 156 of file class.ilECSSettings.php.

Referenced by read().

        {
                $this->protocol = $a_prot;
        }

Here is the caller graph for this function:

ilECSSettings::setServer ( a_server  ) 

set server

public

Parameters:
 

Definition at line 110 of file class.ilECSSettings.php.

Referenced by read().

        {
                $this->server = $a_server;
        }

Here is the caller graph for this function:

ilECSSettings::validate (  ) 

Validate settings.

public

Parameters:
void 
Returns:
bool

Definition at line 375 of file class.ilECSSettings.php.

References getCACertPath(), getClientCertPath(), getKeyPassword(), getKeyPath(), getPort(), getServer(), and isEnabled().

        {
                if(!$this->isEnabled())
                {
                        return true;
                }
                if(!$this->getServer() or !$this->getPort() or !$this->getClientCertPath() or !$this->getCACertPath()
                        or !$this->getKeyPath() or !$this->getKeyPassword())
                {
                        return false;
                }
                return true;
        }

Here is the call graph for this function:


Field Documentation

ilECSSettings::$active = false [private]

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

ilECSSettings::$ca_cert_path [private]

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

ilECSSettings::$client_cert_path [private]

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

ilECSSettings::$fisch = 5

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

ilECSSettings::$import_id [private]

Definition at line 51 of file class.ilECSSettings.php.

ilECSSettings::$instance = null [static, protected]

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

ilECSSettings::$key_path [private]

Definition at line 48 of file class.ilECSSettings.php.

ilECSSettings::$key_pathword [private]

Definition at line 49 of file class.ilECSSettings.php.

ilECSSettings::$polling [private]

Definition at line 50 of file class.ilECSSettings.php.

ilECSSettings::$port [private]

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

ilECSSettings::$protocol [private]

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

ilECSSettings::$server [private]

Definition at line 43 of file class.ilECSSettings.php.

Definition at line 35 of file class.ilECSSettings.php.


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