ILIAS  trunk Revision v12.0_alpha-1338-g8f7e531aa3c
DeleteExpiredPendingRegistrationsCronJob.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27use ilLanguage;
28
33{
36
37 public function init(): void
38 {
39 global $DIC;
40
41 $this->lng = $DIC->language();
42 $this->dual_opt_in_service = new \ILIAS\Registration\DualOptIn\Service\DualOptInServiceImpl(
44 new \ILIAS\Registration\DualOptIn\Repository\PendingRegistrationDatabaseRepository($DIC->database()),
45 $DIC->database(),
46 $DIC->logger()->user(),
47 (new \ILIAS\Data\Factory())->clock()
48 );
49 }
50
51 public function getId(): string
52 {
53 return 'reg_delete_expired_pending_registrations';
54 }
55
56 public function getTitle(): string
57 {
58 $this->init();
59
60 return $this->lng->txt('reg_delete_expired_pending_registrations');
61 }
62
63 public function getDescription(): string
64 {
65 $this->init();
66
67 return $this->lng->txt('reg_delete_expired_pending_registrations_desc');
68 }
69
71 {
72 return JobScheduleType::DAILY;
73 }
74
75 public function getDefaultScheduleValue(): ?int
76 {
77 return null;
78 }
79
80 public function hasAutoActivation(): bool
81 {
82 return false;
83 }
84
85 public function hasFlexibleSchedule(): bool
86 {
87 return false;
88 }
89
90 public function run(): JobResult
91 {
92 $this->init();
93
94 $num_deleted_users = $this->dual_opt_in_service->deleteExpiredUserObjects();
95
96 $result = new JobResult();
97 $result->setStatus(JobResult::STATUS_OK);
98 $result->setMessage(sprintf('%d inactive user objects with expired confirmation hash values (dual opt-in) deleted.', $num_deleted_users));
99
100 return $result;
101 }
102}
final const int STATUS_OK
Definition: JobResult.php:27
Cronjob to delete user accounts for which the registration (dual opt-in) has never been finalized.
hasAutoActivation()
Is to be activated on "installation", does only work for ILIAS core cron jobs.
language handling
Class ilObjAuthSettingsGUI.
This is what a factory for input fields looks like.
Definition: Factory.php:31
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $DIC
Definition: shib_login.php:26