server/apps/twofactor_backupcodes/settings/personal.php
Christoph Wurst d8b3fe460e
Hide 2FA backup codes if no other 2FA providers are enabled
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2017-05-02 14:40:44 +02:00

19 lines
438 B
PHP

<?php
use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider;
use OCP\Template;
// @codeCoverageIgnoreStart
/* @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