Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on AuthLdap class #3544

Closed
cristos77 opened this issue Feb 13, 2018 · 0 comments
Closed

Bug on AuthLdap class #3544

cristos77 opened this issue Feb 13, 2018 · 0 comments
Labels
Milestone

Comments

@cristos77
Copy link

hello

i found a bug on the authldap class.
In getAllUsers function, a variable is not set correctly:

https://github.com/glpi-project/glpi/blob/9.2/bugfixes/inc/authldap.class.php#L1767-L1768

$userfound=false;
if (!empty($ldap_users[$user[$field_for_db]])
        || ($userfound = self::dnExistsInLdap($user_infos, $user['user_dn']))) {
   ....

the "userfound" variable can be not set if the first test is true. The second test is not checked, so the userfound variable stay at 'false'.

i suggest to set variable during declaration:


$userfound=self::dnExistsInLdap($user_infos, $user['user_dn']);
if (!empty($ldap_users[$user[$field_for_db]]) {
   ....

best regards
cristo

trasher added a commit to trasher/glpi that referenced this issue Feb 27, 2018
@trasher trasher added this to the 9.2.2 milestone Feb 27, 2018
@trasher trasher added the bug label Feb 27, 2018
trasher added a commit to trasher/glpi that referenced this issue Feb 27, 2018
trasher added a commit that referenced this issue Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants