fixed visual error setup autentication ticket: 4152
(cherry picked from commit 46e70e038d
)
This commit is contained in:
parent
04f9f8e176
commit
b78d417410
|
@ -81,6 +81,21 @@ $row['control'] .= __('No').' '.html_print_radio_button_extended('autocreat
|
||||||
$table->data['autocreate_remote_users'] = $row;
|
$table->data['autocreate_remote_users'] = $row;
|
||||||
$remote_rows[] = 'autocreate_remote_users';
|
$remote_rows[] = 'autocreate_remote_users';
|
||||||
|
|
||||||
|
// Autocreate blacklist
|
||||||
|
$row = array();
|
||||||
|
$row['name'] = __('Autocreate blacklist') . ui_print_help_icon ('autocreate_blacklist', true);
|
||||||
|
$row['control'] = html_print_input_text('autocreate_blacklist', $config['autocreate_blacklist'], '', 60, 100, true);
|
||||||
|
$table->data['autocreate_blacklist'] = $row;
|
||||||
|
$remote_rows[] = 'autocreate_blacklist';
|
||||||
|
$autocreate_rows[] = 'autocreate_blacklist';
|
||||||
|
|
||||||
|
// Add enterprise authentication options
|
||||||
|
if (enterprise_installed()) {
|
||||||
|
$enterprise_auth_options_added = add_enterprise_auth_options($table);
|
||||||
|
|
||||||
|
array_merge($auth_methods_added, $enterprise_auth_options_added);
|
||||||
|
}
|
||||||
|
|
||||||
// Autocreate profile
|
// Autocreate profile
|
||||||
$profile_list = profile_get_profiles ();
|
$profile_list = profile_get_profiles ();
|
||||||
if ($profile_list === false) {
|
if ($profile_list === false) {
|
||||||
|
@ -121,14 +136,6 @@ else {
|
||||||
$remote_rows[] = 'default_assign_tags';
|
$remote_rows[] = 'default_assign_tags';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Autocreate blacklist
|
|
||||||
$row = array();
|
|
||||||
$row['name'] = __('Autocreate blacklist') . ui_print_help_icon ('autocreate_blacklist', true);
|
|
||||||
$row['control'] = html_print_input_text('autocreate_blacklist', $config['autocreate_blacklist'], '', 60, 100, true);
|
|
||||||
$table->data['autocreate_blacklist'] = $row;
|
|
||||||
$remote_rows[] = 'autocreate_blacklist';
|
|
||||||
$autocreate_rows[] = 'autocreate_blacklist';
|
|
||||||
|
|
||||||
// Add the remote class to the remote rows
|
// Add the remote class to the remote rows
|
||||||
foreach ($remote_rows as $name) {
|
foreach ($remote_rows as $name) {
|
||||||
if (!isset($table->rowclass[$name]))
|
if (!isset($table->rowclass[$name]))
|
||||||
|
@ -205,12 +212,7 @@ foreach ($ldap_rows as $name) {
|
||||||
|
|
||||||
$auth_methods_added[] = 'ldap';
|
$auth_methods_added[] = 'ldap';
|
||||||
|
|
||||||
// Add enterprise authentication options
|
|
||||||
if (enterprise_installed()) {
|
|
||||||
$enterprise_auth_options_added = add_enterprise_auth_options($table);
|
|
||||||
|
|
||||||
array_merge($auth_methods_added, $enterprise_auth_options_added);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enable double authentication
|
// Enable double authentication
|
||||||
// Set default value
|
// Set default value
|
||||||
|
@ -258,7 +260,6 @@ echo '</form>';
|
||||||
var auth_methods = $.map($('select#auth option'), function(option) {
|
var auth_methods = $.map($('select#auth option'), function(option) {
|
||||||
return option.value;
|
return option.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add the click event and perform it once
|
// Add the click event and perform it once
|
||||||
// for process the action on the section load
|
// for process the action on the section load
|
||||||
$('input[name="autocreate_remote_users"]').change(show_autocreate_options).change();
|
$('input[name="autocreate_remote_users"]').change(show_autocreate_options).change();
|
||||||
|
@ -270,7 +271,6 @@ echo '</form>';
|
||||||
// Event callback for the auth select
|
// Event callback for the auth select
|
||||||
function show_selected_rows (event) {
|
function show_selected_rows (event) {
|
||||||
var auth_method = $(this).val();
|
var auth_method = $(this).val();
|
||||||
|
|
||||||
if (auth_method !== 'mysql') {
|
if (auth_method !== 'mysql') {
|
||||||
$('tr.remote').show();
|
$('tr.remote').show();
|
||||||
if (auth_method == 'saml') {
|
if (auth_method == 'saml') {
|
||||||
|
@ -280,6 +280,7 @@ echo '</form>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('tr.remote').hide();
|
$('tr.remote').hide();
|
||||||
|
$('tr.autocreate').hide();
|
||||||
}
|
}
|
||||||
// Hide all the auth methods (except mysql)
|
// Hide all the auth methods (except mysql)
|
||||||
_.each(auth_methods, function(value, key) {
|
_.each(auth_methods, function(value, key) {
|
||||||
|
@ -293,10 +294,12 @@ echo '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event callback for the autocreate remote users radio buttons
|
// Event callback for the autocreate remote users radio buttons
|
||||||
function show_autocreate_options (event) {
|
function show_autocreate_options(event) {
|
||||||
var remote_auto = $('input:radio[name=autocreate_remote_users]:checked').val();
|
var remote_auto = $('input:radio[name=autocreate_remote_users]:checked').val();
|
||||||
|
var authentication_method_value = $('#auth').val();
|
||||||
var disabled = false;
|
var disabled = false;
|
||||||
|
if (authentication_method_value != 'ad')
|
||||||
|
disabled = true;
|
||||||
if (remote_auto == 0)
|
if (remote_auto == 0)
|
||||||
disabled = true;
|
disabled = true;
|
||||||
|
|
||||||
|
@ -304,7 +307,6 @@ echo '</form>';
|
||||||
$('select#default_remote_group').prop('disabled', disabled);
|
$('select#default_remote_group').prop('disabled', disabled);
|
||||||
$('select#default_assign_tags').prop('disabled', disabled);
|
$('select#default_assign_tags').prop('disabled', disabled);
|
||||||
$('input#text-autocreate_blacklist').prop('disabled', disabled);
|
$('input#text-autocreate_blacklist').prop('disabled', disabled);
|
||||||
|
|
||||||
// Show when disabled = false and hide when disabled = true
|
// Show when disabled = false and hide when disabled = true
|
||||||
if (disabled)
|
if (disabled)
|
||||||
$('tr.autocreate').hide();
|
$('tr.autocreate').hide();
|
||||||
|
@ -323,6 +325,8 @@ echo '</form>';
|
||||||
else {
|
else {
|
||||||
if (advanced_value == 0) {
|
if (advanced_value == 0) {
|
||||||
$('tr.no_autocreate').show();
|
$('tr.no_autocreate').show();
|
||||||
|
$('#table4-ad_adv_perms').removeClass("ad");
|
||||||
|
$('#table4-ad_adv_perms2').removeClass("ad");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue