Skip to content

Commit 1495691

Browse files
committed
Component/LDAP: contribute cron jobs
1 parent 04deb0d commit 1495691

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

components/ILIAS/LDAP/LDAP.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ public function init(
3333
array | \ArrayAccess &$internal,
3434
): void {
3535
$contribute[\ILIAS\Setup\Agent::class] = static fn() =>
36-
new \ILIAS\LDAP\Setup\Agent();
36+
new \ILIAS\LDAP\Setup\Agent();
37+
$contribute[\ILIAS\Cron\CronJob::class] = static fn() =>
38+
new \ilLDAPCronSynchronization(
39+
self::class,
40+
$use[\ILIAS\Language\Language::class],
41+
$use[\ILIAS\Logging\LoggerFactory::class]
42+
);
3743
}
3844
}

components/ILIAS/LDAP/classes/class.ilLDAPCronSynchronization.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,18 @@
2626
*/
2727
class ilLDAPCronSynchronization extends ilCronJob
2828
{
29-
private ilLanguage $lng;
3029
private ilLogger $logger;
3130
private ilCronManager $cronManager;
3231

3332
private int $counter = 0;
3433

35-
public function __construct()
34+
public function init(): void
3635
{
37-
global $DIC;
36+
$this->lng->loadLanguageModule('ldap');
3837

38+
global $DIC;
3939
$this->logger = $DIC->logger()->auth();
4040
$this->cronManager = $DIC->cron()->manager();
41-
$this->lng = $DIC->language();
42-
$this->lng->loadLanguageModule('ldap');
4341
}
4442

4543
public function getId(): string

components/ILIAS/LDAP/service.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,4 @@
66
<pluginslots>
77
<pluginslot id="ldaphk" name="LDAPHook" />
88
</pluginslots>
9-
<crons>
10-
<cron id="ldap_sync" class="ilLDAPCronSynchronization" />
11-
</crons>
129
</service>

0 commit comments

Comments
 (0)