ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSSetting Class Reference
+ Collaboration diagram for ilECSSetting:

Public Member Functions

 setTitle ($a_title)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setAuthType ($a_auth_type)
 Set auth type. More...
 
 getAuthType ()
 Get auth type. More...
 
 setAuthUser ($a_user)
 Set apache auth user. More...
 
 getAuthUser ()
 Get apache auth user. More...
 
 setAuthPass ($a_pass)
 Set Apache auth password. More...
 
 getAuthPass ()
 Get auth password. More...
 
 getServerId ()
 Get current server id. More...
 
 setEnabledStatus ($a_status)
 en/disable ecs functionality More...
 
 isEnabled ()
 is enabled More...
 
 setServer ($a_server)
 set server More...
 
 getServer ()
 get server More...
 
 getServerURI ()
 get complete server uri More...
 
 setProtocol ($a_prot)
 set protocol More...
 
 getProtocol ()
 get protocol More...
 
 setPort ($a_port)
 set port More...
 
 getPort ()
 get port More...
 
 setPollingTime ($a_time)
 set polling time More...
 
 getPollingTime ()
 get polling time More...
 
 getPollingTimeSeconds ()
 get polling time seconds (<60) More...
 
 getPollingTimeMinutes ()
 get polling time minutes More...
 
 setPollingTimeMS ($a_min, $a_sec)
 Set polling time. More...
 
 setClientCertPath ($a_path)
 set More...
 
 getClientCertPath ()
 get certificate path More...
 
 setCACertPath ($a_ca)
 set ca cert path More...
 
 getCACertPath ()
 get ca cert path More...
 
 getKeyPath ()
 get key path More...
 
 setKeyPath ($a_path)
 set key path More...
 
 getKeyPassword ()
 get key password More...
 
 setKeyPassword ($a_pass)
 set key password More...
 
 setImportId ($a_id)
 set import id Object of category, that store new remote courses More...
 
 getImportId ()
 get import id More...
 
 setCertSerialNumber ($a_cert_serial)
 set cert serial number More...
 
 getCertSerialNumber ()
 get cert serial number More...
 
 getGlobalRole ()
 get global role More...
 
 setGlobalRole ($a_role_id)
 set default global role More...
 
 setDuration ($a_duration)
 set Duration More...
 
 getDuration ()
 get duration More...
 
 getUserRecipients ()
 Get new user recipients. More...
 
 getUserRecipientsAsString ()
 Get new user recipients. More...
 
 setUserRecipients ($a_logins)
 set user recipients More...
 
 getEContentRecipients ()
 get Econtent recipients More...
 
 getEContentRecipientsAsString ()
 get EContent recipients as string More...
 
 setEContentRecipients ($a_logins)
 set EContent recipients More...
 
 getApprovalRecipients ()
 get approval recipients More...
 
 getApprovalRecipientsAsString ()
 get approval recipients as string More...
 
 setApprovalRecipients ($a_rcp)
 set approval recipients More...
 
 validate ()
 Validate settings. More...
 
 checkImportId ()
 check import id More...
 
 save ()
 save settings More...
 
 update ()
 Update setting. More...
 
 delete ()
 Delete. More...
 
 fetchCertificateExpiration ()
 Fetch validity (expired date) More...
 
 __clone ()
 Overwritten clone method Reset all connection settings. More...
 

Static Public Member Functions

static _getInstance ()
 singleton getInstance More...
 
static getInstanceByServerId ($a_server_id)
 Get singleton instance per server. More...
 
static lookupAuthMode ()
 Lookup auth mode. More...
 

Data Fields

const DEFAULT_AUTH_MODE = 'ldap'
 
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. More...
 
 fetchSerialID ()
 Fetch serial ID from cert. More...
 
 read ()
 Read settings. More...
 

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

◆ __construct()

ilECSSetting::__construct (   $a_server_id = 0)
private

Singleton contructor.

@access private

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

84 {
85 $this->server_id = $a_server_id;
86 $this->read();
87 }
read()
Read settings.

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ __clone()

ilECSSetting::__clone ( )

Overwritten clone method Reset all connection settings.

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

969 {
970 $this->server_id = 0;
971 $this->setTitle($this->getTitle() . ' (Copy)');
972 $this->setEnabledStatus(false);
973 $this->setServer('');
974 $this->setProtocol(self::PROTOCOL_HTTPS);
975 $this->setPort(0);
976 $this->setClientCertPath('');
977 $this->setKeyPath('');
978 $this->setKeyPassword('');
979 $this->setCACertPath('');
980 $this->setCertSerialNumber('');
981 $this->setAuthType(self::AUTH_CERTIFICATE);
982 $this->setAuthUser('');
983 $this->setAuthPass('');
984 }
setAuthPass($a_pass)
Set Apache auth password.
setAuthType($a_auth_type)
Set auth type.
setTitle($a_title)
Set title.
setCertSerialNumber($a_cert_serial)
set cert serial number
setProtocol($a_prot)
set protocol
setAuthUser($a_user)
Set apache auth user.
setPort($a_port)
set port
getTitle()
Get title.
setServer($a_server)
set server
setClientCertPath($a_path)
set
setEnabledStatus($a_status)
en/disable ecs functionality
setCACertPath($a_ca)
set ca cert path
setKeyPath($a_path)
set key path
setKeyPassword($a_pass)
set key password

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

+ Here is the call graph for this function:

◆ _getInstance()

static ilECSSetting::_getInstance ( )
static

singleton getInstance

@access public

Deprecated:

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

98 {
99 $GLOBALS['DIC']->logger()->wsrv()->warning('Using deprecated call');
100 $GLOBALS['DIC']->logger()->wsrv()->logStack(ilLogLevel::WARNING);
101 return self::getInstanceByServerId(null);
102 }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $GLOBALS, getInstanceByServerId(), and ilLogLevel\WARNING.

+ Here is the call graph for this function:

◆ checkImportId()

ilECSSetting::checkImportId ( )

check import id

@access public

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

732 {
733 global $ilObjDataCache,$tree;
734
735 if (!$this->getImportId()) {
736 return false;
737 }
738 if ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getImportId())) != 'cat') {
739 return false;
740 }
741 if ($tree->isDeleted($this->getImportId())) {
742 return false;
743 }
744 return true;
745 }
getImportId()
get import id

References getImportId().

Referenced by validate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilECSSetting::delete ( )

Delete.

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

826 {
827 global $ilDB;
828
829 // --- cascading delete
830
831 include_once 'Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
833
834 include_once 'Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
836
837 include_once 'Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
839
840 include_once 'Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
842
843 include_once 'Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
845
846 include_once 'Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
848
849 include_once 'Services/WebServices/ECS/classes/class.ilECSExport.php';
851
852 // resetting server id to flag items in imported list
853 include_once 'Services/WebServices/ECS/classes/class.ilECSImport.php';
855
856 $ilDB->manipulate(
857 'DELETE FROM ecs_server ' .
858 'WHERE server_id = ' . $ilDB->quote($this->getServerId(), 'integer')
859 );
860
861 $this->server_id = null;
862 return true;
863 }
static deleteByServerId($a_server_id)
static deleteByServerId($a_server_id)
static deleteByServerId($a_server_id)
static deleteByServerId($a_server_id)
static resetServerId($a_server_id)
getServerId()
Get current server id.
global $ilDB

References $ilDB, ilECSCommunityCache\deleteByServerId(), ilECSDataMappingSetting\deleteByServerId(), ilECSEventQueueReader\deleteByServerId(), ilECSExport\deleteByServerId(), ilECSParticipantSetting\deleteByServerId(), ilECSNodeMappingAssignment\deleteByServerId(), ilECSCmsData\deleteByServerId(), getServerId(), and ilECSImport\resetServerId().

+ Here is the call graph for this function:

◆ fetchCertificateExpiration()

ilECSSetting::fetchCertificateExpiration ( )

Fetch validity (expired date)

Returns
bool

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

871 {
872 if ($this->getAuthType() != self::AUTH_CERTIFICATE) {
873 return null;
874 }
875
876 if (function_exists('openssl_x509_parse') and $cert = openssl_x509_parse('file://' . $this->getClientCertPath())) {
877 if (isset($cert['validTo_time_t']) and $cert['validTo_time_t']) {
878 $dt = new ilDateTime($cert['validTo_time_t'], IL_CAL_UNIX);
879
880 $GLOBALS['DIC']->logger()->wsrv()->debug('Certificate expires at: ' . ilDatePresentation::formatDate($dt));
881 return $dt;
882 }
883 }
884 return null;
885 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
@classDescription Date and time handling
getAuthType()
Get auth type.
getClientCertPath()
get certificate path

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

Referenced by validate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchSerialID()

ilECSSetting::fetchSerialID ( )
private

Fetch serial ID from cert.

@access private

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

894 {
895 if (function_exists('openssl_x509_parse') and $cert = openssl_x509_parse('file://' . $this->getClientCertPath())) {
896 if (isset($cert['serialNumber']) and $cert['serialNumber']) {
897 $this->setCertSerialNumber($cert['serialNumber']);
898 $GLOBALS['DIC']->logger()->wsrv()->debug('Searial number is: ' . $cert['serialNumber']);
899 return true;
900 }
901 }
902
903 if (!file_exists($this->getClientCertPath()) or !is_readable($this->getClientCertPath())) {
904 return false;
905 }
906 $lines = file($this->getClientCertPath());
907 $found = false;
908 foreach ($lines as $line) {
909 if (strpos($line, 'Serial Number:') !== false) {
910 $found = true;
911 $serial_line = explode(':', $line);
912 $serial = (int) trim($serial_line[1]);
913 break;
914 }
915 }
916 if ($found) {
917 $this->setCertSerialNumber($serial);
918 return true;
919 } else {
920 return false;
921 }
922 }

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

Referenced by validate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getApprovalRecipients()

ilECSSetting::getApprovalRecipients ( )

get approval recipients

@access public

Returns
bool

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

652 {
653 return explode(',', $this->approval_recipients);
654 }

Referenced by ilECSObjectSettings\sendNewContentNotification().

+ Here is the caller graph for this function:

◆ getApprovalRecipientsAsString()

ilECSSetting::getApprovalRecipientsAsString ( )

get approval recipients as string

@access public

Parameters

return

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

664 {
665 return $this->approval_recipients ? $this->approval_recipients : '';
666 }

Referenced by ilECSObjectSettings\sendNewContentNotification().

+ Here is the caller graph for this function:

◆ getAuthPass()

ilECSSetting::getAuthPass ( )

Get auth password.

Returns
string

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

193 {
194 return $this->auth_pass;
195 }

References $auth_pass.

Referenced by validate().

+ Here is the caller graph for this function:

◆ getAuthType()

ilECSSetting::getAuthType ( )

Get auth type.

Returns
int

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

157 {
158 return $this->auth_type;
159 }

References $auth_type.

Referenced by fetchCertificateExpiration(), and validate().

+ Here is the caller graph for this function:

◆ getAuthUser()

ilECSSetting::getAuthUser ( )

Get apache auth user.

Returns
string

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

175 {
176 return $this->auth_user;
177 }

References $auth_user.

Referenced by validate().

+ Here is the caller graph for this function:

◆ getCACertPath()

ilECSSetting::getCACertPath ( )

get ca cert path

@access public

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

436 {
437 return $this->ca_cert_path;
438 }

References $ca_cert_path.

Referenced by validate().

+ Here is the caller graph for this function:

◆ getCertSerialNumber()

ilECSSetting::getCertSerialNumber ( )

get cert serial number

@access public

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

527 {
528 return $this->cert_serial_number;
529 }

◆ getClientCertPath()

ilECSSetting::getClientCertPath ( )

get certificate path

@access public

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

413 {
415 }

References $client_cert_path.

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

+ Here is the caller graph for this function:

◆ getDuration()

ilECSSetting::getDuration ( )

get duration

@access public

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

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

References DEFAULT_DURATION.

Referenced by ilECSAppEventListener\extendAccount(), and validate().

+ Here is the caller graph for this function:

◆ getEContentRecipients()

ilECSSetting::getEContentRecipients ( )

get Econtent recipients

@access public

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

618 {
619 return explode(',', $this->econtent_recipients);
620 }

◆ getEContentRecipientsAsString()

ilECSSetting::getEContentRecipientsAsString ( )

get EContent recipients as string

@access public

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

629 {
630 return $this->econtent_recipients ? $this->econtent_recipients : '';
631 }

◆ getGlobalRole()

ilECSSetting::getGlobalRole ( )

get global role

@access public

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

538 {
539 return $this->global_role;
540 }

References $global_role.

Referenced by validate().

+ Here is the caller graph for this function:

◆ getImportId()

ilECSSetting::getImportId ( )

get import id

@access public

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

504 {
505 return $this->import_id;
506 }

References $import_id.

Referenced by checkImportId(), ilRemoteObjectBase\createFromECSEContent(), and validate().

+ Here is the caller graph for this function:

◆ getInstanceByServerId()

◆ getKeyPassword()

ilECSSetting::getKeyPassword ( )

get key password

@access public

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

470 {
471 return $this->key_password;
472 }

References $key_password.

Referenced by validate().

+ Here is the caller graph for this function:

◆ getKeyPath()

ilECSSetting::getKeyPath ( )

get key path

@access public

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

447 {
448 return $this->key_path;
449 }

References $key_path.

Referenced by validate().

+ Here is the caller graph for this function:

◆ getPollingTime()

ilECSSetting::getPollingTime ( )

get polling time

@access public

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

356 {
357 return $this->polling;
358 }

References $polling.

Referenced by validate().

+ Here is the caller graph for this function:

◆ getPollingTimeMinutes()

ilECSSetting::getPollingTimeMinutes ( )

get polling time minutes

@access public

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

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

◆ getPollingTimeSeconds()

ilECSSetting::getPollingTimeSeconds ( )

get polling time seconds (<60)

@access public

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

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

◆ getPort()

ilECSSetting::getPort ( )

get port

@access public

Parameters

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

333 {
334 return $this->port;
335 }

References $port.

Referenced by getServerURI(), and validate().

+ Here is the caller graph for this function:

◆ getProtocol()

ilECSSetting::getProtocol ( )

get protocol

@access public

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

309 {
310 return $this->protocol;
311 }

References $protocol.

Referenced by getServerURI().

+ Here is the caller graph for this function:

◆ getServer()

ilECSSetting::getServer ( )

get server

@access public

Parameters

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

249 {
250 return $this->server;
251 }

References $server.

Referenced by getServerURI(), and validate().

+ Here is the caller graph for this function:

◆ getServerId()

◆ getServerURI()

ilECSSetting::getServerURI ( )

get complete server uri

@access public

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

260 {
261 switch ($this->getProtocol()) {
263 $uri = 'http://';
264 break;
265
267 $uri = 'https://';
268 break;
269 }
270
271 if (stristr($this->getServer(), '/')) {
272 $counter = 0;
273 foreach ((array) explode('/', $this->getServer()) as $key => $part) {
274 $uri .= $part;
275 if (!$counter) {
276 $uri .= ':' . $this->getPort();
277 }
278 $uri .= '/';
279 ++$counter;
280 }
281 $uri = substr($uri, 0, -1);
282 } else {
283 $uri .= $this->getServer();
284 $uri .= (':' . $this->getPort());
285 }
286
287 return $uri;
288 }
getServer()
get server
getProtocol()
get protocol
$counter
$key
Definition: croninfo.php:18

References $counter, $key, getPort(), getProtocol(), getServer(), PROTOCOL_HTTP, and PROTOCOL_HTTPS.

+ Here is the call graph for this function:

◆ getTitle()

ilECSSetting::getTitle ( )

Get title.

Returns
string title

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

139 {
140 return $this->title;
141 }

References $title.

Referenced by __clone().

+ Here is the caller graph for this function:

◆ getUserRecipients()

ilECSSetting::getUserRecipients ( )

Get new user recipients.

@access public

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

584 {
585 return explode(',', (string) $this->user_recipients);
586 }

◆ getUserRecipientsAsString()

ilECSSetting::getUserRecipientsAsString ( )

Get new user recipients.

@access public

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

595 {
596 return $this->user_recipients ? $this->user_recipients : '';
597 }

◆ isEnabled()

ilECSSetting::isEnabled ( )

is enabled

@access public

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

225 {
226 return $this->active;
227 }

References $active.

Referenced by validate().

+ Here is the caller graph for this function:

◆ lookupAuthMode()

static ilECSSetting::lookupAuthMode ( )
static

Lookup auth mode.

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

121 {
123 }

References DEFAULT_AUTH_MODE.

◆ read()

ilECSSetting::read ( )
private

Read settings.

@access private

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

930 {
931 global $ilDB;
932
933 if (!$this->getServerId()) {
934 return false;
935 }
936
937 $query = 'SELECT * FROM ecs_server ' .
938 'WHERE server_id = ' . $ilDB->quote($this->getServerId(), 'integer');
939 $res = $ilDB->query($query);
940 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
941 $this->setServer($row['server']);
942 $this->setTitle($row['title']);
943 $this->setProtocol($row['protocol']);
944 $this->setPort($row['port']);
945 $this->setClientCertPath($row['client_cert_path']);
946 $this->setCACertPath($row['ca_cert_path']);
947 $this->setKeyPath($row['key_path']);
948 $this->setKeyPassword($row['key_password']);
949 $this->setPollingTime($row['polling_time']);
950 $this->setImportId($row['import_id']);
951 $this->setEnabledStatus((int) $row['active']);
952 $this->setCertSerialNumber($row['cert_serial']);
953 $this->setGlobalRole($row['global_role']);
954 $this->econtent_recipients = $row['econtent_rcp'];
955 $this->approval_recipients = $row['approval_rcp'];
956 $this->user_recipients = $row['user_rcp'];
957 $this->setDuration($row['duration']);
958 $this->setAuthUser($row['auth_user']);
959 $this->setAuthPass($row['auth_pass']);
960 $this->setAuthType($row['auth_type']);
961 }
962 }
setDuration($a_duration)
set Duration
setPollingTime($a_time)
set polling time
setGlobalRole($a_role_id)
set default global role
setImportId($a_id)
set import id Object of category, that store new remote courses
$query
foreach($_POST as $key=> $value) $res

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilECSSetting::save ( )

save settings

@access public

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

754 {
755 global $ilDB;
756
757 $this->server_id = $ilDB->nextId('ecs_server');
758 $ilDB->manipulate(
759 $q = 'INSERT INTO ecs_server (server_id,active,title,protocol,server,port,auth_type,client_cert_path,ca_cert_path,' .
760 'key_path,key_password,cert_serial,polling_time,import_id,global_role,econtent_rcp,user_rcp,approval_rcp,duration,auth_user,auth_pass) ' .
761 'VALUES (' .
762 $ilDB->quote($this->getServerId(), 'integer') . ', ' .
763 $ilDB->quote((int) $this->isEnabled(), 'integer') . ', ' .
764 $ilDB->quote($this->getTitle(), 'text') . ', ' .
765 $ilDB->quote((int) $this->getProtocol(), 'integer') . ', ' .
766 $ilDB->quote($this->getServer(), 'text') . ', ' .
767 $ilDB->quote($this->getPort(), 'integer') . ', ' .
768 $ilDB->quote($this->getAuthType(), 'integer') . ', ' .
769 $ilDB->quote($this->getClientCertPath(), 'text') . ', ' .
770 $ilDB->quote($this->getCACertPath(), 'text') . ', ' .
771 $ilDB->quote($this->getKeyPath(), 'text') . ', ' .
772 $ilDB->quote($this->getKeyPassword(), 'text') . ', ' .
773 $ilDB->quote($this->getCertSerialNumber(), 'text') . ', ' .
774 $ilDB->quote($this->getPollingTime(), 'integer') . ', ' .
775 $ilDB->quote($this->getImportId(), 'integer') . ', ' .
776 $ilDB->quote($this->getGlobalRole(), 'integer') . ', ' .
777 $ilDB->quote($this->getEContentRecipientsAsString(), 'text') . ', ' .
778 $ilDB->quote($this->getUserRecipientsAsString(), 'text') . ', ' .
779 $ilDB->quote($this->getApprovalRecipientsAsString(), 'text') . ', ' .
780 $ilDB->quote($this->getDuration(), 'integer') . ', ' .
781 $ilDB->quote($this->getAuthUser(), 'text') . ', ' .
782 $ilDB->quote($this->getAuthPass(), 'text') . ' ' .
783 ')'
784 );
785 }

References $ilDB.

◆ setApprovalRecipients()

ilECSSetting::setApprovalRecipients (   $a_rcp)

set approval recipients

@access public

Parameters
stringrecipients

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

675 {
676 $this->approval_recipients = $a_rcp;
677 }

◆ setAuthPass()

ilECSSetting::setAuthPass (   $a_pass)

Set Apache auth password.

Parameters
string$a_pass

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

184 {
185 $this->auth_pass = $a_pass;
186 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setAuthType()

ilECSSetting::setAuthType (   $a_auth_type)

Set auth type.

Parameters
int$a_auth_type

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

148 {
149 $this->auth_type = $a_auth_type;
150 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setAuthUser()

ilECSSetting::setAuthUser (   $a_user)

Set apache auth user.

Parameters
string$a_user

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

166 {
167 $this->auth_user = $a_user;
168 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setCACertPath()

ilECSSetting::setCACertPath (   $a_ca)

set ca cert path

@access public

Parameters
stringca cert path

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

425 {
426 $this->ca_cert_path = $a_ca;
427 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setCertSerialNumber()

ilECSSetting::setCertSerialNumber (   $a_cert_serial)

set cert serial number

@access public

Parameters

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

516 {
517 $this->cert_serial_number = $a_cert_serial;
518 }

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

+ Here is the caller graph for this function:

◆ setClientCertPath()

ilECSSetting::setClientCertPath (   $a_path)

set

@access public

Parameters

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

403 {
404 $this->client_cert_path = $a_path;
405 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setDuration()

ilECSSetting::setDuration (   $a_duration)

set Duration

@access public

Parameters
intduration

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

562 {
563 $this->duration = $a_duration;
564 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setEContentRecipients()

ilECSSetting::setEContentRecipients (   $a_logins)

set EContent recipients

@access public

Parameters
arrayof user obj_ids

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

641 {
642 $this->econtent_recipients = $a_logins;
643 }

◆ setEnabledStatus()

ilECSSetting::setEnabledStatus (   $a_status)

en/disable ecs functionality

@access public

Parameters
boolstatus

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

214 {
215 $this->active = $a_status;
216 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setGlobalRole()

ilECSSetting::setGlobalRole (   $a_role_id)

set default global role

@access public

Parameters
introle_id

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

550 {
551 $this->global_role = $a_role_id;
552 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setImportId()

ilECSSetting::setImportId (   $a_id)

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

@access public

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

494 {
495 $this->import_id = $a_id;
496 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setKeyPassword()

ilECSSetting::setKeyPassword (   $a_pass)

set key password

@access public

Parameters
stringkey password

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

482 {
483 $this->key_password = $a_pass;
484 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setKeyPath()

ilECSSetting::setKeyPath (   $a_path)

set key path

@access public

Parameters
stringkey path

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

459 {
460 $this->key_path = $a_path;
461 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setPollingTime()

ilECSSetting::setPollingTime (   $a_time)

set polling time

@access public

Parameters
intpolling time

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

345 {
346 $this->polling = $a_time;
347 }

Referenced by read(), and setPollingTimeMS().

+ Here is the caller graph for this function:

◆ setPollingTimeMS()

ilECSSetting::setPollingTimeMS (   $a_min,
  $a_sec 
)

Set polling time.

@access public

Parameters
intminutes
intseconds

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

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

References setPollingTime().

+ Here is the call graph for this function:

◆ setPort()

ilECSSetting::setPort (   $a_port)

set port

@access public

Parameters
intport

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

321 {
322 $this->port = $a_port;
323 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setProtocol()

ilECSSetting::setProtocol (   $a_prot)

set protocol

@access public

Parameters

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

298 {
299 $this->protocol = $a_prot;
300 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setServer()

ilECSSetting::setServer (   $a_server)

set server

@access public

Parameters

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

237 {
238 $this->server = $a_server;
239 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setTitle()

ilECSSetting::setTitle (   $a_title)

Set title.

Parameters
string$a_title

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

130 {
131 $this->title = $a_title;
132 }

Referenced by __clone(), and read().

+ Here is the caller graph for this function:

◆ setUserRecipients()

ilECSSetting::setUserRecipients (   $a_logins)

set user recipients

@access public

Parameters
arrayof recipients (array of user login names)

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

607 {
608 $this->user_recipients = $a_logins;
609 }

◆ update()

ilECSSetting::update ( )

Update setting.

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

791 {
792 global $ilDB;
793
794 $ilDB->manipulate(
795 'UPDATE ecs_server SET ' .
796 'server_id = ' . $ilDB->quote($this->getServerId(), 'integer') . ', ' .
797 'active = ' . $ilDB->quote((int) $this->isEnabled(), 'integer') . ', ' .
798 'title = ' . $ilDB->quote($this->getTitle(), 'text') . ', ' .
799 'protocol = ' . $ilDB->quote((int) $this->getProtocol(), 'integer') . ', ' .
800 'server = ' . $ilDB->quote($this->getServer(), 'text') . ', ' .
801 'port = ' . $ilDB->quote($this->getPort(), 'integer') . ', ' .
802 'auth_type = ' . $ilDB->quote($this->getAuthType(), 'integer') . ', ' .
803 'client_cert_path = ' . $ilDB->quote($this->getClientCertPath(), 'text') . ', ' .
804 'ca_cert_path = ' . $ilDB->quote($this->getCACertPath(), 'text') . ', ' .
805 'key_path = ' . $ilDB->quote($this->getKeyPath(), 'text') . ', ' .
806 'key_password = ' . $ilDB->quote($this->getKeyPassword(), 'text') . ', ' .
807 'cert_serial = ' . $ilDB->quote($this->getCertSerialNumber(), 'text') . ', ' .
808 'polling_time = ' . $ilDB->quote($this->getPollingTime(), 'integer') . ', ' .
809 'import_id = ' . $ilDB->quote($this->getImportId(), 'integer') . ', ' .
810 'global_role = ' . $ilDB->quote($this->getGlobalRole(), 'integer') . ', ' .
811 'econtent_rcp = ' . $ilDB->quote($this->getEContentRecipientsAsString(), 'text') . ', ' .
812 'user_rcp = ' . $ilDB->quote($this->getUserRecipientsAsString(), 'text') . ', ' .
813 'approval_rcp = ' . $ilDB->quote($this->getApprovalRecipientsAsString(), 'text') . ', ' .
814 'duration = ' . $ilDB->quote($this->getDuration(), 'integer') . ', ' .
815 'auth_user = ' . $ilDB->quote($this->getAuthUser(), 'text') . ', ' .
816 'auth_pass = ' . $ilDB->quote($this->getAuthPass(), 'text') . ', ' .
817 'auth_type = ' . $ilDB->quote($this->getAuthType(), 'integer') . ' ' .
818 'WHERE server_id = ' . $ilDB->quote($this->getServerId(), 'integer')
819 );
820 }

References $ilDB.

◆ validate()

ilECSSetting::validate ( )

Validate settings.

@access public

Parameters
void
Returns
bool

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

688 {
689 if (!$this->isEnabled()) {
690 return '';
691 }
692
693 // Cert based authentication
694 if ($this->getAuthType() == self::AUTH_CERTIFICATE) {
695 if (!$this->getClientCertPath() or !$this->getCACertPath() or !$this->getKeyPath() or !$this->getKeyPassword()) {
697 }
698 // Check import id
699 if (!$this->fetchSerialID()) {
701 }
702 if (!$this->fetchCertificateExpiration()) {
704 }
705 }
706 // Apache auth
707 if ($this->getAuthType() == self::AUTH_APACHE) {
708 if (!$this->getAuthUser() or !$this->getAuthPass()) {
710 }
711 }
712
713 // required fields
714 if (!$this->getServer() or !$this->getPort() or !$this->getPollingTime() or !$this->getImportId()
715 or !$this->getGlobalRole() or !$this->getDuration()) {
717 }
718
719 if (!$this->checkImportId()) {
721 }
722 return '';
723 }
const AUTH_APACHE
checkImportId()
check import id
isEnabled()
is enabled
fetchSerialID()
Fetch serial ID from cert.
getKeyPath()
get key path
getAuthUser()
Get apache auth user.
getAuthPass()
Get auth password.
getKeyPassword()
get key password
getDuration()
get duration
getCACertPath()
get ca cert path
fetchCertificateExpiration()
Fetch validity (expired date)
getPollingTime()
get polling time
getGlobalRole()
get global role
const ERROR_INVALID_IMPORT_ID

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().

+ Here is the call graph for this function:

Field Documentation

◆ $active

ilECSSetting::$active = false
private

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

Referenced by isEnabled().

◆ $approval_recipients

ilECSSetting::$approval_recipients = array()
private

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

◆ $auth_pass

ilECSSetting::$auth_pass = ''
private

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

Referenced by getAuthPass().

◆ $auth_type

ilECSSetting::$auth_type = self::AUTH_CERTIFICATE
private

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

Referenced by getAuthType().

◆ $auth_user

ilECSSetting::$auth_user = ''
private

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

Referenced by getAuthUser().

◆ $ca_cert_path

ilECSSetting::$ca_cert_path
private

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

Referenced by getCACertPath().

◆ $cert_serial

ilECSSetting::$cert_serial
private

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

◆ $client_cert_path

ilECSSetting::$client_cert_path
private

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

Referenced by getClientCertPath().

◆ $duration

ilECSSetting::$duration
private

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

◆ $econtent_recipients

ilECSSetting::$econtent_recipients = array()
private

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

◆ $global_role

ilECSSetting::$global_role
private

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

Referenced by getGlobalRole().

◆ $import_id

ilECSSetting::$import_id
private

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

Referenced by getImportId().

◆ $instances

ilECSSetting::$instances = null
staticprotected

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

◆ $key_password

ilECSSetting::$key_password
private

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

Referenced by getKeyPassword().

◆ $key_path

ilECSSetting::$key_path
private

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

Referenced by getKeyPath().

◆ $polling

ilECSSetting::$polling
private

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

Referenced by getPollingTime().

◆ $port

ilECSSetting::$port
private

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

Referenced by getPort().

◆ $protocol

ilECSSetting::$protocol
private

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

Referenced by getProtocol().

◆ $server

ilECSSetting::$server
private

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

Referenced by getServer().

◆ $server_id

ilECSSetting::$server_id = 0
private

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

Referenced by getServerId().

◆ $title

ilECSSetting::$title = ''
private

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

Referenced by getTitle().

◆ $user_recipients

ilECSSetting::$user_recipients = array()
private

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

◆ AUTH_APACHE

const ilECSSetting::AUTH_APACHE = 2

◆ AUTH_CERTIFICATE

const ilECSSetting::AUTH_CERTIFICATE = 1

◆ DEFAULT_AUTH_MODE

const ilECSSetting::DEFAULT_AUTH_MODE = 'ldap'

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

Referenced by lookupAuthMode().

◆ DEFAULT_DURATION

const ilECSSetting::DEFAULT_DURATION = 6

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

Referenced by getDuration().

◆ ERROR_CERT_EXPIRED

const ilECSSetting::ERROR_CERT_EXPIRED = 'ecs_certificate_expired'

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

Referenced by validate().

◆ ERROR_EXTRACT_SERIAL

const ilECSSetting::ERROR_EXTRACT_SERIAL = 'ecs_error_extract_serial'

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

Referenced by validate().

◆ ERROR_INVALID_IMPORT_ID

const ilECSSetting::ERROR_INVALID_IMPORT_ID = 'ecs_check_import_id'

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

Referenced by validate().

◆ ERROR_REQUIRED

const ilECSSetting::ERROR_REQUIRED = 'fill_out_all_required_fields'

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

Referenced by validate().

◆ PROTOCOL_HTTP

const ilECSSetting::PROTOCOL_HTTP = 0

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

Referenced by getServerURI().

◆ PROTOCOL_HTTPS

const ilECSSetting::PROTOCOL_HTTPS = 1

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

Referenced by getServerURI(), and ilECSSettingsGUI\initSettingsForm().


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