ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilSoapUtils.php
Go to the documentation of this file.
1<?php
2 /*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22 */
23
24
33include_once './webservice/soap/classes/class.ilSoapAdministration.php';
34
36{
37 public function ignoreUserAbort()
38 {
39 return ignore_user_abort(true);
40 }
41
42 public function disableSOAPCheck()
43 {
44 $this->soap_check = false;
45 }
46
53 public function distributeMails($sid, $a_mail_xml)
54 {
55 $this->initAuth($sid);
56 $this->initIlias();
57
58 if (!$this->__checkSession($sid)) {
59 return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
60 }
61
62 include_once 'Services/Mail/classes/class.ilMail.php';
63 include_once 'webservice/soap/classes/class.ilSoapMailXmlParser.php';
64
65 $parser = new ilSoapMailXmlParser($a_mail_xml);
66 try {
67 // Check if wellformed
68 libxml_use_internal_errors(true);
69 $ok = simplexml_load_string($a_mail_xml);
70 if (!$ok) {
71 foreach (libxml_get_errors() as $err) {
72 $error .= ($err->message . ' ');
73 }
74 return $this->__raiseError($error, 'CLIENT');
75 }
76 $parser->start();
77 } catch (InvalidArgumentException $e) {
78 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ' ' . $e->getMessage());
79 return $this->__raiseError($e->getMessage(), 'CLIENT');
80 } catch (ilSaxParserException $e) {
81 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ' ' . $e->getMessage());
82 return $this->__raiseError($e->getMessage(), 'CLIENT');
83 }
84
85 $mails = $parser->getMails();
86
87 global $DIC;
88
89 $ilUser = $DIC['ilUser'];
90
91 foreach ($mails as $mail) {
92 // Prepare attachments
93 include_once './Services/Mail/classes/class.ilFileDataMail.php';
94 $file = new ilFileDataMail($ilUser->getId());
95 foreach ((array) $mail['attachments'] as $attachment) {
96 // TODO: Error handling
97 $file->storeAsAttachment($attachment['name'], $attachment['content']);
98 $attachments[] = ilUtil::_sanitizeFilemame($attachment['name']);
99 }
100
101 $mail_obj = new ilMail($ilUser->getId());
102 $mail_obj->setSaveInSentbox(true);
103 $mail_obj->saveAttachments((array) $attachments);
104 $mail_obj->enqueue(
105 implode(',', (array) $mail['to']),
106 implode(',', (array) $mail['cc']),
107 implode(',', (array) $mail['bcc']),
108 $mail['subject'],
109 implode("\n", (array) $mail['body']),
110 (array) $attachments,
111 array($mail['type']),
112 (bool) $mail['usePlaceholders']
113 );
114
115 // Finally unlink attachments
116 foreach ((array) $attachments as $att) {
117 $file->unlinkFile($att);
118 }
119 $mail_obj->savePostData(
120 $ilUser->getId(),
121 array(),
122 '',
123 '',
124 '',
125 '',
126 '',
127 '',
128 '',
129 ''
130 );
131 }
132 return true;
133 }
134
135 public function saveTempFileAsMediaObject($sid, $name, $tmp_name)
136 {
137 $this->initAuth($sid);
138 $this->initIlias();
139
140 if (!$this->__checkSession($sid)) {
141 return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
142 }
143
144 include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
146 }
147
148 public function getMobsOfObject($sid, $a_type, $a_id)
149 {
150 $this->initAuth($sid);
151 $this->initIlias();
152
153 if (!$this->__checkSession($sid)) {
154 return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
155 }
156
157 include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
159 }
160
168 public function ilCloneDependencies($sid, $copy_identifier, $is_initialized = false)
169 {
170 if(!$is_initialized) {
171
172 $this->initAuth($sid);
173 $this->initIlias();
174
175 if (!$this->__checkSession($sid)) {
176 return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
177 }
178 }
179
180 global $DIC;
181
182 $ilLog = $DIC['ilLog'];
183 $ilUser = $DIC['ilUser'];
184
185 include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
186 $cp_options = ilCopyWizardOptions::_getInstance($copy_identifier);
187
188 // Check owner of copy procedure
189 if (!$cp_options->checkOwner($ilUser->getId())) {
190 ilLoggerFactory::getLogger('obj')->error('Permission check failed for user id: ' . $ilUser->getId() . ', copy id: ' . $copy_identifier);
191 return false;
192 }
193
194 // Fetch first node
195 if (($node = $cp_options->fetchFirstDependenciesNode()) === false) {
196 $cp_options->deleteAll();
197 ilLoggerFactory::getLogger('obj')->info('Finished copy step 2. Copy completed');
198 return true;
199 }
200
201 // Check options of this node
202 $options = $cp_options->getOptions($node['child']);
203 $new_ref_id = 0;
204 switch ($options['type']) {
206 ilLoggerFactory::getLogger('obj')->debug(': Omitting node: ' . $node['obj_id'] . ', ' . $node['title'] . ', ' . $node['type']);
207 $this->callNextDependency($sid, $cp_options);
208 break;
209
211 ilLoggerFactory::getLogger('obj')->debug(': Start cloning dependencies for node: ' . $node['obj_id'] . ', ' . $node['title'] . ', ' . $node['type']);
212 $this->cloneDependencies($node, $cp_options);
213 $this->callNextDependency($sid, $cp_options);
214 break;
215
217 ilLoggerFactory::getLogger('obj')->debug(': Start cloning dependencies: ' . $node['obj_id'] . ', ' . $node['title'] . ', ' . $node['type']);
218 $this->cloneDependencies($node, $cp_options);
219 $this->callNextDependency($sid, $cp_options);
220 break;
221
222 default:
223 ilLoggerFactory::getLogger('obj')->warning('No valid action type given for node: ' . $node['obj_id'] . ', ' . $node['title'] . ', ' . $node['type']);
224 $this->callNextDependency($sid, $cp_options);
225 break;
226 }
227 return true;
228 }
229
238 public function ilClone($sid, $copy_identifier)
239 {
240 $this->initAuth($sid);
241 $this->initIlias();
242
243 if (!$this->__checkSession($sid)) {
244 ilLoggerFactory::getLogger('obj')->error('Object cloning failed. Invalid session given: ' . $this->__getMessage());
245 }
246
247 global $DIC;
248
249 $ilUser = $DIC->user();
250
251 include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
252 $cp_options = ilCopyWizardOptions::_getInstance($copy_identifier);
253
254 // Check owner of copy procedure
255 if (!$cp_options->checkOwner($ilUser->getId())) {
256 ilLoggerFactory::getLogger('obj')->error('Permission check failed for user id: ' . $ilUser->getId() . ', copy id: ' . $copy_identifier);
257 return false;
258 }
259
260
261 // Fetch first node
262 if (($node = $cp_options->fetchFirstNode()) === false) {
263 ilLoggerFactory::getLogger('obj')->info('Finished copy step 1. Starting copying of object dependencies...');
264 return $this->ilCloneDependencies($sid, $copy_identifier, true);
265 }
266
267 // Check options of this node
268 $options = $cp_options->getOptions($node['child']);
269
270 $action = $this->rewriteActionForNode($cp_options, $node, $options);
271
272 $new_ref_id = 0;
273 switch ($action) {
275 ilLoggerFactory::getLogger('obj')->debug(': Omitting node: ' . $node['obj_id'] . ', ' . $node['title'] . ', ' . $node['type']);
276 // set mapping to zero
277 $cp_options->appendMapping($node['child'], 0);
278 $this->callNextNode($sid, $cp_options);
279 break;
280
282
283 ilLoggerFactory::getLogger('obj')->debug('Start cloning node: ' . $node['obj_id'] . ', ' . $node['title'] . ', ' . $node['type']);
284 $new_ref_id = $this->cloneNode($node, $cp_options);
285 $this->callNextNode($sid, $cp_options);
286 break;
287
289 ilLoggerFactory::getLogger('obj')->debug('Start linking node: ' . $node['obj_id'] . ', ' . $node['title'] . ', ' . $node['type']);
290 $new_ref_id = $this->linkNode($node, $cp_options);
291 $this->callNextNode($sid, $cp_options);
292 break;
293
294 case \ilCopyWizardOptions::COPY_WIZARD_LINK_TO_TARGET:
295 ilLoggerFactory::getLogger('obj')->debug('Start creating internal link for: ' . $node['obj_id'] . ', ' . $node['title'] . ', ' . $node['type']);
296 $new_ref_id = $this->internalLinkNode($node, $cp_options);
297 $this->callNextNode($sid, $cp_options);
298 break;
299
300 default:
301 ilLoggerFactory::getLogger('obj')->warning('No valid action type given for: ' . $node['obj_id'] . ', ' . $node['title'] . ', ' . $node['type']);
302 $this->callNextNode($sid, $cp_options);
303 break;
304
305 }
306 return $new_ref_id;
307 }
308
313 protected function rewriteActionForNode(ilCopyWizardOptions $cpo, array $node, array $options)
314 {
316 if (array_key_exists('type', $options)) {
317 $default_mode = $options['type'];
318 }
319 if (
320 array_key_exists('child', $node) &&
321 $cpo->isRootNode($node)
322 ) {
323 return $default_mode;
324 }
325
326 if ($this->findMappedReferenceForNode($cpo, $node)) {
327
328 if ($default_mode == \ilCopyWizardOptions::COPY_WIZARD_COPY) {
329 return \ilCopyWizardOptions::COPY_WIZARD_LINK_TO_TARGET;
330 }
331 }
332 return $default_mode;
333 }
334
340 protected function findMappedReferenceForNode(\ilCopyWizardOptions $cpo, array $node)
341 {
342 global $DIC;
343
344 $logger = $DIC->logger()->obj();
345 $tree = $DIC->repositoryTree();
346 $root = $cpo->getRootNode();
347 $obj_id = $node['obj_id'];
348
349 $mappings = $cpo->getMappings();
350 foreach (\ilObject::_getAllReferences($obj_id) as $ref_id => $also_ref_id) {
351
352 $logger->debug('Validating node: ' . $ref_id . ' and root ' . $root );
353 $logger->dump($DIC->repositoryTree()->getRelation($ref_id , $root));
354
355 if($DIC->repositoryTree()->getRelation($ref_id , $root) != \ilTree::RELATION_CHILD) {
356 $logger->debug('Ignoring non child relation');
357 continue;
358 }
359 // check if mapping is already available
360 $logger->dump($mappings);
361 if (array_key_exists($ref_id, $mappings)) {
362 $logger->debug('Found existing mapping for linked node.');
363 return $mappings[$ref_id];
364 }
365 }
366 $logger->info('Nothing found');
367 return null;
368 }
369
370
371
378 private function callNextNode($sid, $cp_options)
379 {
380 global $DIC;
381
382 $ilLog = $DIC['ilLog'];
383
384 $cp_options->dropFirstNode();
385
386 if ($cp_options->isSOAPEnabled()) {
387 // Start next soap call
388 include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
389 $soap_client = new ilSoapClient();
390 $soap_client->setResponseTimeout(1);
391 $soap_client->enableWSDL(true);
392 $soap_client->init();
393 $soap_client->call('ilClone', array($sid,$cp_options->getCopyId()));
394 } else {
395 ilLoggerFactory::getLogger('obj')->warning('SOAP clone call failed. Calling clone method manually');
396 $cp_options->read();
397 include_once('./webservice/soap/include/inc.soap_functions.php');
398 $res = ilSoapFunctions::ilClone($sid, $cp_options->getCopyId());
399 }
400 return true;
401 }
402
403 private function callNextDependency($sid, $cp_options)
404 {
405 global $DIC;
406
407 $ilLog = $DIC['ilLog'];
408
409 $cp_options->dropFirstDependenciesNode();
410
411 if ($cp_options->isSOAPEnabled()) {
412 // Start next soap call
413 include_once 'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
414 $soap_client = new ilSoapClient();
415 $soap_client->setResponseTimeout(1);
416 $soap_client->enableWSDL(true);
417 $soap_client->init();
418 $soap_client->call('ilCloneDependencies', array($sid,$cp_options->getCopyId()));
419 } else {
420 ilLoggerFactory::getLogger('obj')->warning('SOAP clone call failed. Calling clone method manually');
421 $cp_options->read();
422 include_once('./webservice/soap/include/inc.soap_functions.php');
423 $res = ilSoapFunctions::ilCloneDependencies($sid, $cp_options->getCopyId());
424 }
425 return true;
426 }
427
435 private function cloneNode($node, $cp_options)
436 {
437 global $DIC;
438
439 $ilLog = $DIC['ilLog'];
440 $tree = $DIC['tree'];
441 $ilAccess = $DIC['ilAccess'];
442 $rbacreview = $DIC['rbacreview'];
443
444 #sleep(20);
445
446 $source_id = $node['child'];
447 $parent_id = $node['parent'];
448 $options = $cp_options->getOptions($node['child']);
449 $mappings = $cp_options->getMappings();
450
451 if (!$ilAccess->checkAccess('copy', '', $node['child'])) {
452 ilLoggerFactory::getLogger('obj')->error('No copy permission granted: ' . $source_id . ', ' . $node['title'] . ', ' . $node['type']);
453 return false;
454 }
455 if (!isset($mappings[$parent_id])) {
456 ilLoggerFactory::getLogger('obj')->info('Omitting node ' . $source_id . ', ' . $node['title'] . ', ' . $node['type'] . '. No target found.');
457 return true;
458 }
459 $target_id = $mappings[$parent_id];
460
461 if (!$tree->isInTree($target_id)) {
462 ilLoggerFactory::getLogger('obj')->notice('Omitting node ' . $source_id . ', ' . $node['title'] . ', ' . $node['type'] . '. Object has been deleted.');
463 return false;
464 }
465
466 $orig = ilObjectFactory::getInstanceByRefId((int) $source_id);
467 $new_obj = $orig->cloneObject((int) $target_id, $cp_options->getCopyId());
468
469 if (!is_object($new_obj)) {
470 ilLoggerFactory::getLogger('obj')->error('Error copying ' . $source_id . ', ' . $node['title'] . ', ' . $node['type'] . '. No target found.');
471 return false;
472 }
473
474 // rbac log
475 include_once "Services/AccessControl/classes/class.ilRbacLog.php";
476 $rbac_log_roles = $rbacreview->getParentRoleIds($new_obj->getRefId(), false);
477 $rbac_log = ilRbacLog::gatherFaPa($new_obj->getRefId(), array_keys($rbac_log_roles), true);
478 ilRbacLog::add(ilRbacLog::COPY_OBJECT, $new_obj->getRefId(), $rbac_log, (int) $source_id);
479
480 // Finally add new mapping entry
481 $cp_options->appendMapping($source_id, $new_obj->getRefId());
482 return $new_obj->getRefId();
483 }
484
492 private function cloneDependencies($node, $cp_options)
493 {
494 global $DIC;
495
496 $ilLog = $DIC['ilLog'];
497
498 $source_id = $node['child'];
499 $mappings = $cp_options->getMappings();
500
501 if (!isset($mappings[$source_id])) {
502 ilLoggerFactory::getLogger('obj')->debug('Omitting node ' . $source_id . ', ' . $node['title'] . ', ' . $node['type'] . '. No mapping found.');
503 return true;
504 }
505 $target_id = $mappings[$source_id];
506
507 $orig = ilObjectFactory::getInstanceByRefId((int) $source_id);
508 $orig->cloneDependencies($target_id, $cp_options->getCopyId());
509 return true;
510 }
511
520 private function internalLinkNode($node, $cp_options)
521 {
522 global $DIC;
523
524 $ilAccess = $DIC->access();
525 $logger = $DIC->logger()->obj();
526 $rbacreview = $DIC->rbac()->review();
527 $tree = $DIC->repositoryTree();
528 $mappings = $cp_options->getMappings();
529
530 $source_id = $this->findMappedReferenceForNode($cp_options, $node);
531 try {
532 $orig = ilObjectFactory::getInstanceByRefId((int) $source_id);
533 if(!$orig instanceof \ilObject) {
534 $logger->error('Cannot create object instance.');
535 return false;
536 }
537 }
539 $logger->error('Cannot create object instance for ref_id: ' . $source_id);
540 $logger->error($e->getMessage());
541 return false;
542 }
543
544 // target (parent id) is the mapped parent id of the current node
545 $node_parent = $node['parent'];
546 if (!array_key_exists($node_parent, $mappings)) {
547 $logger->error('Cannot new parent id for node: ' . $node['parent']);
548 return false;
549 }
550 $parent_id = $mappings[$node_parent];
551
552 $new_ref_id = $orig->createReference();
553 $orig->putInTree($parent_id);
554 $orig->setPermissions($parent_id);
555
556 if (!($new_ref_id)) {
557 $logger->warning('Creating internal link failed.');
558 return false;
559 }
560
561 // rbac log
562 $rbac_log_roles = $rbacreview->getParentRoleIds($new_ref_id, false);
563 $rbac_log = ilRbacLog::gatherFaPa($new_ref_id, array_keys($rbac_log_roles), true);
564 ilRbacLog::add(ilRbacLog::LINK_OBJECT, $new_ref_id, $rbac_log, (int) $source_id);
565
566 // Finally add new mapping entry
567 $cp_options->appendMapping($node['child'], $new_ref_id);
568
569 $logger->notice('Added mapping for ' . $node['child'] . ' ' . $new_ref_id);
570
571
572 return $new_ref_id;
573 }
574
582 private function linkNode($node, $cp_options)
583 {
584 global $DIC;
585
586 $ilLog = $DIC['ilLog'];
587 $ilAccess = $DIC['ilAccess'];
588 $rbacreview = $DIC['rbacreview'];
589
590 $source_id = $node['child'];
591 $parent_id = $node['parent'];
592 $options = $cp_options->getOptions($node['child']);
593 $mappings = $cp_options->getMappings();
594
595 if (!$ilAccess->checkAccess('delete', '', $node['child'])) {
596 ilLoggerFactory::getLogger('obj')->warning('No delete permission granted: ' . $source_id . ', ' . $node['title'] . ', ' . $node['type']);
597 return false;
598 }
599 if (!isset($mappings[$parent_id])) {
600 ilLoggerFactory::getLogger('obj')->warning('Omitting node ' . $source_id . ', ' . $node['title'] . ', ' . $node['type'] . '. No target found.');
601 return true;
602 }
603 $target_id = $mappings[$parent_id];
604
605 $orig = ilObjectFactory::getInstanceByRefId((int) $source_id);
606 $new_ref_id = $orig->createReference();
607 $orig->putInTree($target_id);
608 $orig->setPermissions($target_id);
609
610 if (!($new_ref_id)) {
611 ilLoggerFactory::getLogger('obj')->error('Error linking ' . $source_id . ', ' . $node['title'] . ', ' . $node['type'] . '. No target found.');
612 return false;
613 }
614
615 // rbac log
616 include_once "Services/AccessControl/classes/class.ilRbacLog.php";
617 $rbac_log_roles = $rbacreview->getParentRoleIds($new_ref_id, false);
618 $rbac_log = ilRbacLog::gatherFaPa($new_ref_id, array_keys($rbac_log_roles), true);
619 ilRbacLog::add(ilRbacLog::LINK_OBJECT, $new_ref_id, $rbac_log, (int) $source_id);
620
621 // Finally add new mapping entry
622 $cp_options->appendMapping($source_id, $new_ref_id);
623 return $new_ref_id;
624 }
625
632 public static function validateXML($xml)
633 {
634 // validate to prevent wrong XMLs
635 $dom = @domxml_open_mem($xml, DOMXML_LOAD_VALIDATING, $error);
636 if ($error) {
637 $msg = array();
638 if (is_array($error)) {
639 foreach ($error as $err) {
640 $msg []= "(" . $err["line"] . "," . $err["col"] . "): " . $err["errormessage"];
641 }
642 } else {
643 $msg[] = $error;
644 }
645 $msg = join("\n", $msg);
646 return $msg;
647 }
648 return true;
649 }
650
651 public function handleECSTasks($sid, $a_server_id)
652 {
653 $this->initAuth($sid);
654 $this->initIlias();
655
656 if (!$this->__checkSession($sid)) {
657 return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
658 }
659
660 include_once('./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
661
662 global $DIC;
663
664 $ilLog = $DIC['ilLog'];
665
666 $ilLog->write(__METHOD__ . ': Starting task execution...');
667 $scheduler = ilECSTaskScheduler::_getInstanceByServerId($a_server_id);
668 $scheduler->startTaskExecution();
669
670 return true;
671 }
672
685 public function deleteExpiredDualOptInUserObjects($sid, $usr_id)
686 {
687 $this->initAuth($sid);
688 $this->initIlias();
689
690 // Session check not possible -> anonymous user is the trigger
691
692 global $DIC;
693
694 $ilDB = $DIC['ilDB'];
695 $ilLog = $DIC['ilLog'];
696
697 $ilLog->write(__METHOD__ . ': Started deletion of inactive user objects with expired confirmation hash values (dual opt in) ...');
698
699 require_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
700 $oRegSettigs = new ilRegistrationSettings();
701
702 $query = '';
703
704 /*
705 * Fetch the current actuator user object first, because this user will try to perform very probably
706 * a new registration with the same login name in a few seconds ;-)
707 *
708 */
709 if ((int) $usr_id > 0) {
710 $query .= 'SELECT usr_id, create_date, reg_hash FROM usr_data '
711 . 'WHERE active = 0 '
712 . 'AND reg_hash IS NOT NULL '
713 . 'AND usr_id = ' . $ilDB->quote($usr_id, 'integer') . ' ';
714 $query .= 'UNION ';
715 }
716
717 $query .= 'SELECT usr_id, create_date, reg_hash FROM usr_data '
718 . 'WHERE active = 0 '
719 . 'AND reg_hash IS NOT NULL '
720 . 'AND usr_id != ' . $ilDB->quote($usr_id, 'integer') . ' ';
721
722 $res = $ilDB->query($query);
723
724 $ilLog->write(__METHOD__ . ': ' . $ilDB->numRows($res) . ' inactive user objects with confirmation hash values (dual opt in) found ...');
725
726 /*
727 * mjansen: 15.12.2010:
728 * I perform the expiration check in php because of multi database support (mysql, postgresql).
729 * I did not find an oracle equivalent for mysql: UNIX_TIMESTAMP()
730 */
731
732 $num_deleted_users = 0;
733 while ($row = $ilDB->fetchAssoc($res)) {
734 if ($row['usr_id'] == ANONYMOUS_USER_ID || $row['usr_id'] == SYSTEM_USER_ID) {
735 continue;
736 }
737 if (!strlen($row['reg_hash'])) {
738 continue;
739 }
740
741 if ((int) $oRegSettigs->getRegistrationHashLifetime() > 0 &&
742 $row['create_date'] != '' &&
743 time() - $oRegSettigs->getRegistrationHashLifetime() > strtotime($row['create_date'])) {
744 $user = ilObjectFactory::getInstanceByObjId($row['usr_id'], false);
745 if ($user instanceof ilObjUser) {
746 $ilLog->write(__METHOD__ . ': User ' . $user->getLogin() . ' (obj_id: ' . $user->getId() . ') will be deleted due to an expired registration hash ...');
747 $user->delete();
748 ++$num_deleted_users;
749 }
750 }
751 }
752
753 $ilLog->write(__METHOD__ . ': ' . $num_deleted_users . ' inactive user objects with expired confirmation hash values (dual opt in) deleted ...');
754
755 $ilLog->write(__METHOD__ . ': Finished deletion of inactive user objects with expired confirmation hash values (dual opt in) ...');
756
757 return true;
758 }
759}
$parser
Definition: BPMN2Parser.php:23
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
An exception for terminatinating execution or to throw for unit testing.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
isRootNode($a_root)
Is root node.
static _getInstanceByServerId($a_server_id)
get singleton instance Private access use ilECSTaskScheduler::start() or ilECSTaskScheduler::startTas...
Class ilFileDataMail.
static getLogger($a_component_id)
Get component logger.
static _getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _saveTempFileAsMediaObject($name, $tmp_name, $upload=true)
Create new media object and update page in db and return new media object.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObject Basic functions for all objects.
static _getAllReferences($a_id)
get all reference ids of object
const COPY_OBJECT
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
const LINK_OBJECT
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
Class ilObjAuthSettingsGUI.
SaxParserException thrown by ilSaxParser if property throwException is set.
initAuth($sid)
Init authentication.
__raiseError($a_message, $a_code)
static ilCloneDependencies($sid, $copy_identifier)
static ilClone($sid, $copy_identifier)
XML parser for soap mails.
callNextNode($sid, $cp_options)
Call next node using soap.
linkNode($node, $cp_options)
Link node.
ilCloneDependencies($sid, $copy_identifier, $is_initialized=false)
clone object dependencies (e.g.
internalLinkNode($node, $cp_options)
Link node @access private.
deleteExpiredDualOptInUserObjects($sid, $usr_id)
Method for soap webservice: deleteExpiredDualOptInUserObjects.
handleECSTasks($sid, $a_server_id)
saveTempFileAsMediaObject($sid, $name, $tmp_name)
rewriteActionForNode(ilCopyWizardOptions $cpo, array $node, array $options)
findMappedReferenceForNode(\ilCopyWizardOptions $cpo, array $node)
distributeMails($sid, $a_mail_xml)
mail via soap
getMobsOfObject($sid, $a_type, $a_id)
static validateXML($xml)
validates an xml file, if dtd is attached
ilClone($sid, $copy_identifier)
Clone object.
cloneDependencies($node, $cp_options)
cloneDependencies
cloneNode($node, $cp_options)
Clone node.
callNextDependency($sid, $cp_options)
const RELATION_CHILD
static _sanitizeFilemame($a_filename)
$target_id
Definition: goto.php:49
domxml_open_mem($str, $mode=0, &$error=null)
if($format !==null) $name
Definition: metadata.php:230
$xml
Definition: metadata.php:332
$query
foreach($_POST as $key=> $value) $res
global $ilDB
$ilUser
Definition: imgupload.php:18
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46