diff --git a/plugins/kolab_2fa/config.inc.php.dist b/plugins/kolab_2fa/config.inc.php.dist index 2b02b866..7349421b 100644 --- a/plugins/kolab_2fa/config.inc.php.dist +++ b/plugins/kolab_2fa/config.inc.php.dist @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -// available methods/providers +// available methods/providers. Supported methods are: 'totp','hotp','yubikey' $config['kolab_2fa_drivers'] = array('totp','hotp'); // backend for storing 2-factor-auth related per-user settings @@ -40,12 +40,14 @@ $config['kolab_2fa_storage_config'] = array( 'uid' => 'uid', 'mail' => 'mail', 'totp' => 'kolabAuthTOTP', + 'hotp' => 'kolabAuthHOTP', 'yubikey' => 'kolabAuthYubikey', ), 'debug' => true, ); // force a two-factor authentication for all users +// to be set by another plugin (e.g. kolab_auth based on LDAP roles) // $config['kolab_2fa_factors'] = array('totp'); // timeout for 2nd factor auth submission (in seconds) diff --git a/plugins/kolab_2fa/kolab_2fa.php b/plugins/kolab_2fa/kolab_2fa.php index 1d6035c8..a04f26f1 100644 --- a/plugins/kolab_2fa/kolab_2fa.php +++ b/plugins/kolab_2fa/kolab_2fa.php @@ -118,7 +118,7 @@ class kolab_2fa extends rcube_plugin public function login_step($factors) { // replace handler for login form - $this->login_factors = $factors; + $this->login_factors = array_values($factors); $this->api->output->add_handler('loginform', array($this, 'auth_form')); // focus the code input field on load diff --git a/plugins/kolab_2fa/lib/Kolab2FA/Driver/Base.php b/plugins/kolab_2fa/lib/Kolab2FA/Driver/Base.php index f9df7921..2acd19da 100644 --- a/plugins/kolab_2fa/lib/Kolab2FA/Driver/Base.php +++ b/plugins/kolab_2fa/lib/Kolab2FA/Driver/Base.php @@ -212,7 +212,6 @@ abstract class Base public function clear() { if ($this->storage) { - console('CLEAR prefs'); $this->storage->remove($this->username . ':' . $this->method); } } diff --git a/plugins/kolab_2fa/lib/Kolab2FA/Driver/HOTP.php b/plugins/kolab_2fa/lib/Kolab2FA/Driver/HOTP.php index 01daf713..b7805fe4 100644 --- a/plugins/kolab_2fa/lib/Kolab2FA/Driver/HOTP.php +++ b/plugins/kolab_2fa/lib/Kolab2FA/Driver/HOTP.php @@ -98,7 +98,7 @@ class HOTP extends Base // store incremented counter value $this->set('counter', $this->backend->getCounter()); - console('VERIFY HOTP', $this->username, $secret, $counter, $code, $pass); + // console('VERIFY HOTP', $this->username, $secret, $counter, $code, $pass); return $pass; } diff --git a/plugins/kolab_2fa/lib/Kolab2FA/Driver/TOTP.php b/plugins/kolab_2fa/lib/Kolab2FA/Driver/TOTP.php index 9ba3e357..d4270326 100644 --- a/plugins/kolab_2fa/lib/Kolab2FA/Driver/TOTP.php +++ b/plugins/kolab_2fa/lib/Kolab2FA/Driver/TOTP.php @@ -98,7 +98,7 @@ class TOTP extends Base } } - console('VERIFY TOTP', $this->username, $secret, $code, $timestamp, $pass); + // console('VERIFY TOTP', $this->username, $secret, $code, $timestamp, $pass); return $pass; } diff --git a/plugins/kolab_2fa/localization/en_US.inc b/plugins/kolab_2fa/localization/en_US.inc index 6526199e..81dea1eb 100644 --- a/plugins/kolab_2fa/localization/en_US.inc +++ b/plugins/kolab_2fa/localization/en_US.inc @@ -25,7 +25,6 @@ $labels['or'] = 'or'; $labels['yes'] = 'yes'; $labels['now'] = 'no'; - $labels['qrcode'] = 'QR Code'; $labels['showqrcode'] = 'Show QR Code'; $labels['qrcodeexplaintotp'] = 'Download an authenticator app on your phone. Two apps which work well are FreeOTP and Google Authenticator, but any other TOTP app should also work.