<!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->user->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> </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> </DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial
size=2></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>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
2008-07-09 19:46:07.000000000 -0400<BR>+++
Backend.pm.fix 2008-07-09 19:49:55.000000000
-0400<BR>@@ -395,14 +395,8 @@<BR>
}<BR> my $rolesearch =
$ldap->search(@searchopts);<BR> my
@roles;<BR>-RESULT: while ( my $entry = $rolesearch->pop_entry )
{<BR>- my ($role) =
$entry->get_value( $self->role_field
);<BR>- if ($role)
{<BR>- push(
@roles, $role );<BR>-
}<BR>- else
{<BR>- next
RESULT;<BR>- }<BR>+
foreach my $entry ( $rolesearch->entries )
{<BR>+ push(@roles,
$entry->get_value( $self->role_field ));<BR>
}<BR> return
@roles;<BR> }<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> </DIV>
<DIV><SPAN class=321125423-09072008><FONT face=Arial
size=2></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>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> default_realm: ldap<BR>
realms:<BR> ldap:<BR>
credential:<BR> class:
Password<BR> password_field:
password<BR> password_type:
self_check<BR>
store:<BR> class:
LDAP<BR> ldap_server:
ldap.mydomain.com<BR>
ldap_server_options:<BR>
timeout: 30<BR> binddn:
anonymous<BR>
bindpw:<BR> start_tls:
0<BR>
start_tls_options:<BR>
verify: none<BR> user_basedn:
ou=active,ou=employees, ou=people,
o=mydomain.com<BR> user_filter:
(uid=%s)<BR> user_scope:
sub<BR> user_field:
uid<BR>
user_search_options:<BR>
deref: always<BR> use_roles:
1<BR> role_basedn:
ou=active,ou=employees, ou=people,
o=mydomain.com<BR> role_filter:
(uid=%s)<BR> role_scope:
sub<BR> role_field:
groupmembership<BR> role_value:
uid<BR>
role_search_options:<BR>
deref: always<BR></DIV></FONT></SPAN></BODY></HTML>