2016-08-29 20:19:44 +03:00
|
|
|
<?php
|
2017-05-02 15:40:44 +03:00
|
|
|
|
|
|
|
use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider;
|
|
|
|
use OCP\Template;
|
|
|
|
|
2017-01-16 14:48:09 +03:00
|
|
|
// @codeCoverageIgnoreStart
|
2016-08-29 20:19:44 +03:00
|
|
|
|
2017-05-02 15:40:44 +03:00
|
|
|
/* @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 "";
|
|
|
|
}
|
|
|
|
|
2017-01-16 22:53:48 +03:00
|
|
|
// @codeCoverageIgnoreEnd
|