1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* @copyright Copyright (c) 2017 Joas Schilling <[email protected]> |
7
|
|
|
* |
8
|
|
|
* @author Christoph Wurst <[email protected]> |
9
|
|
|
* @author Joas Schilling <[email protected]> |
10
|
|
|
* @author Roeland Jago Douma <[email protected]> |
11
|
|
|
* |
12
|
|
|
* @license GNU AGPL version 3 or any later version |
13
|
|
|
* |
14
|
|
|
* This program is free software: you can redistribute it and/or modify |
15
|
|
|
* it under the terms of the GNU Affero General Public License as |
16
|
|
|
* published by the Free Software Foundation, either version 3 of the |
17
|
|
|
* License, or (at your option) any later version. |
18
|
|
|
* |
19
|
|
|
* This program is distributed in the hope that it will be useful, |
20
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
21
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22
|
|
|
* GNU Affero General Public License for more details. |
23
|
|
|
* |
24
|
|
|
* You should have received a copy of the GNU Affero General Public License |
25
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
26
|
|
|
* |
27
|
|
|
*/ |
28
|
|
|
namespace OCA\TwoFactorBackupCodes\AppInfo; |
29
|
|
|
|
30
|
|
|
use OCA\TwoFactorBackupCodes\Event\CodesGenerated; |
31
|
|
|
use OCA\TwoFactorBackupCodes\Listener\ActivityPublisher; |
32
|
|
|
use OCA\TwoFactorBackupCodes\Listener\ClearNotifications; |
33
|
|
|
use OCA\TwoFactorBackupCodes\Listener\ProviderDisabled; |
34
|
|
|
use OCA\TwoFactorBackupCodes\Listener\ProviderEnabled; |
35
|
|
|
use OCA\TwoFactorBackupCodes\Listener\RegistryUpdater; |
36
|
|
|
use OCA\TwoFactorBackupCodes\Listener\UserDeleted; |
37
|
|
|
use OCA\TwoFactorBackupCodes\Notifications\Notifier; |
38
|
|
|
use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider; |
39
|
|
|
use OCP\AppFramework\App; |
40
|
|
|
use OCP\AppFramework\Bootstrap\IBootContext; |
41
|
|
|
use OCP\AppFramework\Bootstrap\IBootstrap; |
42
|
|
|
use OCP\AppFramework\Bootstrap\IRegistrationContext; |
43
|
|
|
use OCP\Authentication\TwoFactorAuth\IRegistry; |
44
|
|
|
use OCP\User\Events\UserDeletedEvent; |
45
|
|
|
|
46
|
|
|
class Application extends App implements IBootstrap { |
47
|
|
|
public const APP_ID = 'twofactor_backupcodes'; |
48
|
|
|
|
49
|
|
|
public function __construct() { |
50
|
|
|
parent::__construct(self::APP_ID); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function register(IRegistrationContext $context): void { |
54
|
|
|
$context->registerNotifierService(Notifier::class); |
55
|
|
|
|
56
|
|
|
$context->registerEventListener(CodesGenerated::class, ActivityPublisher::class); |
57
|
|
|
$context->registerEventListener(CodesGenerated::class, RegistryUpdater::class); |
58
|
|
|
$context->registerEventListener(CodesGenerated::class, ClearNotifications::class); |
59
|
|
|
$context->registerEventListener(IRegistry::EVENT_PROVIDER_ENABLED, ProviderEnabled::class); |
|
|
|
|
60
|
|
|
$context->registerEventListener(IRegistry::EVENT_PROVIDER_DISABLED, ProviderDisabled::class); |
|
|
|
|
61
|
|
|
$context->registerEventListener(UserDeletedEvent::class, UserDeleted::class); |
62
|
|
|
|
63
|
|
|
|
64
|
|
|
$context->registerTwoFactorProvider(BackupCodesProvider::class); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
public function boot(IBootContext $context): void { |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|
This class constant has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the constant will be removed from the class and what other constant to use instead.