ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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) @global ilLog $ilLog. 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 1003 of file class.ilECSSetting.php.

1004 {
1005 $this->server_id = 0;
1006 $this->setTitle($this->getTitle(). ' (Copy)');
1007 $this->setEnabledStatus(false);
1008 $this->setServer('');
1009 $this->setProtocol(self::PROTOCOL_HTTPS);
1010 $this->setPort(0);
1011 $this->setClientCertPath('');
1012 $this->setKeyPath('');
1013 $this->setKeyPassword('');
1014 $this->setCACertPath('');
1015 $this->setCertSerialNumber('');
1016 $this->setAuthType(self::AUTH_CERTIFICATE);
1017 $this->setAuthUser('');
1018 $this->setAuthPass('');
1019 }
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['ilLog']->write(__METHOD__.': Using deprecated call.');
100 $GLOBALS['ilLog']->logStack();
102 }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $GLOBALS, and getInstanceByServerId().

+ Here is the call graph for this function:

◆ checkImportId()

ilECSSetting::checkImportId ( )

check import id

@access public

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

748 {
749 global $ilObjDataCache,$tree;
750
751 if(!$this->getImportId())
752 {
753 return false;
754 }
755 if($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getImportId())) != 'cat')
756 {
757 return false;
758 }
759 if($tree->isDeleted($this->getImportId()))
760 {
761 return false;
762 }
763 return true;
764 }
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 842 of file class.ilECSSetting.php.

843 {
844 global $ilDB;
845
846 // --- cascading delete
847
848 include_once 'Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
850
851 include_once 'Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
853
854 include_once 'Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
856
857 include_once 'Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
859
860 include_once 'Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
862
863 include_once 'Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
865
866 include_once 'Services/WebServices/ECS/classes/class.ilECSExport.php';
868
869 // resetting server id to flag items in imported list
870 include_once 'Services/WebServices/ECS/classes/class.ilECSImport.php';
872
873 $ilDB->manipulate(
874 'DELETE FROM ecs_server '.
875 'WHERE server_id = '.$ilDB->quote($this->getServerId(),'integer')
876 );
877
878 $this->server_id = NULL;
879 return true;
880 }
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) @global ilLog $ilLog.

Returns
bool

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

889 {
890 global $ilLog;
891
892 if($this->getAuthType() != self::AUTH_CERTIFICATE)
893 {
894 return null;
895 }
896
897 if(function_exists('openssl_x509_parse') and $cert = openssl_x509_parse('file://'.$this->getClientCertPath()))
898 {
899 if(isset($cert['validTo_time_t']) and $cert['validTo_time_t'])
900 {
901 $dt = new ilDateTime($cert['validTo_time_t'], IL_CAL_UNIX);
902 $ilLog->write(__METHOD__.': Certificate expires at '.ilDatePresentation::formatDate($dt));
903 return $dt;
904 }
905 }
906 return null;
907 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
getAuthType()
Get auth type.
getClientCertPath()
get certificate path

References $ilLog, 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 915 of file class.ilECSSetting.php.

916 {
917 global $ilLog;
918
919 if(function_exists('openssl_x509_parse') and $cert = openssl_x509_parse('file://'.$this->getClientCertPath()))
920 {
921 if(isset($cert['serialNumber']) and $cert['serialNumber'])
922 {
923 $this->setCertSerialNumber($cert['serialNumber']);
924 $ilLog->write(__METHOD__.': Serial number is '.$cert['serialNumber']);
925 return true;
926 }
927 }
928
929 if(!file_exists($this->getClientCertPath()) or !is_readable($this->getClientCertPath()))
930 {
931 return false;
932 }
933 $lines = file($this->getClientCertPath());
934 $found = false;
935 foreach($lines as $line)
936 {
937 if(strpos($line,'Serial Number:') !== false)
938 {
939 $found = true;
940 $serial_line = explode(':',$line);
941 $serial = (int) trim($serial_line[1]);
942 break;
943
944 }
945 }
946 if($found)
947 {
948 $this->setCertSerialNumber($serial);
949 return true;
950 }
951 else
952 {
953 return false;
954 }
955 }

References $ilLog, 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 658 of file class.ilECSSetting.php.

659 {
660 return explode(',',$this->approval_recipients);
661 }

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 670 of file class.ilECSSetting.php.

671 {
672 return $this->approval_recipients ? $this->approval_recipients : '';
673 }

Referenced by ilECSObjectSettings\sendNewContentNotification().

+ Here is the caller graph for this function:

◆ getAuthPass()

ilECSSetting::getAuthPass ( )

Get auth password.

Returns
string

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

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

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 157 of file class.ilECSSetting.php.

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

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 175 of file class.ilECSSetting.php.

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

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 442 of file class.ilECSSetting.php.

443 {
444 return $this->ca_cert_path;
445 }

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 533 of file class.ilECSSetting.php.

534 {
535 return $this->cert_serial_number;
536 }

◆ getClientCertPath()

ilECSSetting::getClientCertPath ( )

get certificate path

@access public

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

420 {
422 }

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 579 of file class.ilECSSetting.php.

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

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 624 of file class.ilECSSetting.php.

625 {
626 return explode(',',$this->econtent_recipients);
627 }

◆ getEContentRecipientsAsString()

ilECSSetting::getEContentRecipientsAsString ( )

get EContent recipients as string

@access public

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

636 {
637 return $this->econtent_recipients ? $this->econtent_recipients : '';
638 }

◆ getGlobalRole()

ilECSSetting::getGlobalRole ( )

get global role

@access public

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

545 {
546 return $this->global_role;
547 }

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 510 of file class.ilECSSetting.php.

511 {
512 return $this->import_id;
513 }

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 476 of file class.ilECSSetting.php.

477 {
478 return $this->key_password;
479 }

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 453 of file class.ilECSSetting.php.

454 {
455 return $this->key_path;
456 }

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 362 of file class.ilECSSetting.php.

363 {
364 return $this->polling;
365 }

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 384 of file class.ilECSSetting.php.

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

◆ getPollingTimeSeconds()

ilECSSetting::getPollingTimeSeconds ( )

get polling time seconds (<60)

@access public

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

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

◆ getPort()

ilECSSetting::getPort ( )

get port

@access public

Parameters

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

340 {
341 return $this->port;
342 }

References $port.

Referenced by validate().

+ Here is the caller graph for this function:

◆ getProtocol()

ilECSSetting::getProtocol ( )

get protocol

@access public

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

316 {
317 return $this->protocol;
318 }

References $protocol.

Referenced by getServerURI().

+ Here is the caller graph for this function:

◆ getServer()

ilECSSetting::getServer ( )

get server

@access public

Parameters

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

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

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 260 of file class.ilECSSetting.php.

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

References 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 139 of file class.ilECSSetting.php.

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

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 590 of file class.ilECSSetting.php.

591 {
592 return explode(',',(string) $this->user_recipients);
593 }

◆ getUserRecipientsAsString()

ilECSSetting::getUserRecipientsAsString ( )

Get new user recipients.

@access public

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

602 {
603 return $this->user_recipients ? $this->user_recipients : '';
604 }

◆ isEnabled()

ilECSSetting::isEnabled ( )

is enabled

@access public

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

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

References $active.

Referenced by validate().

+ Here is the caller graph for this function:

◆ lookupAuthMode()

static ilECSSetting::lookupAuthMode ( )
static

Lookup auth mode.

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

122 {
124 }

References DEFAULT_AUTH_MODE.

Referenced by ilECSAppEventListener\handleMembership(), and ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus().

+ Here is the caller graph for this function:

◆ read()

ilECSSetting::read ( )
private

Read settings.

@access private

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

963 {
964 global $ilDB;
965
966 if(!$this->getServerId())
967 {
968 return false;
969 }
970
971 $query = 'SELECT * FROM ecs_server '.
972 'WHERE server_id = '.$ilDB->quote($this->getServerId(),'integer');
973 $res = $ilDB->query($query);
974 while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
975 {
976 $this->setServer($row['server']);
977 $this->setTitle($row['title']);
978 $this->setProtocol($row['protocol']);
979 $this->setPort($row['port']);
980 $this->setClientCertPath($row['client_cert_path']);
981 $this->setCACertPath($row['ca_cert_path']);
982 $this->setKeyPath($row['key_path']);
983 $this->setKeyPassword($row['key_password']);
984 $this->setPollingTime($row['polling_time']);
985 $this->setImportId($row['import_id']);
986 $this->setEnabledStatus((int) $row['active']);
987 $this->setCertSerialNumber($row['cert_serial']);
988 $this->setGlobalRole($row['global_role']);
989 $this->econtent_recipients = $row['econtent_rcp'];
990 $this->approval_recipients = $row['approval_rcp'];
991 $this->user_recipients = $row['user_rcp'];
992 $this->setDuration($row['duration']);
993 $this->setAuthUser($row['auth_user']);
994 $this->setAuthPass($row['auth_pass']);
995 $this->setAuthType($row['auth_type']);
996 }
997 }
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
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

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

+ 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 772 of file class.ilECSSetting.php.

773 {
774 global $ilDB;
775
776 $this->server_id = $ilDB->nextId('ecs_server');
777 $ilDB->manipulate($q = 'INSERT INTO ecs_server (server_id,active,title,protocol,server,port,auth_type,client_cert_path,ca_cert_path,'.
778 'key_path,key_password,cert_serial,polling_time,import_id,global_role,econtent_rcp,user_rcp,approval_rcp,duration,auth_user,auth_pass) '.
779 'VALUES ('.
780 $ilDB->quote($this->getServerId(),'integer').', '.
781 $ilDB->quote((int) $this->isEnabled(),'integer').', '.
782 $ilDB->quote($this->getTitle(),'text').', '.
783 $ilDB->quote((int) $this->getProtocol(),'integer').', '.
784 $ilDB->quote($this->getServer(),'text').', '.
785 $ilDB->quote($this->getPort(),'integer').', '.
786 $ilDB->quote($this->getAuthType(),'integer').', '.
787 $ilDB->quote($this->getClientCertPath(),'text').', '.
788 $ilDB->quote($this->getCACertPath(),'text').', '.
789 $ilDB->quote($this->getKeyPath(),'text').', '.
790 $ilDB->quote($this->getKeyPassword(),'text').', '.
791 $ilDB->quote($this->getCertSerialNumber(),'text').', '.
792 $ilDB->quote($this->getPollingTime(),'integer').', '.
793 $ilDB->quote($this->getImportId(),'integer').', '.
794 $ilDB->quote($this->getGlobalRole(),'integer').', '.
795 $ilDB->quote($this->getEContentRecipientsAsString(),'text').', '.
796 $ilDB->quote($this->getUserRecipientsAsString(),'text').', '.
797 $ilDB->quote($this->getApprovalRecipientsAsString(),'text').', '.
798 $ilDB->quote($this->getDuration(),'integer').', '.
799 $ilDB->quote($this->getAuthUser(),'text').', '.
800 $ilDB->quote($this->getAuthPass(),'text').' '.
801 ')'
802 );
803 }

References $ilDB.

◆ setApprovalRecipients()

ilECSSetting::setApprovalRecipients (   $a_rcp)

set approval recipients

@access public

Parameters
stringrecipients

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

682 {
683 $this->approval_recipients = $a_rcp;
684 }

◆ setAuthPass()

ilECSSetting::setAuthPass (   $a_pass)

Set Apache auth password.

Parameters
string$a_pass

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

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

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 148 of file class.ilECSSetting.php.

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

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 166 of file class.ilECSSetting.php.

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

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 431 of file class.ilECSSetting.php.

432 {
433 $this->ca_cert_path = $a_ca;
434 }

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 522 of file class.ilECSSetting.php.

523 {
524 $this->cert_serial_number = $a_cert_serial;
525 }

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 409 of file class.ilECSSetting.php.

410 {
411 $this->client_cert_path = $a_path;
412 }

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 568 of file class.ilECSSetting.php.

569 {
570 $this->duration = $a_duration;
571 }

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 647 of file class.ilECSSetting.php.

648 {
649 $this->econtent_recipients = $a_logins;
650 }

◆ setEnabledStatus()

ilECSSetting::setEnabledStatus (   $a_status)

en/disable ecs functionality

@access public

Parameters
boolstatus

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

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

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 556 of file class.ilECSSetting.php.

557 {
558 $this->global_role = $a_role_id;
559 }

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 500 of file class.ilECSSetting.php.

501 {
502 $this->import_id = $a_id;
503 }

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 488 of file class.ilECSSetting.php.

489 {
490 $this->key_password = $a_pass;
491 }

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 465 of file class.ilECSSetting.php.

466 {
467 $this->key_path = $a_path;
468 }

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 351 of file class.ilECSSetting.php.

352 {
353 $this->polling = $a_time;
354 }

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 397 of file class.ilECSSetting.php.

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

References setPollingTime().

+ Here is the call graph for this function:

◆ setPort()

ilECSSetting::setPort (   $a_port)

set port

@access public

Parameters
intport

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

328 {
329 $this->port = $a_port;
330 }

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 304 of file class.ilECSSetting.php.

305 {
306 $this->protocol = $a_prot;
307 }

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 237 of file class.ilECSSetting.php.

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

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 130 of file class.ilECSSetting.php.

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

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 613 of file class.ilECSSetting.php.

614 {
615 $this->user_recipients = $a_logins;
616 }

◆ update()

ilECSSetting::update ( )

Update setting.

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

809 {
810 global $ilDB;
811
812 $ilDB->manipulate('UPDATE ecs_server SET '.
813 'server_id = '.$ilDB->quote($this->getServerId(),'integer').', '.
814 'active = '.$ilDB->quote((int) $this->isEnabled(),'integer').', '.
815 'title = '.$ilDB->quote($this->getTitle(),'text').', '.
816 'protocol = '.$ilDB->quote((int) $this->getProtocol(),'integer').', '.
817 'server = '.$ilDB->quote($this->getServer(),'text').', '.
818 'port = '.$ilDB->quote($this->getPort(),'integer').', '.
819 'auth_type = '.$ilDB->quote($this->getAuthType(),'integer').', '.
820 'client_cert_path = '.$ilDB->quote($this->getClientCertPath(),'text').', '.
821 'ca_cert_path = '.$ilDB->quote($this->getCACertPath(),'text').', '.
822 'key_path = '.$ilDB->quote($this->getKeyPath(),'text').', '.
823 'key_password = '.$ilDB->quote($this->getKeyPassword(),'text').', '.
824 'cert_serial = '.$ilDB->quote($this->getCertSerialNumber(),'text').', '.
825 'polling_time = '.$ilDB->quote($this->getPollingTime(),'integer').', '.
826 'import_id = '.$ilDB->quote($this->getImportId(),'integer').', '.
827 'global_role = '.$ilDB->quote($this->getGlobalRole(),'integer').', '.
828 'econtent_rcp = '.$ilDB->quote($this->getEContentRecipientsAsString(),'text').', '.
829 'user_rcp = '.$ilDB->quote($this->getUserRecipientsAsString(),'text').', '.
830 'approval_rcp = '.$ilDB->quote($this->getApprovalRecipientsAsString(),'text').', '.
831 'duration = '.$ilDB->quote($this->getDuration(),'integer').', '.
832 'auth_user = '.$ilDB->quote($this->getAuthUser(),'text').', '.
833 'auth_pass = '.$ilDB->quote($this->getAuthPass(),'text').', '.
834 'auth_type = '.$ilDB->quote($this->getAuthType(),'integer').' '.
835 'WHERE server_id = '.$ilDB->quote($this->getServerId(),'integer')
836 );
837 }

References $ilDB.

◆ validate()

ilECSSetting::validate ( )

Validate settings.

@access public

Parameters
void
Returns
bool

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

695 {
696 if(!$this->isEnabled())
697 {
698 return '';
699 }
700
701 // Cert based authentication
702 if($this->getAuthType() == self::AUTH_CERTIFICATE)
703 {
704 if(!$this->getClientCertPath() or !$this->getCACertPath() or !$this->getKeyPath() or !$this->getKeyPassword())
705 {
707 }
708 // Check import id
709 if(!$this->fetchSerialID())
710 {
712 }
713 if(!$this->fetchCertificateExpiration())
714 {
716 }
717 }
718 // Apache auth
719 if($this->getAuthType() == self::AUTH_APACHE)
720 {
721 if(!$this->getAuthUser() or !$this->getAuthPass())
722 {
724 }
725 }
726
727 // required fields
728 if(!$this->getServer() or !$this->getPort() or !$this->getPollingTime() or !$this->getImportId()
729 or !$this->getGlobalRole() or !$this->getDuration())
730 {
732 }
733
734 if(!$this->checkImportId())
735 {
737 }
738 return '';
739 }
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) @global ilLog $ilLog.
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: