Helper plugin for Glubus Authentication plugin
jeph864
2023-06-07 338fce3943dd000284e3792b72cf1de628dc12d0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
 
require_once "Customizing/global/plugins/Services/Authentication/AuthenticationHook/AzureAD/classes/class.ilAzureADCron.php";
require_once "Customizing/global/plugins/Services/Authentication/AuthenticationHook/AzureAD/classes/class.ilAzureADCronSyncUserData.php";
/**
 * Class ilAzureADCronPlugin
 *
 * @author Jephte Abijuru <jephte.abijuru@minervis.com>
 */
class ilAzureADCronPlugin extends ilCronHookPlugin
{
 
 
    const PLUGIN_CLASS_NAME = ilAzureADCronPlugin::class;
    const PLUGIN_ID = "azureadcron";
    const PLUGIN_NAME = "AzureADCron";
    /**
     * @var self|null
     */
    protected static $instance = null;
 
 
    /**
     * ilViMPCronPlugin constructor
     */
    public function __construct()
    {
        parent::__construct();
    }
 
 
    /**
     * @return self
     */
    public static function getInstance() : self
    {
        if (self::$instance === null) {
            self::$instance = new self();
        }
 
        return self::$instance;
    }
 
 
    /**
     * @inheritDoc
     */
    public function getPluginName() : string
    {
        return self::PLUGIN_NAME;
    }
 
 
    /**
     * @inheritDoc
     */
    public function getCronJobInstance(/*string*/ $a_job_id)/*: ?ilCronJob*/
    {
        switch ($a_job_id) {
            case ilAzureADCron::CRON_JOB_ID:
                return new ilAzureADCron();
            case ilAzureADCronSyncUserData::CRON_JOB_ID:
                return new ilAzureADCronSyncUserData();
            default:
                return null;
        }
    }
 
 
    /**
     * @inheritDoc
     */
    public function getCronJobInstances() : array
    {
        return [
            new ilAzureADCron(),
            new ilAzureADCronSyncUserData()
        ];
    }
}