Merge branch '3222-Deshabilitar-doble-autenticacion-si-no-esta-activada' into 'develop'

disable double authentication option on user edit when disabled in authentication setup

See merge request artica/pandorafms!2054

Former-commit-id: b60f3ec06935ad6b6e456e556c9a281539e42e19
This commit is contained in:
Alejandro Fraguas 2019-02-20 09:56:49 +01:00
commit 094a5c17d8
2 changed files with 9 additions and 5 deletions

View File

@ -134,7 +134,8 @@ if (is_ajax()) {
set_unless_defined($config['double_auth_enabled'], false);
$row = [];
$row['name'] = __('Double authentication').ui_print_help_tip(__('If this option is enabled, the users can use double authentication with their accounts'), true);
$row['control'] = html_print_checkbox_toogle_switch('double_auth_enabled', 1, $config['double_auth_enabled'], true);
$row['control'] = html_print_input_hidden('double_auth_enabled', 0);
$row['control'] .= html_print_checkbox_toogle_switch('double_auth_enabled', 1, $config['double_auth_enabled'], true);
$table->data['double_auth_enabled'] = $row;
// Session timeout

View File

@ -390,10 +390,13 @@ $table->data[] = $data;
// Double auth
$double_auth_enabled = (bool) db_get_value('id', 'tuser_double_auth', 'id_user', $config['id_user']);
$data = [];
$data[0] = '<span style="width:50%;float:left;">'.__('Double authentication').'</span>';
$data[0] .= $jump;
$data[0] .= '<span style="width:20%;float:left;line-height:20px;">'.html_print_checkbox('double_auth', 1, $double_auth_enabled, true).'</span>';
$data = array();
if ($config['double_auth_enabled']) {
$data[0] = '<span style="width:50%;float:left;">'.__('Double authentication').'</span>';
$data[0] .= $jump;
$data[0] .= '<span style="width:20%;float:left;line-height:20px;">'.html_print_checkbox('double_auth', 1, $double_auth_enabled, true).'</span>';
}
if ($double_auth_enabled) {
$data[0] .= $jump;
$data[0] .= html_print_button(__('Show information'), 'show_info', false, 'javascript:show_double_auth_info();', '', true);