Commit ae5149e9 authored by Johan Cwiklinski's avatar Johan Cwiklinski

Fix loop on ldap groups; fixes #3841 and refs #3780

parent 17fb8efc
......@@ -1355,7 +1355,7 @@ class User extends CommonDBTM {
$sr = @ ldap_read($ldap_connection, $userdn, "objectClass=*", $group_fields);
$v = AuthLDAP::get_entries_clean($ldap_connection, $sr);
for ($i=0; $i<count($v['count']); $i++) {
for ($i=0; $i < $v['count']; $i++) {
//Try to find is DN in present and needed: if yes, then extract only the OU from it
if ((($ldap_method["group_field"] == 'dn') || in_array('ou', $group_fields))
&& isset($v[$i]['dn'])) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment