33 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
49 $this->sauth->disableSOAPCheck();
52 function sendMail($sid,$to,$cc,$bcc,$sender,$subject,$message,$attach)
56 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
60 include_once
'./include/inc.header.php';
64 include_once
'Services/Mail/classes/class.ilMimeMail.php';
67 $mmail->autoCheck(
false);
68 $mmail->From($sender);
69 $mmail->To(explode(
',',$to));
70 $mmail->Subject($subject);
71 $mmail->Body($message);
75 $mmail->Cc(explode(
',',$cc));
80 $mmail->Bcc(explode(
',',$bcc));
87 if(strpos($attach,
'#:#') === 0)
89 $attach = substr($attach, strlen(
'#:#'));
90 $attachments = explode(
'#:#', $attach);
94 $attachments = explode(
',', $attach);
96 foreach ($attachments as $attachment)
98 $mmail->Attach($attachment);
103 $ilLog->write(
'SOAP: sendMail(): '.$to.
', '.$cc.
', '.$bcc);
112 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
116 include_once
'./include/inc.header.php';
117 include_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
125 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
129 include_once
'./include/inc.header.php';
130 include_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
145 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
149 include_once
'./include/inc.header.php';
153 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
157 if(!$cp_options->checkOwner($ilUser->getId()))
159 $ilLog->write(__METHOD__.
': Permission check failed for user id: '.$ilUser->getId().
', copy id: '.$copy_identifier);
164 if(($node = $cp_options->fetchFirstDependenciesNode()) ===
false)
166 $cp_options->deleteAll();
167 $ilLog->write(__METHOD__.
': Finished copy step 2. Copy completed');
173 $options = $cp_options->getOptions($node[
'child']);
175 switch($options[
'type'])
178 $ilLog->write(__METHOD__.
': Omitting node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
183 $ilLog->write(__METHOD__.
': Nothing to do for node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
188 $ilLog->write(__METHOD__.
': Start cloning dependencies: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
194 $ilLog->write(__METHOD__.
': No valid action type given for node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
209 public function ilClone($sid,$copy_identifier)
213 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
217 include_once
'./include/inc.header.php';
221 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
225 if(!$cp_options->checkOwner($ilUser->getId()))
227 $ilLog->write(__METHOD__.
': Permission check failed for user id: '.$ilUser->getId().
', copy id: '.$copy_identifier);
233 if(($node = $cp_options->fetchFirstNode()) ===
false)
235 $ilLog->write(__METHOD__.
': Finished copy step 1. Starting copying of object dependencies...');
240 $options = $cp_options->getOptions($node[
'child']);
243 switch($options[
'type'])
246 $ilLog->write(__METHOD__.
': Omitting node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
248 $cp_options->appendMapping($node[
'child'],0);
253 $ilLog->write(__METHOD__.
': Start cloning node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
254 $new_ref_id = $this->
cloneNode($node,$cp_options);
259 $ilLog->write(__METHOD__.
': Start linking node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
260 $new_ref_id = $this->
linkNode($node,$cp_options);
265 $ilLog->write(__METHOD__.
': No valid action type given for node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
283 $cp_options->dropFirstNode();
285 if($cp_options->isSOAPEnabled())
288 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
290 $soap_client->setTimeout(1);
291 $soap_client->setResponseTimeout(1);
292 $soap_client->enableWSDL(
true);
293 $soap_client->init();
294 $soap_client->call(
'ilClone',array($sid,$cp_options->getCopyId()));
298 $ilLog->write(__METHOD__.
': Cannot call SOAP server');
300 include_once(
'./webservice/soap/include/inc.soap_functions.php');
310 $cp_options->dropFirstDependenciesNode();
312 if($cp_options->isSOAPEnabled())
315 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
317 $soap_client->setTimeout(1);
318 $soap_client->setResponseTimeout(1);
319 $soap_client->enableWSDL(
true);
320 $soap_client->init();
321 $soap_client->call(
'ilCloneDependencies',array($sid,$cp_options->getCopyId()));
325 $ilLog->write(__METHOD__.
': Cannot call SOAP server');
327 include_once(
'./webservice/soap/include/inc.soap_functions.php');
342 global
$ilLog,$tree,$ilAccess;
346 $source_id = $node[
'child'];
347 $parent_id = $node[
'parent'];
348 $options = $cp_options->getOptions($node[
'child']);
349 $mappings = $cp_options->getMappings();
351 if(!$ilAccess->checkAccess(
'copy',
'',$node[
'child']))
353 $ilLog->write(__METHOD__.
': No copy permission granted: '.$source_id.
', '.$node[
'title'].
', '.$node[
'type']);
357 if(!isset($mappings[$parent_id]))
359 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
366 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. Object has been deleted.');
371 $new_obj = $orig->cloneObject((
int)
$target_id,$cp_options->getCopyId());
373 if(!is_object($new_obj))
375 $ilLog->write(__METHOD__.
': Error copying '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
380 $cp_options->appendMapping($source_id,$new_obj->getRefId());
381 return $new_obj->getRefId();
395 $source_id = $node[
'child'];
396 $mappings = $cp_options->getMappings();
398 if(!isset($mappings[$source_id]))
400 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No mapping found.');
406 $orig->cloneDependencies(
$target_id,$cp_options->getCopyId());
421 $source_id = $node[
'child'];
422 $parent_id = $node[
'parent'];
423 $options = $cp_options->getOptions($node[
'child']);
424 $mappings = $cp_options->getMappings();
426 if(!$ilAccess->checkAccess(
'write',
'',$node[
'child']))
428 $ilLog->write(__METHOD__.
': No write permission granted: '.$source_id.
', '.$node[
'title'].
', '.$node[
'type']);
432 if(!isset($mappings[$parent_id]))
434 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
440 $new_ref_id = $orig->createReference();
443 $orig->setRefId($new_ref_id);
444 $orig->initDefaultRoles();
449 $ilLog->write(__METHOD__.
': Error linking '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
454 $cp_options->appendMapping($source_id,$new_ref_id);
470 if (is_array($error))
472 foreach ($error as $err) {
473 $msg []=
"(".$err[
"line"].
",".$err[
"col"].
"): ".$err[
"errormessage"];
480 $msg = join(
"\n",$msg);
490 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
494 include_once
'./include/inc.header.php';
495 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
500 $ilLog->write(__METHOD__.
': Starting task execution...');
501 $scheduler->startTaskExecution();