<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3354" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=321125423-09072008><FONT face=Arial size=2>I ran across an 
issue around calling $c-&gt;user-&gt;roles using the LDAP auth store. Basically 
it would only return 1 role instead of the 30 or so I'm a member of. After 
digging around I created this patch for it. I haven't taken a poke at the 
Net::LDAP code yet, but I suspect the get_value method does a want_array. Once I 
changed it, it works fine now.</FONT></SPAN></DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial size=2>Please let me know 
if it's not right or I'm not using the module correctly...or any pointers for 
that matter ;)</FONT></SPAN></DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial size=2>BEGIN 
PATCH</FONT></SPAN></DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial 
size=2>==================================================</FONT></SPAN></DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial size=2>--- Backend.pm&nbsp; 
2008-07-09 19:46:07.000000000 -0400<BR>+++ 
Backend.pm.fix&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2008-07-09 19:49:55.000000000 
-0400<BR>@@ -395,14 +395,8 @@<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp; my $rolesearch = 
$ldap-&gt;search(@searchopts);<BR>&nbsp;&nbsp;&nbsp;&nbsp; my 
@roles;<BR>-RESULT: while ( my $entry = $rolesearch-&gt;pop_entry ) 
{<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my ($role) = 
$entry-&gt;get_value( $self-&gt;role_field 
);<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($role) 
{<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push( 
@roles, $role );<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else 
{<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; next 
RESULT;<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>+&nbsp;&nbsp;&nbsp; 
foreach my $entry ( $rolesearch-&gt;entries ) 
{<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; push(@roles, 
$entry-&gt;get_value( $self-&gt;role_field ));<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp; return 
@roles;<BR>&nbsp;}<BR>===============================================</FONT></SPAN></DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial size=2>END 
PATCH</FONT></SPAN></DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial size=2>My 
CONF:</FONT></SPAN></DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial 
size=2>===========================================</FONT></SPAN></DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial 
size=2>authentication:<BR>&nbsp; default_realm: ldap<BR>&nbsp; 
realms:<BR>&nbsp;&nbsp;&nbsp; ldap:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
credential:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class: 
Password<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; password_field: 
password<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; password_type:&nbsp; 
self_check<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
store:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class: 
LDAP<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ldap_server: 
ldap.mydomain.com<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ldap_server_options:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
timeout: 30<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; binddn: 
anonymous<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
bindpw:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start_tls: 
0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
start_tls_options:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
verify: none<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user_basedn: 
ou=active,ou=employees, ou=people, 
o=mydomain.com<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user_filter: 
(uid=%s)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user_scope: 
sub<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user_field: 
uid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
user_search_options:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
deref: always<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; use_roles: 
1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role_basedn: 
ou=active,ou=employees, ou=people, 
o=mydomain.com<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role_filter: 
(uid=%s)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role_scope: 
sub<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role_field: 
groupmembership<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role_value: 
uid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
role_search_options:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
deref: always<BR></DIV></FONT></SPAN></BODY></HTML>