diff options
Diffstat (limited to 'apps/twofactor_backupcodes/settings/personal.php')
-rw-r--r-- | apps/twofactor_backupcodes/settings/personal.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/twofactor_backupcodes/settings/personal.php b/apps/twofactor_backupcodes/settings/personal.php index 0a018c0ff28..48c84a3355e 100644 --- a/apps/twofactor_backupcodes/settings/personal.php +++ b/apps/twofactor_backupcodes/settings/personal.php @@ -1,6 +1,19 @@ <?php + +use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider; +use OCP\Template; + // @codeCoverageIgnoreStart -$tmpl = new \OCP\Template('twofactor_backupcodes', 'personal'); -return $tmpl->fetchPage(); +/* @var $provider BackupCodesProvider */ +$provider = OC::$server->query(BackupCodesProvider::class); +$user = OC::$server->getUserSession()->getUser(); + +if ($provider->isActive($user)) { + $tmpl = new Template('twofactor_backupcodes', 'personal'); + return $tmpl->fetchPage(); +} else { + return ""; +} + // @codeCoverageIgnoreEnd |