mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-25 23:05:30 +02:00
Merge branch 'ent-10254-15114-anadir-timeout-y-secondary-server-a-ad' into 'develop'
Ent 10254 [#15114]Añadir timeout y secondary server a AD See merge request artica/pandorafms!6091
This commit is contained in:
commit
06d3664b2f
@ -210,7 +210,7 @@ if (is_ajax() === true) {
|
|||||||
|
|
||||||
// Ldapsearch timeout.
|
// Ldapsearch timeout.
|
||||||
// Default Ldapsearch timeout.
|
// Default Ldapsearch timeout.
|
||||||
set_when_empty($config['ldap_searh_timeout'], 5);
|
set_when_empty($config['ldap_search_timeout'], 5);
|
||||||
$row = [];
|
$row = [];
|
||||||
$row['name'] = __('Ldap search timeout (secs)');
|
$row['name'] = __('Ldap search timeout (secs)');
|
||||||
$row['control'] = html_print_input_text(
|
$row['control'] = html_print_input_text(
|
||||||
@ -558,7 +558,13 @@ echo '</form>';
|
|||||||
if ($('input[type=checkbox][name=secondary_ldap_enabled]:checked').val() == 1) {
|
if ($('input[type=checkbox][name=secondary_ldap_enabled]:checked').val() == 1) {
|
||||||
$("tr[id*='ldap_'][id$='_secondary']").show();
|
$("tr[id*='ldap_'][id$='_secondary']").show();
|
||||||
} else {
|
} else {
|
||||||
$( "tr[id*='ldap_'][id$='_secondary']" ).hide();
|
$( "tr[id*='ldap_'][id$='_secondary']" ).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('input[type=checkbox][name=secondary_active_directory]:checked').val() == 1) {
|
||||||
|
$("tr[id*='ad_'][id$='_secondary']").show();
|
||||||
|
} else {
|
||||||
|
$( "tr[id*='ad_'][id$='_secondary']" ).hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
|
@ -237,8 +237,13 @@ function process_user_login_remote($login, $pass, $api=false)
|
|||||||
|
|
||||||
// Active Directory.
|
// Active Directory.
|
||||||
case 'ad':
|
case 'ad':
|
||||||
if (enterprise_hook('ad_process_user_login', [$login, $pass]) === false) {
|
$sr = enterprise_hook('ad_process_user_login', [$login, $pass]);
|
||||||
$config['auth_error'] = 'User not found in database or incorrect password';
|
// Try with secondary server.
|
||||||
|
if ($sr === false && (bool) $config['secondary_active_directory'] === true) {
|
||||||
|
$sr = enterprise_hook('ad_process_user_login', [$login, $pass, true]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($sr === false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -627,6 +627,30 @@ function config_update_config()
|
|||||||
$error_update[] = __('Domain');
|
$error_update[] = __('Domain');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config_update_value('secondary_active_directory', get_parameter('secondary_active_directory'), true) === false) {
|
||||||
|
$error_update[] = __('Secondary active directory');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config_update_value('ad_server_secondary', get_parameter('ad_server_secondary'), true) === false) {
|
||||||
|
$error_update[] = __('Secondary active directory server');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config_update_value('ad_port_secondary', get_parameter('ad_port_secondary'), true) === false) {
|
||||||
|
$error_update[] = __('Secondary active directory port');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config_update_value('ad_start_tls_secondary', get_parameter('ad_start_tls_secondary'), true) === false) {
|
||||||
|
$error_update[] = __('Secondary start TLS');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config_update_value('ad_search_timeout', get_parameter('ad_search_timeout'), true) === false) {
|
||||||
|
$error_update[] = __('AD search timeout');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config_update_value('ad_domain_secondary', get_parameter('ad_domain_secondary'), true) === false) {
|
||||||
|
$error_update[] = __('Secondary domain');
|
||||||
|
}
|
||||||
|
|
||||||
if (config_update_value('ad_adv_perms', get_parameter('ad_adv_perms'), true) === false) {
|
if (config_update_value('ad_adv_perms', get_parameter('ad_adv_perms'), true) === false) {
|
||||||
$error_update[] = __('Advanced Permisions AD');
|
$error_update[] = __('Advanced Permisions AD');
|
||||||
}
|
}
|
||||||
@ -3100,6 +3124,14 @@ function config_process_config()
|
|||||||
config_update_value('ad_port', 389);
|
config_update_value('ad_port', 389);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($config['ad_server_secondary'])) {
|
||||||
|
config_update_value('ad_server_secondary', 'localhost');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($config['ad_port_secondary'])) {
|
||||||
|
config_update_value('ad_port_secondary', 389);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($config['ad_start_tls'])) {
|
if (!isset($config['ad_start_tls'])) {
|
||||||
config_update_value('ad_start_tls', 0);
|
config_update_value('ad_start_tls', 0);
|
||||||
}
|
}
|
||||||
|
@ -712,7 +712,6 @@ if (isset($config['id_user']) === false) {
|
|||||||
login_check_failed($nick);
|
login_check_failed($nick);
|
||||||
}
|
}
|
||||||
|
|
||||||
$config['auth_error'] = __('User is blocked');
|
|
||||||
$login_failed = true;
|
$login_failed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user