From 89ba75f466e5b249027b8fde6539893a25aaba89 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Mon, 25 Sep 2017 13:13:11 +0200 Subject: [PATCH] Added ldap adv conf v2 --- pandora_console/include/auth/mysql.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index af054a9fe5..5fd79c7f8e 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -702,10 +702,15 @@ function ldap_process_user_login ($login, $password) { $correct = false; foreach ($ldap_adv_perms as $perm) { $groups = $perm['groups_ldap']; - $groups = "cn=" . implode(",cn=", $groups); + if ($groups[0] == '') { + $groups = ""; + } + else { + $groups = ",cn=" . str_replace(",", ",cn=", $groups[0]); + } if(!empty($ldap_base_dn)) { - if (strlen($password) != 0 && @ldap_bind($ds, $ldap_login_attr.io_safe_output($login).",".$groups.$ldap_base_dn, $password) ) { + if (strlen($password) != 0 && @ldap_bind($ds, $ldap_login_attr.io_safe_output($login).$groups.$ldap_base_dn, $password) ) { $correct = true; } }