Require 2nd factor verification for adding an new factor
This commit is contained in:
parent
3e52521c3e
commit
f19f3f06c1
2 changed files with 14 additions and 16 deletions
|
@ -56,17 +56,6 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
});
|
});
|
||||||
|
|
||||||
table.parent()[(rows > 0 ? 'show' : 'hide')]();
|
table.parent()[(rows > 0 ? 'show' : 'hide')]();
|
||||||
/*
|
|
||||||
var remaining = 0;
|
|
||||||
$('#kolab2fa-add option').each(function(i, elem) {
|
|
||||||
var method = elem.value;
|
|
||||||
$(elem).prop('disabled', active[method]);
|
|
||||||
if (!active[method]) {
|
|
||||||
remaining++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$('#kolab2fa-add').prop('disabled', !remaining).get(0).selectedIndex = 0;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -206,7 +195,9 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
if (method) {
|
if (method) {
|
||||||
highsec_call_stack.push(func);
|
highsec_call_stack.push(func);
|
||||||
|
|
||||||
|
// TODO: list all active factors to choose from
|
||||||
var html = String($('#kolab2fa-highsecuritydialog').html()).replace('$name', name);
|
var html = String($('#kolab2fa-highsecuritydialog').html()).replace('$name', name);
|
||||||
|
|
||||||
highsec_dialog = rcmail.show_popup_dialog(
|
highsec_dialog = rcmail.show_popup_dialog(
|
||||||
html,
|
html,
|
||||||
rcmail.get_label('highsecurityrequired', 'kolab_2fa'),
|
rcmail.get_label('highsecurityrequired', 'kolab_2fa'),
|
||||||
|
@ -339,8 +330,11 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
$('#kolab2fa-add').change(function() {
|
$('#kolab2fa-add').change(function() {
|
||||||
var method = $('option:selected', this).val();
|
var method = $('option:selected', this).val();
|
||||||
|
|
||||||
// require high security?
|
// require auth verification
|
||||||
add_factor(method);
|
require_high_security(function() {
|
||||||
|
add_factor(method);
|
||||||
|
});
|
||||||
|
|
||||||
this.selectedIndex = 0;
|
this.selectedIndex = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -621,10 +621,14 @@ class kolab_2fa extends rcube_plugin
|
||||||
$driver->set('active', true);
|
$driver->set('active', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update list of active factors for this user
|
// commit changes to the user properties
|
||||||
if (!$errors) {
|
if (!$errors) {
|
||||||
$success = $driver->commit();
|
if ($success = $driver->commit()) {
|
||||||
$save_data = $data !== false ? $this->format_props($driver->props()) : array();
|
$save_data = $data !== false ? $this->format_props($driver->props()) : array();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$errors++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue