ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSSetting Class Reference
+ Collaboration diagram for ilECSSetting:

Public Member Functions

 setTitle ($a_title)
 Set title.
 getTitle ()
 Get title.
 setAuthType ($a_auth_type)
 Set auth type.
 getAuthType ()
 Get auth type.
 setAuthUser ($a_user)
 Set apache auth user.
 getAuthUser ()
 Get apache auth user.
 setAuthPass ($a_pass)
 Set Apache auth password.
 getAuthPass ()
 Get auth password.
 getServerId ()
 Get current server id.
 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
 setCertSerialNumber ($a_cert_serial)
 set cert serial number
 getCertSerialNumber ()
 get cert serial number
 getGlobalRole ()
 get global role
 setGlobalRole ($a_role_id)
 set default global role
 setDuration ($a_duration)
 set Duration
 getDuration ()
 get duration
 getUserRecipients ()
 Get new user recipients.
 getUserRecipientsAsString ()
 Get new user recipients.
 setUserRecipients ($a_logins)
 set user recipients
 getEContentRecipients ()
 get Econtent recipients
 getEContentRecipientsAsString ()
 get EContent recipients as string
 setEContentRecipients ($a_logins)
 set EContent recipients
 getApprovalRecipients ()
 get approval recipients
 getApprovalRecipientsAsString ()
 get approval recipients as string
 setApprovalRecipients ($a_rcp)
 set approval recipients
 validate ()
 Validate settings.
 checkImportId ()
 check import id
 save ()
 save settings
 update ()
 Update setting.
 delete ()
 Delete.
 fetchCertificateExpiration ()
 Fetch validity (expired date) ilLog $ilLog.
 __clone ()
 Overwritten clone method Reset all connection settings.

Static Public Member Functions

static _getInstance ()
 singleton getInstance
static getInstanceByServerId ($a_server_id)
 Get singleton instance per server.

Data Fields

const ERROR_EXTRACT_SERIAL = 'ecs_error_extract_serial'
const ERROR_REQUIRED = 'fill_out_all_required_fields'
const ERROR_INVALID_IMPORT_ID = 'ecs_check_import_id'
const ERROR_CERT_EXPIRED = 'ecs_certificate_expired'
const AUTH_CERTIFICATE = 1
const AUTH_APACHE = 2
const DEFAULT_DURATION = 6
const PROTOCOL_HTTP = 0
const PROTOCOL_HTTPS = 1

Static Protected Attributes

static $instances = null

Private Member Functions

 __construct ($a_server_id=0)
 Singleton contructor.
 fetchSerialID ()
 Fetch serial ID from cert.
 read ()
 Read settings.

Private Attributes

 $server_id = 0
 $active = false
 $title = ''
 $auth_type = self::AUTH_CERTIFICATE
 $server
 $protocol
 $port
 $client_cert_path
 $ca_cert_path
 $key_path
 $key_password
 $polling
 $import_id
 $cert_serial
 $global_role
 $duration
 $auth_user = ''
 $auth_pass = ''
 $user_recipients = array()
 $econtent_recipients = array()
 $approval_recipients = array()

Detailed Description

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

Constructor & Destructor Documentation

ilECSSetting::__construct (   $a_server_id = 0)
private

Singleton contructor.

private

Definition at line 81 of file class.ilECSSetting.php.

References read().

{
$this->server_id = $a_server_id;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilECSSetting::__clone ( )

Overwritten clone method Reset all connection settings.

Definition at line 964 of file class.ilECSSetting.php.

References getTitle(), setAuthPass(), setAuthType(), setAuthUser(), setCACertPath(), setCertSerialNumber(), setClientCertPath(), setEnabledStatus(), setKeyPassword(), setKeyPath(), setPort(), setProtocol(), setServer(), and setTitle().

{
$this->server_id = 0;
$this->setTitle($this->getTitle(). ' (Copy)');
$this->setEnabledStatus(false);
$this->setServer('');
$this->setProtocol(self::PROTOCOL_HTTPS);
$this->setPort(0);
$this->setClientCertPath('');
$this->setKeyPath('');
$this->setKeyPassword('');
$this->setCACertPath('');
$this->setCertSerialNumber('');
$this->setAuthType(self::AUTH_CERTIFICATE);
$this->setAuthUser('');
$this->setAuthPass('');
}

+ Here is the call graph for this function:

static ilECSSetting::_getInstance ( )
static

singleton getInstance

public

Deprecated:

Definition at line 95 of file class.ilECSSetting.php.

References $GLOBALS, and getInstanceByServerId().

Referenced by ilECSAppEventListener\_sendNotification(), and ilECSAppEventListener\handleEvent().

{
$GLOBALS['ilLog']->write(__METHOD__.': Using deprecated call.');
$GLOBALS['ilLog']->logStack();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSSetting::checkImportId ( )

check import id

public

Definition at line 737 of file class.ilECSSetting.php.

References getImportId().

Referenced by validate().

{
global $ilObjDataCache,$tree;
if(!$this->getImportId())
{
return false;
}
if($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getImportId())) != 'cat')
{
return false;
}
if($tree->isDeleted($this->getImportId()))
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSSetting::delete ( )

Delete.

Definition at line 832 of file class.ilECSSetting.php.

References $ilDB.

{
global $ilDB;
$ilDB->manipulate(
'DELETE FROM ecs_server '.
'WHERE server_id = '.$ilDB->quote($this->getServerId(),'integer')
);
return true;
}
ilECSSetting::fetchCertificateExpiration ( )

Fetch validity (expired date) ilLog $ilLog.

Returns
bool

Definition at line 849 of file class.ilECSSetting.php.

References $ilLog, ilDatePresentation\formatDate(), getAuthType(), getClientCertPath(), and IL_CAL_UNIX.

Referenced by validate().

{
global $ilLog;
if($this->getAuthType() != self::AUTH_CERTIFICATE)
{
return null;
}
if(function_exists('openssl_x509_parse') and $cert = openssl_x509_parse('file://'.$this->getClientCertPath()))
{
if(isset($cert['validTo_time_t']) and $cert['validTo_time_t'])
{
$dt = new ilDateTime($cert['validTo_time_t'], IL_CAL_UNIX);
$ilLog->write(__METHOD__.': Certificate expires at '.ilDatePresentation::formatDate($dt));
return $dt;
}
}
return null;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSSetting::fetchSerialID ( )
private

Fetch serial ID from cert.

private

Definition at line 876 of file class.ilECSSetting.php.

References $ilLog, getClientCertPath(), and setCertSerialNumber().

Referenced by validate().

{
global $ilLog;
if(function_exists('openssl_x509_parse') and $cert = openssl_x509_parse('file://'.$this->getClientCertPath()))
{
if(isset($cert['serialNumber']) and $cert['serialNumber'])
{
$this->setCertSerialNumber($cert['serialNumber']);
$ilLog->write(__METHOD__.': Serial number is '.$cert['serialNumber']);
return true;
}
}
if(!file_exists($this->getClientCertPath()) or !is_readable($this->getClientCertPath()))
{
return false;
}
$lines = file($this->getClientCertPath());
$found = false;
foreach($lines as $line)
{
if(strpos($line,'Serial Number:') !== false)
{
$found = true;
$serial_line = explode(':',$line);
$serial = (int) trim($serial_line[1]);
break;
}
}
if($found)
{
$this->setCertSerialNumber($serial);
return true;
}
else
{
return false;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSSetting::getApprovalRecipients ( )

get approval recipients

public

Returns
bool

Definition at line 648 of file class.ilECSSetting.php.

{
return explode(',',$this->approval_recipients);
}
ilECSSetting::getApprovalRecipientsAsString ( )

get approval recipients as string

public

Parameters
@return

Definition at line 660 of file class.ilECSSetting.php.

{
return $this->approval_recipients ? $this->approval_recipients : '';
}
ilECSSetting::getAuthPass ( )

Get auth password.

Returns
string

Definition at line 183 of file class.ilECSSetting.php.

References $auth_pass.

Referenced by validate().

{
}

+ Here is the caller graph for this function:

ilECSSetting::getAuthType ( )

Get auth type.

Returns
int

Definition at line 147 of file class.ilECSSetting.php.

References $auth_type.

Referenced by fetchCertificateExpiration(), and validate().

{
}

+ Here is the caller graph for this function:

ilECSSetting::getAuthUser ( )

Get apache auth user.

Returns
string

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

References $auth_user.

Referenced by validate().

{
}

+ Here is the caller graph for this function:

ilECSSetting::getCACertPath ( )

get ca cert path

public

Definition at line 432 of file class.ilECSSetting.php.

References $ca_cert_path.

Referenced by validate().

{
}

+ Here is the caller graph for this function:

ilECSSetting::getCertSerialNumber ( )

get cert serial number

public

Definition at line 523 of file class.ilECSSetting.php.

{
return $this->cert_serial_number;
}
ilECSSetting::getClientCertPath ( )

get certificate path

public

Definition at line 409 of file class.ilECSSetting.php.

References $client_cert_path.

Referenced by fetchCertificateExpiration(), fetchSerialID(), and validate().

+ Here is the caller graph for this function:

ilECSSetting::getDuration ( )

get duration

public

Definition at line 569 of file class.ilECSSetting.php.

References DEFAULT_DURATION.

Referenced by validate().

{
return $this->duration ? $this->duration : self::DEFAULT_DURATION;
}

+ Here is the caller graph for this function:

ilECSSetting::getEContentRecipients ( )

get Econtent recipients

public

Definition at line 614 of file class.ilECSSetting.php.

{
return explode(',',$this->econtent_recipients);
}
ilECSSetting::getEContentRecipientsAsString ( )

get EContent recipients as string

public

Definition at line 625 of file class.ilECSSetting.php.

{
return $this->econtent_recipients ? $this->econtent_recipients : '';
}
ilECSSetting::getGlobalRole ( )

get global role

public

Definition at line 534 of file class.ilECSSetting.php.

References $global_role.

Referenced by validate().

{
}

+ Here is the caller graph for this function:

ilECSSetting::getImportId ( )

get import id

public

Definition at line 500 of file class.ilECSSetting.php.

References $import_id.

Referenced by checkImportId(), and validate().

{
}

+ Here is the caller graph for this function:

ilECSSetting::getKeyPassword ( )

get key password

public

Definition at line 466 of file class.ilECSSetting.php.

References $key_password.

Referenced by validate().

{
}

+ Here is the caller graph for this function:

ilECSSetting::getKeyPath ( )

get key path

public

Definition at line 443 of file class.ilECSSetting.php.

References $key_path.

Referenced by validate().

{
}

+ Here is the caller graph for this function:

ilECSSetting::getPollingTime ( )

get polling time

public

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

References $polling.

Referenced by validate().

{
}

+ Here is the caller graph for this function:

ilECSSetting::getPollingTimeMinutes ( )

get polling time minutes

public

Definition at line 374 of file class.ilECSSetting.php.

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

get polling time seconds (<60)

public

Definition at line 363 of file class.ilECSSetting.php.

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

get port

public

Parameters

Definition at line 329 of file class.ilECSSetting.php.

References $port.

Referenced by validate().

{
return $this->port;
}

+ Here is the caller graph for this function:

ilECSSetting::getProtocol ( )

get protocol

public

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

References $protocol.

Referenced by getServerURI().

{
}

+ Here is the caller graph for this function:

ilECSSetting::getServer ( )

get server

public

Parameters

Definition at line 239 of file class.ilECSSetting.php.

References $server.

Referenced by getServerURI(), and validate().

{
return $this->server;
}

+ Here is the caller graph for this function:

ilECSSetting::getServerId ( )

Get current server id.

Returns
int

Definition at line 192 of file class.ilECSSetting.php.

References $server_id.

Referenced by ilECSCommunityTableGUI\__construct(), ilECSEventQueueReader\handleExportReset(), ilECSEventQueueReader\handleImportReset(), and read().

{
return (int) $this->server_id;
}

+ Here is the caller graph for this function:

ilECSSetting::getServerURI ( )

get complete server uri

public

Definition at line 250 of file class.ilECSSetting.php.

References getProtocol(), and getServer().

{
switch($this->getProtocol())
{
case self::PROTOCOL_HTTP:
$uri = 'http://';
break;
case self::PROTOCOL_HTTPS:
$uri = 'https://';
break;
}
if(stristr($this->getServer(), '/'))
{
$counter = 0;
foreach((array) explode('/',$this->getServer()) as $key => $part)
{
$uri .= $part;
if(!$counter)
{
$uri .= ':'.$this->getPort();
}
$uri .= '/';
++$counter;
}
$uri = substr($uri,0,-1);
}
else
{
$uri .= $this->getServer();
$uri .= (':'.$this->getPort());
}
return $uri;
}

+ Here is the call graph for this function:

ilECSSetting::getTitle ( )

Get title.

Returns
string title

Definition at line 129 of file class.ilECSSetting.php.

References $title.

Referenced by __clone().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilECSSetting::getUserRecipients ( )

Get new user recipients.

public

Definition at line 580 of file class.ilECSSetting.php.

{
return explode(',',$this->user_recipients);
}
ilECSSetting::getUserRecipientsAsString ( )

Get new user recipients.

public

Definition at line 591 of file class.ilECSSetting.php.

{
return $this->user_recipients ? $this->user_recipients : '';
}
ilECSSetting::isEnabled ( )

is enabled

public

Definition at line 215 of file class.ilECSSetting.php.

References $active.

Referenced by validate().

{
return $this->active;
}

+ Here is the caller graph for this function:

ilECSSetting::read ( )
private

Read settings.

private

Definition at line 923 of file class.ilECSSetting.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_ASSOC, getServerId(), setAuthPass(), setAuthType(), setAuthUser(), setCACertPath(), setCertSerialNumber(), setClientCertPath(), setDuration(), setEnabledStatus(), setGlobalRole(), setImportId(), setKeyPassword(), setKeyPath(), setPollingTime(), setPort(), setProtocol(), setServer(), and setTitle().

Referenced by __construct().

{
global $ilDB;
if(!$this->getServerId())
{
return false;
}
$query = 'SELECT * FROM ecs_server '.
'WHERE server_id = '.$ilDB->quote($this->getServerId(),'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
$this->setServer($row['server']);
$this->setTitle($row['title']);
$this->setProtocol($row['protocol']);
$this->setPort($row['port']);
$this->setClientCertPath($row['client_cert_path']);
$this->setCACertPath($row['ca_cert_path']);
$this->setKeyPath($row['key_path']);
$this->setKeyPassword($row['key_password']);
$this->setPollingTime($row['polling_time']);
$this->setImportId($row['import_id']);
$this->setEnabledStatus((int) $row['active']);
$this->setCertSerialNumber($row['cert_serial']);
$this->setGlobalRole($row['global_role']);
$this->econtent_recipients = $row['econtent_rcp'];
$this->approval_recipients = $row['approval_rcp'];
$this->user_recipients = $row['user_rcp'];
$this->setDuration($row['duration']);
$this->setAuthUser($row['auth_user']);
$this->setAuthPass($row['auth_pass']);
$this->setAuthType($row['auth_type']);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSSetting::save ( )

save settings

public

Definition at line 762 of file class.ilECSSetting.php.

References $ilDB.

{
global $ilDB;
$this->server_id = $ilDB->nextId('ecs_server');
$ilDB->manipulate($q = 'INSERT INTO ecs_server (server_id,active,title,protocol,server,port,auth_type,client_cert_path,ca_cert_path,'.
'key_path,key_password,cert_serial,polling_time,import_id,global_role,econtent_rcp,user_rcp,approval_rcp,duration,auth_user,auth_pass) '.
'VALUES ('.
$ilDB->quote($this->getServerId(),'integer').', '.
$ilDB->quote((int) $this->isEnabled(),'integer').', '.
$ilDB->quote($this->getTitle(),'text').', '.
$ilDB->quote((int) $this->getProtocol(),'integer').', '.
$ilDB->quote($this->getServer(),'text').', '.
$ilDB->quote($this->getPort(),'integer').', '.
$ilDB->quote($this->getAuthType(),'integer').', '.
$ilDB->quote($this->getClientCertPath(),'text').', '.
$ilDB->quote($this->getCACertPath(),'text').', '.
$ilDB->quote($this->getKeyPath(),'text').', '.
$ilDB->quote($this->getKeyPassword(),'text').', '.
$ilDB->quote($this->getCertSerialNumber(),'text').', '.
$ilDB->quote($this->getPollingTime(),'integer').', '.
$ilDB->quote($this->getImportId(),'integer').', '.
$ilDB->quote($this->getGlobalRole(),'integer').', '.
$ilDB->quote($this->getEContentRecipientsAsString(),'text').', '.
$ilDB->quote($this->getUserRecipientsAsString(),'text').', '.
$ilDB->quote($this->getApprovalRecipientsAsString(),'text').', '.
$ilDB->quote($this->getDuration(),'integer').', '.
$ilDB->quote($this->getAuthUser(),'text').', '.
$ilDB->quote($this->getAuthPass(),'text').' '.
')'
);
}
ilECSSetting::setApprovalRecipients (   $a_rcp)

set approval recipients

public

Parameters
stringrecipients

Definition at line 671 of file class.ilECSSetting.php.

{
$this->approval_recipients = $a_rcp;
}
ilECSSetting::setAuthPass (   $a_pass)

Set Apache auth password.

Parameters
string$a_pass

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

Referenced by __clone(), and read().

{
$this->auth_pass = $a_pass;
}

+ Here is the caller graph for this function:

ilECSSetting::setAuthType (   $a_auth_type)

Set auth type.

Parameters
int$a_auth_type

Definition at line 138 of file class.ilECSSetting.php.

Referenced by __clone(), and read().

{
$this->auth_type = $a_auth_type;
}

+ Here is the caller graph for this function:

ilECSSetting::setAuthUser (   $a_user)

Set apache auth user.

Parameters
string$a_user

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

Referenced by __clone(), and read().

{
$this->auth_user = $a_user;
}

+ Here is the caller graph for this function:

ilECSSetting::setCACertPath (   $a_ca)

set ca cert path

public

Parameters
stringca cert path

Definition at line 421 of file class.ilECSSetting.php.

Referenced by __clone(), and read().

{
$this->ca_cert_path = $a_ca;
}

+ Here is the caller graph for this function:

ilECSSetting::setCertSerialNumber (   $a_cert_serial)

set cert serial number

public

Parameters

Definition at line 512 of file class.ilECSSetting.php.

Referenced by __clone(), fetchSerialID(), and read().

{
$this->cert_serial_number = $a_cert_serial;
}

+ Here is the caller graph for this function:

ilECSSetting::setClientCertPath (   $a_path)

set

public

Parameters

Definition at line 399 of file class.ilECSSetting.php.

Referenced by __clone(), and read().

{
$this->client_cert_path = $a_path;
}

+ Here is the caller graph for this function:

ilECSSetting::setDuration (   $a_duration)

set Duration

public

Parameters
intduration

Definition at line 558 of file class.ilECSSetting.php.

Referenced by read().

{
$this->duration = $a_duration;
}

+ Here is the caller graph for this function:

ilECSSetting::setEContentRecipients (   $a_logins)

set EContent recipients

public

Parameters
arrayof user obj_ids

Definition at line 637 of file class.ilECSSetting.php.

{
$this->econtent_recipients = $a_logins;
}
ilECSSetting::setEnabledStatus (   $a_status)

en/disable ecs functionality

public

Parameters
boolstatus

Definition at line 204 of file class.ilECSSetting.php.

Referenced by __clone(), and read().

{
$this->active = $a_status;
}

+ Here is the caller graph for this function:

ilECSSetting::setGlobalRole (   $a_role_id)

set default global role

public

Parameters
introle_id

Definition at line 546 of file class.ilECSSetting.php.

Referenced by read().

{
$this->global_role = $a_role_id;
}

+ Here is the caller graph for this function:

ilECSSetting::setImportId (   $a_id)

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

public

Definition at line 490 of file class.ilECSSetting.php.

Referenced by read().

{
$this->import_id = $a_id;
}

+ Here is the caller graph for this function:

ilECSSetting::setKeyPassword (   $a_pass)

set key password

public

Parameters
stringkey password

Definition at line 478 of file class.ilECSSetting.php.

Referenced by __clone(), and read().

{
$this->key_password = $a_pass;
}

+ Here is the caller graph for this function:

ilECSSetting::setKeyPath (   $a_path)

set key path

public

Parameters
stringkey path

Definition at line 455 of file class.ilECSSetting.php.

Referenced by __clone(), and read().

{
$this->key_path = $a_path;
}

+ Here is the caller graph for this function:

ilECSSetting::setPollingTime (   $a_time)

set polling time

public

Parameters
intpolling time

Definition at line 341 of file class.ilECSSetting.php.

Referenced by read(), and setPollingTimeMS().

{
$this->polling = $a_time;
}

+ Here is the caller graph for this function:

ilECSSetting::setPollingTimeMS (   $a_min,
  $a_sec 
)

Set polling time.

public

Parameters
intminutes
intseconds

Definition at line 387 of file class.ilECSSetting.php.

References setPollingTime().

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

+ Here is the call graph for this function:

ilECSSetting::setPort (   $a_port)

set port

public

Parameters
intport

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

Referenced by __clone(), and read().

{
$this->port = $a_port;
}

+ Here is the caller graph for this function:

ilECSSetting::setProtocol (   $a_prot)

set protocol

public

Parameters

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

Referenced by __clone(), and read().

{
$this->protocol = $a_prot;
}

+ Here is the caller graph for this function:

ilECSSetting::setServer (   $a_server)

set server

public

Parameters

Definition at line 227 of file class.ilECSSetting.php.

Referenced by __clone(), and read().

{
$this->server = $a_server;
}

+ Here is the caller graph for this function:

ilECSSetting::setTitle (   $a_title)

Set title.

Parameters
string$a_title

Definition at line 120 of file class.ilECSSetting.php.

Referenced by __clone(), and read().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilECSSetting::setUserRecipients (   $a_logins)

set user recipients

public

Parameters
arrayof recipients (array of user login names)

Definition at line 603 of file class.ilECSSetting.php.

{
$this->user_recipients = $a_logins;
}
ilECSSetting::update ( )

Update setting.

Definition at line 798 of file class.ilECSSetting.php.

References $ilDB.

{
global $ilDB;
$ilDB->manipulate('UPDATE ecs_server SET '.
'server_id = '.$ilDB->quote($this->getServerId(),'integer').', '.
'active = '.$ilDB->quote((int) $this->isEnabled(),'integer').', '.
'title = '.$ilDB->quote($this->getTitle(),'text').', '.
'protocol = '.$ilDB->quote((int) $this->getProtocol(),'integer').', '.
'server = '.$ilDB->quote($this->getServer(),'text').', '.
'port = '.$ilDB->quote($this->getPort(),'integer').', '.
'auth_type = '.$ilDB->quote($this->getAuthType(),'integer').', '.
'client_cert_path = '.$ilDB->quote($this->getClientCertPath(),'text').', '.
'ca_cert_path = '.$ilDB->quote($this->getCACertPath(),'text').', '.
'key_path = '.$ilDB->quote($this->getKeyPath(),'text').', '.
'key_password = '.$ilDB->quote($this->getKeyPassword(),'text').', '.
'cert_serial = '.$ilDB->quote($this->getCertSerialNumber(),'text').', '.
'polling_time = '.$ilDB->quote($this->getPollingTime(),'integer').', '.
'import_id = '.$ilDB->quote($this->getImportId(),'integer').', '.
'global_role = '.$ilDB->quote($this->getGlobalRole(),'integer').', '.
'econtent_rcp = '.$ilDB->quote($this->getEContentRecipientsAsString(),'text').', '.
'user_rcp = '.$ilDB->quote($this->getUserRecipientsAsString(),'text').', '.
'approval_rcp = '.$ilDB->quote($this->getApprovalRecipientsAsString(),'text').', '.
'duration = '.$ilDB->quote($this->getDuration(),'integer').', '.
'auth_user = '.$ilDB->quote($this->getAuthUser(),'text').', '.
'auth_pass = '.$ilDB->quote($this->getAuthPass(),'text').', '.
'auth_type = '.$ilDB->quote($this->getAuthType(),'integer').' '.
'WHERE server_id = '.$ilDB->quote($this->getServerId(),'integer')
);
}
ilECSSetting::validate ( )

Validate settings.

public

Parameters
void
Returns
bool

Definition at line 684 of file class.ilECSSetting.php.

References AUTH_APACHE, checkImportId(), ERROR_CERT_EXPIRED, ERROR_EXTRACT_SERIAL, ERROR_INVALID_IMPORT_ID, ERROR_REQUIRED, fetchCertificateExpiration(), fetchSerialID(), getAuthPass(), getAuthType(), getAuthUser(), getCACertPath(), getClientCertPath(), getDuration(), getGlobalRole(), getImportId(), getKeyPassword(), getKeyPath(), getPollingTime(), getPort(), getServer(), and isEnabled().

{
if(!$this->isEnabled())
{
return '';
}
// Cert based authentication
if($this->getAuthType() == self::AUTH_CERTIFICATE)
{
if(!$this->getClientCertPath() or !$this->getCACertPath() or !$this->getKeyPath() or !$this->getKeyPassword())
{
}
// Check import id
if(!$this->fetchSerialID())
{
}
{
}
}
// Apache auth
{
if(!$this->getAuthUser() or !$this->getAuthPass())
{
}
}
// required fields
if(!$this->getServer() or !$this->getPort() or !$this->getPollingTime() or !$this->getImportId()
or !$this->getGlobalRole() or !$this->getDuration())
{
}
if(!$this->checkImportId())
{
}
return '';
}

+ Here is the call graph for this function:

Field Documentation

ilECSSetting::$active = false
private

Definition at line 53 of file class.ilECSSetting.php.

Referenced by isEnabled().

ilECSSetting::$approval_recipients = array()
private

Definition at line 74 of file class.ilECSSetting.php.

ilECSSetting::$auth_pass = ''
private

Definition at line 70 of file class.ilECSSetting.php.

Referenced by getAuthPass().

ilECSSetting::$auth_type = self::AUTH_CERTIFICATE
private

Definition at line 55 of file class.ilECSSetting.php.

Referenced by getAuthType().

ilECSSetting::$auth_user = ''
private

Definition at line 69 of file class.ilECSSetting.php.

Referenced by getAuthUser().

ilECSSetting::$ca_cert_path
private

Definition at line 60 of file class.ilECSSetting.php.

Referenced by getCACertPath().

ilECSSetting::$cert_serial
private

Definition at line 65 of file class.ilECSSetting.php.

ilECSSetting::$client_cert_path
private

Definition at line 59 of file class.ilECSSetting.php.

Referenced by getClientCertPath().

ilECSSetting::$duration
private

Definition at line 67 of file class.ilECSSetting.php.

ilECSSetting::$econtent_recipients = array()
private

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

ilECSSetting::$global_role
private

Definition at line 66 of file class.ilECSSetting.php.

Referenced by getGlobalRole().

ilECSSetting::$import_id
private

Definition at line 64 of file class.ilECSSetting.php.

Referenced by getImportId().

ilECSSetting::$instances = null
staticprotected

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

ilECSSetting::$key_password
private

Definition at line 62 of file class.ilECSSetting.php.

Referenced by getKeyPassword().

ilECSSetting::$key_path
private

Definition at line 61 of file class.ilECSSetting.php.

Referenced by getKeyPath().

ilECSSetting::$polling
private

Definition at line 63 of file class.ilECSSetting.php.

Referenced by getPollingTime().

ilECSSetting::$port
private

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

Referenced by getPort().

ilECSSetting::$protocol
private

Definition at line 57 of file class.ilECSSetting.php.

Referenced by getProtocol().

ilECSSetting::$server
private

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

Referenced by getServer().

ilECSSetting::$server_id = 0
private

Definition at line 52 of file class.ilECSSetting.php.

Referenced by getServerId().

ilECSSetting::$title = ''
private

Definition at line 54 of file class.ilECSSetting.php.

Referenced by getTitle().

ilECSSetting::$user_recipients = array()
private

Definition at line 72 of file class.ilECSSetting.php.

const ilECSSetting::AUTH_APACHE = 2

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

Referenced by ilECSConnector\prepareConnection().

const ilECSSetting::AUTH_CERTIFICATE = 1
const ilECSSetting::DEFAULT_DURATION = 6

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

Referenced by getDuration().

const ilECSSetting::ERROR_CERT_EXPIRED = 'ecs_certificate_expired'

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

Referenced by validate().

const ilECSSetting::ERROR_EXTRACT_SERIAL = 'ecs_error_extract_serial'

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

Referenced by validate().

const ilECSSetting::ERROR_INVALID_IMPORT_ID = 'ecs_check_import_id'

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

Referenced by validate().

const ilECSSetting::ERROR_REQUIRED = 'fill_out_all_required_fields'

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

Referenced by validate().

const ilECSSetting::PROTOCOL_HTTP = 0

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

const ilECSSetting::PROTOCOL_HTTPS = 1

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

Referenced by ilECSSettingsGUI\initSettingsForm().


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