diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-06-04 20:07:56 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-06-04 20:10:25 +0300 |
commit | 42156f9b6e7705f3d8d3c634beffb8ee34886278 (patch) | |
tree | 53dbb64adfd78d22cbd4a4fa89e2c1859e31fdc3 /lib/Provider | |
parent | ed7d8759dbc637e121c732bfeb3cfc2042d818ff (diff) |
add GUI and other small enhancements
Diffstat (limited to 'lib/Provider')
-rw-r--r-- | lib/Provider/TotpProvider.php | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/lib/Provider/TotpProvider.php b/lib/Provider/TotpProvider.php index 4cb8eec..ae910df 100644 --- a/lib/Provider/TotpProvider.php +++ b/lib/Provider/TotpProvider.php @@ -39,8 +39,6 @@ class TotpProvider implements IProvider { /** * Get unique identifier of this 2FA provider * - * @since 9.1.0 - * * @return string */ public function getId() { @@ -50,10 +48,6 @@ class TotpProvider implements IProvider { /** * Get the display name for selecting the 2FA provider * - * Example: "Email" - * - * @since 9.1.0 - * * @return string */ public function getDisplayName() { @@ -63,10 +57,6 @@ class TotpProvider implements IProvider { /** * Get the description for selecting the 2FA provider * - * Example: "Get a token via e-mail" - * - * @since 9.1.0 - * * @return string */ public function getDescription() { @@ -76,18 +66,10 @@ class TotpProvider implements IProvider { /** * Get the template for rending the 2FA provider view * - * @since 9.1.0 - * * @param IUser $user * @return Template */ public function getTemplate(IUser $user) { - try { - $this->totp->getSecret($user); - } catch (NoTotpSecretFoundException $ex) { - $qr = $this->totp->createSecret($user); - } - $tmpl = new Template('twofactor_totp', 'challenge'); $tmpl->assign('qr', $qr); return $tmpl; @@ -96,8 +78,6 @@ class TotpProvider implements IProvider { /** * Verify the given challenge * - * @since 9.1.0 - * * @param IUser $user * @param string $challenge */ @@ -108,13 +88,11 @@ class TotpProvider implements IProvider { /** * Decides whether 2FA is enabled for the given user * - * @since 9.1.0 - * * @param IUser $user * @return boolean */ public function isTwoFactorAuthEnabledForUser(IUser $user) { - return true; + return $this->totp->hasSecret($user); } } |