WillyXJ / facileManager

A modular suite of web apps built with the sysadmin in mind.
www.facilemanager.com
GNU General Public License v2.0
85 stars 37 forks source link

[BUG] LDAP authentication with group is broken #533

Closed beza2000 closed 2 years ago

beza2000 commented 3 years ago

facileManager v4.0.3 fmDNS v4.1.0

In raising this issue, I confirm the following (please check boxes, eg [X]):


(BUG | ISSUE) Expected Behavior: Normal work

(BUG | ISSUE) Steps to reproduce: Now I work with facileManager v3.4 / fmDNS v3.3.1. I'm testing to move to facileManager v4.0.3 / fmDNS v4.1.0, but LDAP authentication with group don't work. I have log: ...... [21-Jul-2021 16:07:00 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function fm_login::checkGroupMembership(), 3 passed in /var/www/facileManager/server/fm-modules/facileManager/classes/class_logins.php on line 691 and exactly 4 expected in /var/www/facileManager/server/fm-modules/facileManager/classes/class_logins.php:679 Stack trace:

0 /var/www/facileManager/server/fm-modules/facileManager/classes/class_logins.php(691): fm_login->checkGroupMembership(Resource id #23, 'CN=nuxeo_test,O...', 'CN=IT Departmen...')

1 /var/www/facileManager/server/fm-modules/facileManager/classes/class_logins.php(561): fm_login->checkGroupMembership(Resource id #23, 'CN=user...', 'CN=IT Departmen...', 'memberof')

2 /var/www/facileManager/server/fm-modules/facileManager/classes/class_logins.php(322): fm_login->doLDAPAuth('user...', 'xxxxx*')

3 /var/www/facileManager/server/fm-init.php(132): fm_login->checkPassword('user...', 'xxxxxxx*')

4 /var/www/facileManager/server/index.php(38): require('/var/www/facile...') in /var/www/facileManager/server/fm-modules/facileManager/classes/class_logins.php on line 679

WillyXJ commented 2 years ago

It looks like it's line 691 of facileManager/classes/class_logins.php as it's missing a parameter. Please edit your file and change it to and report back:

                elseif ($this->checkGroupMembership($ldap_connect, $entries[0][$ldap_group_attribute][$i], $groupdn, $ldap_group_attribute)) return true;
beza2000 commented 2 years ago

It's working now.