Minor code cleanup
This commit is contained in:
parent
1b10eb060a
commit
c83d6d7341
6 changed files with 6 additions and 6 deletions
|
@ -19,7 +19,7 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// available methods/providers
|
// available methods/providers. Supported methods are: 'totp','hotp','yubikey'
|
||||||
$config['kolab_2fa_drivers'] = array('totp','hotp');
|
$config['kolab_2fa_drivers'] = array('totp','hotp');
|
||||||
|
|
||||||
// backend for storing 2-factor-auth related per-user settings
|
// backend for storing 2-factor-auth related per-user settings
|
||||||
|
@ -40,12 +40,14 @@ $config['kolab_2fa_storage_config'] = array(
|
||||||
'uid' => 'uid',
|
'uid' => 'uid',
|
||||||
'mail' => 'mail',
|
'mail' => 'mail',
|
||||||
'totp' => 'kolabAuthTOTP',
|
'totp' => 'kolabAuthTOTP',
|
||||||
|
'hotp' => 'kolabAuthHOTP',
|
||||||
'yubikey' => 'kolabAuthYubikey',
|
'yubikey' => 'kolabAuthYubikey',
|
||||||
),
|
),
|
||||||
'debug' => true,
|
'debug' => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
// force a two-factor authentication for all users
|
// 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');
|
// $config['kolab_2fa_factors'] = array('totp');
|
||||||
|
|
||||||
// timeout for 2nd factor auth submission (in seconds)
|
// timeout for 2nd factor auth submission (in seconds)
|
||||||
|
|
|
@ -118,7 +118,7 @@ class kolab_2fa extends rcube_plugin
|
||||||
public function login_step($factors)
|
public function login_step($factors)
|
||||||
{
|
{
|
||||||
// replace handler for login form
|
// 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'));
|
$this->api->output->add_handler('loginform', array($this, 'auth_form'));
|
||||||
|
|
||||||
// focus the code input field on load
|
// focus the code input field on load
|
||||||
|
|
|
@ -212,7 +212,6 @@ abstract class Base
|
||||||
public function clear()
|
public function clear()
|
||||||
{
|
{
|
||||||
if ($this->storage) {
|
if ($this->storage) {
|
||||||
console('CLEAR prefs');
|
|
||||||
$this->storage->remove($this->username . ':' . $this->method);
|
$this->storage->remove($this->username . ':' . $this->method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ class HOTP extends Base
|
||||||
// store incremented counter value
|
// store incremented counter value
|
||||||
$this->set('counter', $this->backend->getCounter());
|
$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;
|
return $pass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
return $pass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ $labels['or'] = 'or';
|
||||||
$labels['yes'] = 'yes';
|
$labels['yes'] = 'yes';
|
||||||
$labels['now'] = 'no';
|
$labels['now'] = 'no';
|
||||||
|
|
||||||
|
|
||||||
$labels['qrcode'] = 'QR Code';
|
$labels['qrcode'] = 'QR Code';
|
||||||
$labels['showqrcode'] = 'Show QR Code';
|
$labels['showqrcode'] = 'Show QR Code';
|
||||||
$labels['qrcodeexplaintotp'] = 'Download an authenticator app on your phone. Two apps which work well are <strong>FreeOTP</strong> and <strong>Google Authenticator</strong>, but any other TOTP app should also work.<br/><br/>
|
$labels['qrcodeexplaintotp'] = 'Download an authenticator app on your phone. Two apps which work well are <strong>FreeOTP</strong> and <strong>Google Authenticator</strong>, but any other TOTP app should also work.<br/><br/>
|
||||||
|
|
Loading…
Add table
Reference in a new issue