33 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
49 $this->soap_check =
false;
52 function sendMail($sid,$to,$cc,$bcc,$sender,$subject,$message,$attach)
65 include_once
'Services/Mail/classes/class.ilMimeMail.php';
68 $mmail->autoCheck(
false);
69 $mmail->From($sender);
70 $mmail->To(explode(
',',$to));
71 $mmail->Subject($subject);
72 $mmail->Body($message);
76 $mmail->Cc(explode(
',',$cc));
81 $mmail->Bcc(explode(
',',$bcc));
88 if(strpos($attach,
'#:#') === 0)
90 $attach = substr($attach, strlen(
'#:#'));
91 $attachments = explode(
'#:#', $attach);
95 $attachments = explode(
',', $attach);
97 foreach ($attachments as $attachment)
99 $mmail->Attach($attachment);
104 $ilLog->write(
'SOAP: sendMail(): '.$to.
', '.$cc.
', '.$bcc);
119 include_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
133 include_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
156 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
160 if(!$cp_options->checkOwner($ilUser->getId()))
162 $ilLog->write(__METHOD__.
': Permission check failed for user id: '.$ilUser->getId().
', copy id: '.$copy_identifier);
167 if(($node = $cp_options->fetchFirstDependenciesNode()) ===
false)
169 $cp_options->deleteAll();
170 $ilLog->write(__METHOD__.
': Finished copy step 2. Copy completed');
176 $options = $cp_options->getOptions($node[
'child']);
178 switch($options[
'type'])
181 $ilLog->write(__METHOD__.
': Omitting node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
186 $ilLog->write(__METHOD__.
': Nothing to do for node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
191 $ilLog->write(__METHOD__.
': Start cloning dependencies: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
197 $ilLog->write(__METHOD__.
': No valid action type given for node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
212 public function ilClone($sid,$copy_identifier)
224 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
228 if(!$cp_options->checkOwner($ilUser->getId()))
230 $ilLog->write(__METHOD__.
': Permission check failed for user id: '.$ilUser->getId().
', copy id: '.$copy_identifier);
236 if(($node = $cp_options->fetchFirstNode()) ===
false)
238 $ilLog->write(__METHOD__.
': Finished copy step 1. Starting copying of object dependencies...');
243 $options = $cp_options->getOptions($node[
'child']);
246 switch($options[
'type'])
249 $ilLog->write(__METHOD__.
': Omitting node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
251 $cp_options->appendMapping($node[
'child'],0);
256 $ilLog->write(__METHOD__.
': Start cloning node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
257 $new_ref_id = $this->
cloneNode($node,$cp_options);
262 $ilLog->write(__METHOD__.
': Start linking node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
263 $new_ref_id = $this->
linkNode($node,$cp_options);
268 $ilLog->write(__METHOD__.
': No valid action type given for node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
286 $cp_options->dropFirstNode();
288 if($cp_options->isSOAPEnabled())
291 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
293 $soap_client->setTimeout(1);
294 $soap_client->setResponseTimeout(1);
295 $soap_client->enableWSDL(
true);
296 $soap_client->init();
297 $soap_client->call(
'ilClone',array($sid,$cp_options->getCopyId()));
301 $ilLog->write(__METHOD__.
': Cannot call SOAP server');
303 include_once(
'./webservice/soap/include/inc.soap_functions.php');
313 $cp_options->dropFirstDependenciesNode();
315 if($cp_options->isSOAPEnabled())
318 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
320 $soap_client->setTimeout(1);
321 $soap_client->setResponseTimeout(1);
322 $soap_client->enableWSDL(
true);
323 $soap_client->init();
324 $soap_client->call(
'ilCloneDependencies',array($sid,$cp_options->getCopyId()));
328 $ilLog->write(__METHOD__.
': Cannot call SOAP server');
330 include_once(
'./webservice/soap/include/inc.soap_functions.php');
345 global
$ilLog,$tree,$ilAccess,$rbacreview;
349 $source_id = $node[
'child'];
350 $parent_id = $node[
'parent'];
351 $options = $cp_options->getOptions($node[
'child']);
352 $mappings = $cp_options->getMappings();
354 if(!$ilAccess->checkAccess(
'copy',
'',$node[
'child']))
356 $ilLog->write(__METHOD__.
': No copy permission granted: '.$source_id.
', '.$node[
'title'].
', '.$node[
'type']);
360 if(!isset($mappings[$parent_id]))
362 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
369 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. Object has been deleted.');
374 $new_obj = $orig->cloneObject((
int)
$target_id,$cp_options->getCopyId());
376 if(!is_object($new_obj))
378 $ilLog->write(__METHOD__.
': Error copying '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
383 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
384 $rbac_log_roles = $rbacreview->getParentRoleIds($new_obj->getRefId(),
false);
389 $cp_options->appendMapping($source_id,$new_obj->getRefId());
390 return $new_obj->getRefId();
404 $source_id = $node[
'child'];
405 $mappings = $cp_options->getMappings();
407 if(!isset($mappings[$source_id]))
409 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No mapping found.');
415 $orig->cloneDependencies(
$target_id,$cp_options->getCopyId());
428 global
$ilLog,$ilAccess,$rbacreview;
430 $source_id = $node[
'child'];
431 $parent_id = $node[
'parent'];
432 $options = $cp_options->getOptions($node[
'child']);
433 $mappings = $cp_options->getMappings();
435 if(!$ilAccess->checkAccess(
'delete',
'',$node[
'child']))
437 $ilLog->write(__METHOD__.
': No delete permission granted: '.$source_id.
', '.$node[
'title'].
', '.$node[
'type']);
441 if(!isset($mappings[$parent_id]))
443 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
449 $new_ref_id = $orig->createReference();
455 $ilLog->write(__METHOD__.
': Error linking '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
460 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
461 $rbac_log_roles = $rbacreview->getParentRoleIds($new_ref_id,
false);
466 $cp_options->appendMapping($source_id,$new_ref_id);
484 foreach (
$error as $err) {
485 $msg []=
"(".$err[
"line"].
",".$err[
"col"].
"): ".$err[
"errormessage"];
492 $msg = join(
"\n",$msg);
508 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
513 $ilLog->write(__METHOD__.
': Starting task execution...');
514 $scheduler->startTaskExecution();
540 $ilLog->write(__METHOD__.
': Started deletion of inactive user objects with expired confirmation hash values (dual opt in) ...');
542 require_once
'Services/Registration/classes/class.ilRegistrationSettings.php';
554 $query .=
'SELECT usr_id, create_date, reg_hash FROM usr_data '
555 .
'WHERE active = 0 '
556 .
'AND reg_hash IS NOT NULL '
557 .
'AND usr_id = '.$ilDB->quote(
$usr_id,
'integer').
' ';
561 $query .=
'SELECT usr_id, create_date, reg_hash FROM usr_data '
562 .
'WHERE active = 0 '
563 .
'AND reg_hash IS NOT NULL '
564 .
'AND usr_id != '.$ilDB->quote(
$usr_id,
'integer').
' ';
568 $ilLog->write(__METHOD__.
': '.$ilDB->numRows(
$res).
' inactive user objects with confirmation hash values (dual opt in) found ...');
576 $num_deleted_users = 0;
577 while(
$row = $ilDB->fetchAssoc(
$res))
579 if(
$row[
'usr_id'] == ANONYMOUS_USER_ID ||
$row[
'usr_id'] == SYSTEM_USER_ID)
continue;
580 if(!strlen(
$row[
'reg_hash']))
continue;
582 if((
int)$oRegSettigs->getRegistrationHashLifetime() > 0 &&
583 $row[
'create_date'] !=
'' &&
584 time() - $oRegSettigs->getRegistrationHashLifetime() > strtotime(
$row[
'create_date']))
589 $ilLog->write(__METHOD__.
': User '.$user->getLogin().
' (obj_id: '.$user->getId().
') will be deleted due to an expired registration hash ...');
591 ++$num_deleted_users;
596 $ilLog->write(__METHOD__.
': '.$num_deleted_users.
' inactive user objects with expired confirmation hash values (dual opt in) deleted ...');
598 $ilLog->write(__METHOD__.
': Finished deletion of inactive user objects with expired confirmation hash values (dual opt in) ...');