diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-01-30 09:54:55 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-01-30 10:57:15 +0100 |
commit | 94cd1b1912eb6ec564763a9ff74ddde88f6e3f57 (patch) | |
tree | 79c6b6715befc57ddd3994f0ab6929319ec4686b /apps/twofactor_backupcodes | |
parent | 8bcc2d352e3ed6a5f08b75991ab8f6fd53734f9f (diff) | |
download | nextcloud-server-94cd1b1912eb6ec564763a9ff74ddde88f6e3f57.tar.gz nextcloud-server-94cd1b1912eb6ec564763a9ff74ddde88f6e3f57.zip |
fix(twofactor_backupcodes): Mirate away from deprecated event
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/twofactor_backupcodes')
3 files changed, 10 insertions, 9 deletions
diff --git a/apps/twofactor_backupcodes/lib/AppInfo/Application.php b/apps/twofactor_backupcodes/lib/AppInfo/Application.php index 28b59ceb0bd..3ef9670fb0f 100644 --- a/apps/twofactor_backupcodes/lib/AppInfo/Application.php +++ b/apps/twofactor_backupcodes/lib/AppInfo/Application.php @@ -40,7 +40,8 @@ use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; -use OCP\Authentication\TwoFactorAuth\IRegistry; +use OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserRegistered; +use OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserUnregistered; use OCP\User\Events\UserDeletedEvent; class Application extends App implements IBootstrap { @@ -56,8 +57,8 @@ class Application extends App implements IBootstrap { $context->registerEventListener(CodesGenerated::class, ActivityPublisher::class); $context->registerEventListener(CodesGenerated::class, RegistryUpdater::class); $context->registerEventListener(CodesGenerated::class, ClearNotifications::class); - $context->registerEventListener(IRegistry::EVENT_PROVIDER_ENABLED, ProviderEnabled::class); - $context->registerEventListener(IRegistry::EVENT_PROVIDER_DISABLED, ProviderDisabled::class); + $context->registerEventListener(TwoFactorProviderForUserRegistered::class, ProviderEnabled::class); + $context->registerEventListener(TwoFactorProviderForUserUnregistered::class, ProviderDisabled::class); $context->registerEventListener(UserDeletedEvent::class, UserDeleted::class); diff --git a/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php b/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php index 7dbfbbc0b5d..1f3cbfce9a3 100644 --- a/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php +++ b/apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php @@ -28,12 +28,12 @@ namespace OCA\TwoFactorBackupCodes\Listener; use OCA\TwoFactorBackupCodes\BackgroundJob\RememberBackupCodesJob; use OCP\Authentication\TwoFactorAuth\IRegistry; -use OCP\Authentication\TwoFactorAuth\RegistryEvent; +use OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserUnregistered; use OCP\BackgroundJob\IJobList; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -/** @template-implements IEventListener<RegistryEvent> */ +/** @template-implements IEventListener<TwoFactorProviderForUserUnregistered> */ class ProviderDisabled implements IEventListener { /** @var IRegistry */ @@ -49,7 +49,7 @@ class ProviderDisabled implements IEventListener { } public function handle(Event $event): void { - if (!($event instanceof RegistryEvent)) { + if (!($event instanceof TwoFactorProviderForUserUnregistered)) { return; } diff --git a/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php b/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php index f76c34669b2..3f5349ff950 100644 --- a/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php +++ b/apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php @@ -28,12 +28,12 @@ namespace OCA\TwoFactorBackupCodes\Listener; use OCA\TwoFactorBackupCodes\BackgroundJob\RememberBackupCodesJob; use OCP\Authentication\TwoFactorAuth\IRegistry; -use OCP\Authentication\TwoFactorAuth\RegistryEvent; +use OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserRegistered; use OCP\BackgroundJob\IJobList; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; -/** @template-implements IEventListener<RegistryEvent> */ +/** @template-implements IEventListener<TwoFactorProviderForUserRegistered> */ class ProviderEnabled implements IEventListener { /** @var IRegistry */ @@ -49,7 +49,7 @@ class ProviderEnabled implements IEventListener { } public function handle(Event $event): void { - if (!($event instanceof RegistryEvent)) { + if (!($event instanceof TwoFactorProviderForUserRegistered)) { return; } |