initial commit at dedicated page

This commit is contained in:
Andy Miller
2017-08-26 18:25:34 -06:00
parent 853acb2057
commit 8ca011dcd6
8 changed files with 70 additions and 27 deletions

View File

@@ -699,6 +699,19 @@ class AdminController extends AdminBaseController
return true;
}
protected function task2faverify()
{
$twofa = $this->admin->get2FA();
$user = $this->grav['user'];
$secret = isset($user->twofa_secret) ? $user->twofa_secret : null;
if (!(isset($this->data['2fa_code']) && $twofa->verifyCode($secret, $this->data['2fa_code']))) {
$this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.2FA_FAILED'), 'error');
return true;
}
}
/**
* Handle logout.
*