Skip to content

Commit

Permalink
Fix for issue nilsteampassnet#1539 verifying LDAP groups properly
Browse files Browse the repository at this point in the history
The user was able to log in using LDAP even if he was not in the required group.
  • Loading branch information
filo891 committed Apr 27, 2017
1 parent 68ace1b commit 3909749
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sources/identify.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ function identifyUser($sentData)
if (!ldap_count_entries($ldapconn, $result_group)) {
$ldapConnection = false;
}
else {
$ldapConnection = true;
}
}
if ($debugLdap == 1) {
fputs(
Expand All @@ -382,7 +385,7 @@ function identifyUser($sentData)
'Results : ' . print_r(ldap_get_entries($ldapconn, $result), true) . "\n"
);
}
if (ldap_count_entries($ldapconn, $result)) {
if ($ldapConnection && ldap_count_entries($ldapconn, $result)) {
// try auth
$result = ldap_get_entries($ldapconn, $result);
$user_dn = $result[0]['dn'];
Expand Down

0 comments on commit 3909749

Please sign in to comment.