4 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php';
5 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnectorException.php';
6 include_once
'./Services/WebServices/ECS/classes/Connectors/class.ilECSEnrolmentStatus.php';
35 $this->path_postfix =
'/campusconnect/member_status/'. (int) $a_enrole_id;
37 if($a_details
and $a_enrole_id)
39 $this->path_postfix .=
'/details';
48 $this->
addHeader(
'Accept',
'application/json');
52 #$this->addHeader('Accept', 'text/uri-list'); 54 $this->curl->setOpt(CURLOPT_HTTPHEADER, $this->
getHeader());
57 if(substr(
$res, 0, 4) ==
'http')
59 $json = file_get_contents(
$res);
70 include_once
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php';
73 $details->loadFromJson($ecs_result->getResult());
78 include_once
'./Services/WebServices/ECS/classes/Connectors/class.ilECSEnrolmentStatus.php';
80 $enrolment->loadFromJson($ecs_result->getResult());
98 $ilLog->write(__METHOD__.
': Add new enrolment status');
100 $this->path_postfix =
'/campusconnect/member_status';
106 $this->
addHeader(
'Content-Type',
'application/json');
107 $this->
addHeader(
'Accept',
'application/json');
109 #$this->addHeader(ilECSConnector::HEADER_MEMBERSHIPS, 1); 111 $this->curl->setOpt(CURLOPT_HTTPHEADER, $this->
getHeader());
112 $this->curl->setOpt(CURLOPT_POST,
true);
113 $this->curl->setOpt(CURLOPT_POSTFIELDS,json_encode($enrolment));
116 $info = $this->curl->getInfo(CURLINFO_HTTP_CODE);
118 $ilLog->write(__METHOD__.
': Checking HTTP status...');
119 if(
$info != self::HTTP_CODE_CREATED)
121 $ilLog->write(__METHOD__.
': Cannot create auth resource, did not receive HTTP 201. ');
122 $ilLog->write(__METHOD__.
': POST was: '.print_r($enrolment,TRUE));
123 $ilLog->write(__METHOD__.
': HTTP code: '.
$info);
126 $ilLog->write(__METHOD__.
': ... got HTTP 201 (created)');
129 $enrolment_res =
$result->getResult();
131 $ilLog->write(__METHOD__.
': ... Received result: '.print_r($enrolment_res,TRUE));
133 return $enrolment_res;
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
__construct(ilECSSetting $settings=null)
Constructor.
Presentation of ecs content details (http://...campusconnect/courselinks/id/details) ...
setHeader($a_header_strings)
Create styles array
The data for the language used.
Connector for course member ressource.
addHeader($a_name, $a_value)
Add Header.
prepareConnection()
prepare connection
getEnrolmentStatus($a_enrole_id=0, $a_details=false)
Get single directory tree.
addEnrolmentStatus(ilECSEnrolmentStatus $enrolment, $a_target_mid)
Add new enrolment status.