|
|
@ -30,15 +30,15 @@ namespace OCA\TwoFactorBackupCodes\Provider; |
|
|
use OC\App\AppManager; |
|
|
use OC\App\AppManager; |
|
|
use OCA\TwoFactorBackupCodes\Service\BackupCodeStorage; |
|
|
use OCA\TwoFactorBackupCodes\Service\BackupCodeStorage; |
|
|
use OCA\TwoFactorBackupCodes\Settings\Personal; |
|
|
use OCA\TwoFactorBackupCodes\Settings\Personal; |
|
|
|
|
|
use OCP\Authentication\TwoFactorAuth\IDeactivatableByAdmin; |
|
|
use OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings; |
|
|
use OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings; |
|
|
use OCP\Authentication\TwoFactorAuth\IProvider; |
|
|
|
|
|
use OCP\Authentication\TwoFactorAuth\IProvidesPersonalSettings; |
|
|
use OCP\Authentication\TwoFactorAuth\IProvidesPersonalSettings; |
|
|
use OCP\IInitialStateService; |
|
|
use OCP\IInitialStateService; |
|
|
use OCP\IL10N; |
|
|
use OCP\IL10N; |
|
|
use OCP\IUser; |
|
|
use OCP\IUser; |
|
|
use OCP\Template; |
|
|
use OCP\Template; |
|
|
|
|
|
|
|
|
class BackupCodesProvider implements IProvider, IProvidesPersonalSettings { |
|
|
|
|
|
|
|
|
class BackupCodesProvider implements IDeactivatableByAdmin, IProvidesPersonalSettings { |
|
|
|
|
|
|
|
|
/** @var string */ |
|
|
/** @var string */ |
|
|
private $appName; |
|
|
private $appName; |
|
|
@ -164,4 +164,8 @@ class BackupCodesProvider implements IProvider, IProvidesPersonalSettings { |
|
|
$this->initialStateService->provideInitialState($this->appName, 'state', $state); |
|
|
$this->initialStateService->provideInitialState($this->appName, 'state', $state); |
|
|
return new Personal(); |
|
|
return new Personal(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function disableFor(IUser $user) { |
|
|
|
|
|
$this->storage->deleteCodes($user); |
|
|
|
|
|
} |
|
|
} |
|
|
} |