rlidwka/sinopia-ldap — pull request #5 by tcort (2014-11-20 14:40:35+00:00)
Title: index.js: ensure memberOf is an array.

When ldap_user is only a member of 1 group, the memberOf attribute
is a string containing a dn (not an array if dn strings). The for-loop
is designed to work with an array of dn strings, so when a user
who is a member of just one group is encountered, the module crashes
because the for-loop is iterating over each character in the string.
This patch adds a check to see if memberOf is an Array. If it isn't
an array, it makes it an array.