63 include_once(
'./Services/WebServices/ECS/classes/class.ilECSSettings.php');
103 $this->log->write(__METHOD__.
': Caught exception: '.$exc->getMessage());
119 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php');
121 $this->event_reader->refresh();
141 if(!$event = $this->event_reader->shift())
143 $this->log->write(__METHOD__.
': No more pending events found.');
164 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentReader.php');
169 $this->log->write(__METHOD__.
': Cannot read Econtent. '.$e->getMessage());
175 $this->log->write(__METHOD__.
': Deleting deprecated remote course.');
181 $this->log->write(__METHOD__.
': Starting update of remote courses.');
191 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
192 include_once(
'./Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
193 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentReader.php');
194 include_once(
'./Services/WebServices/ECS/classes/class.ilECSReaderException.php');
195 include_once(
'./Services/WebServices/ECS/classes/class.ilECSContentWriter.php');
196 include_once(
'./Services/WebServices/ECS/classes/class.ilECSContentWriterException.php');
200 $econtent_id = $export->getEContentId();
206 foreach(
$reader->getEContent() as $econtent)
210 $ilLog->write(__METHOD__.
': Cannot create object instance. Aborting...');
214 $writer->setExportable(
false);
215 $writer->setOwnerId($econtent->getOwner());
216 $writer->setParticipantIds($econtent->getEligibleMembers());
220 $writer->setExportable(
true);
229 $ilLog->write(__METHOD__.
': Cannot handle create event. Message: '.$e1->getMessage());
234 $ilLog->write(__METHOD__.
': Cannot handle create event. Message: '.$e2->getMessage());
239 $ilLog->write(__METHOD__.
': Cannot handle create event. Message: '.$e2->getMessage());
255 include_once(
'./Services/WebServices/ECS/classes/class.ilECSImport.php');
265 foreach($obj_ids as $obj_id)
268 foreach($references as
$ref_id)
272 $this->log->write(__METHOD__.
': Deleting obsolete remote course: '.$tmp_obj->getTitle());
274 $tree->deleteTree($tree->getNodeData($ref_id));
295 include_once(
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php');
298 $ilLog->write(
'Ignoring disabled participant. MID: '.$content->getOwner());
302 include_once(
'Services/WebServices/ECS/classes/class.ilECSImport.php');
305 foreach(array_intersect($this->mids,$content->getEligibleMembers()) as $mid)
311 if($remote->getType() !=
'rcrs')
313 $this->log->write(__METHOD__.
': Cannot instantiate remote course. Got object type '.$remote->getType());
316 $remote->updateFromECSContent($content);
320 include_once(
'./Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php');
325 foreach(array_diff(
ilECSImport::_lookupMIDs($content->getEContentId()),$content->getEligibleMembers()) as $deprecated)
327 $this->
handleDelete($content->getEContentId(),$deprecated);
342 $query =
"SELECT usr_id FROM usr_data WHERE auth_mode = 'ecs' ".
343 "AND time_limit_until < ".time().
" ".
344 "AND time_limit_unlimited = 0 ".
345 "AND (time_limit_until - time_limit_from) < 7200";
346 $res = $ilDB->query($query);
351 $this->log->write(__METHOD__.
': Deleting deprecated ECS user account '.$user_obj->getLogin());
370 $this->mids = array();
372 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
374 foreach(
$reader->getCommunities() as $com)
376 foreach($com->getParticipants() as $part)
380 $this->mids[] = $part->getMID();
381 $this->log->write(
'Fetch MID: '.$part->getMID());
403 if(!$this->settings->isEnabled())
408 if(!$this->settings->checkImportId())
410 $this->log->write(__METHOD__.
': Import ID is deleted or not of type "category". Aborting');
418 $query =
"SELECT value FROM settings WHERE module = 'ecs' ".
419 "AND keyword = 'next_execution'";
420 $res = $this->db->query($query);
425 if(time() < ($time + $this->settings->getPollingTime()))
431 $query =
"REPLACE INTO settings SET ".
433 "keyword = 'next_execution', ".
434 "value = ".$this->db->quote(time() + $this->settings->getPollingTime());
435 $this->db->query($query);
437 $this->log->write(__METHOD__.
': Starting ECS tasks.');
440 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
443 $soap_client->setTimeout(1);
444 $soap_client->setResponseTimeout(1);
445 $soap_client->enableWSDL(
true);
447 $ilLog->write(__METHOD__.
': Trying to call Soap client...');
451 if($soap_client->init())
453 $ilLog->write(__METHOD__.
': Calling soap handleECSTasks method...');
454 $res = $soap_client->call(
'handleECSTasks',array($new_session_id.
'::'.
$client_id));
458 $ilLog->write(__METHOD__.
': SOAP call failed. Calling clone method manually. ');
459 include_once(
'./webservice/soap/include/inc.soap_functions.php');