LDAP role assignment failing due to arrayed attribute with count = 0

Issue #406 resolved
Former user created an issue

We're using Piler 1.1.0 build 884 on CentOS 6.5 x64 with PHP 5.3.3 and Apache httpd 2.2.15. We are authenticating against OpenLDAP 2.4.23 using an rfc2307bis schema. We were having an issue with assigning the auditor or admin role to a user. They were successfully authenticating, and their group membership was being found by the ldap search, but the role wasn't being assigned. The trouble ended up being in the check_ldap_membership function in model/user/auth.php. The $memberattr had a count of zero, causing the if condition to succeed but the for loop to never enter. Modifying the line:

if(isset($a[$memberattr]['count'])) {

to be

if(isset($a[$memberattr]['count']) && $a[$memberattr]['count'] > 0) {

resolved our issue.

Comments (1)

  1. Log in to comment