2016-08-29 17:19:44 +00:00
|
|
|
<?php
|
2017-05-02 12:40:44 +00:00
|
|
|
|
|
|
|
use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider;
|
|
|
|
use OCP\Template;
|
|
|
|
|
2017-01-16 11:48:09 +00:00
|
|
|
// @codeCoverageIgnoreStart
|
2016-08-29 17:19:44 +00:00
|
|
|
|
2017-05-02 12:40:44 +00: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 19:53:48 +00:00
|
|
|
// @codeCoverageIgnoreEnd
|