mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-09 19:18:22 +01:00
FIX: ldap group search test: bad key used + edit label/comments + remove useless code
This commit is contained in:
@@ -278,10 +278,6 @@ if (function_exists("ldap_connect")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'testsearchgroup') {
|
if ($action == 'testsearchgroup') {
|
||||||
// Creation objet
|
|
||||||
$object = new UserGroup($db);
|
|
||||||
$object->initAsSpecimen();
|
|
||||||
|
|
||||||
// TODO Mutualize code following with other ldap_xxxx.php pages
|
// TODO Mutualize code following with other ldap_xxxx.php pages
|
||||||
|
|
||||||
// Test synchro
|
// Test synchro
|
||||||
@@ -301,13 +297,13 @@ if (function_exists("ldap_connect")) {
|
|||||||
$required_fields = array_unique(array_values(array_filter($required_fields, "dol_validElement")));
|
$required_fields = array_unique(array_values(array_filter($required_fields, "dol_validElement")));
|
||||||
|
|
||||||
// Get from LDAP database an array of results
|
// Get from LDAP database an array of results
|
||||||
$ldapgroups = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_USERS, $required_fields, 'group');
|
$ldapgroups = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_GROUPS, $required_fields, 'group');
|
||||||
//$ldapgroups = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_USERS, '', 'group');
|
//$ldapgroups = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_GROUPS, '', 'group');
|
||||||
|
|
||||||
if (is_array($ldapgroups)) {
|
if (is_array($ldapgroups)) {
|
||||||
$liste = array();
|
$liste = array();
|
||||||
foreach ($ldapgroups as $key => $ldapgroup) {
|
foreach ($ldapgroups as $key => $ldapgroup) {
|
||||||
// Define the label string for this user
|
// Define the label string for this group
|
||||||
$label = '';
|
$label = '';
|
||||||
foreach ($required_fields as $value) {
|
foreach ($required_fields as $value) {
|
||||||
if ($value) {
|
if ($value) {
|
||||||
@@ -321,7 +317,7 @@ if (function_exists("ldap_connect")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "LDAP search for user:<br>\n";
|
print "LDAP search for group:<br>\n";
|
||||||
print "search: *<br>\n";
|
print "search: *<br>\n";
|
||||||
print "userDN: ".$conf->global->LDAP_GROUP_DN."<br>\n";
|
print "userDN: ".$conf->global->LDAP_GROUP_DN."<br>\n";
|
||||||
print "useridentifier: ".$conf->global->LDAP_KEY_GROUPS."<br>\n";
|
print "useridentifier: ".$conf->global->LDAP_KEY_GROUPS."<br>\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user