From: Peter Karman Date: Thu, 10 Jul 2008 21:20:54 +0000 (+0000) Subject: get entries in array context rather than scalar context, allowing for multiple values... X-Git-Tag: v0.1003~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ab62b426562470d4ffc97953ad15a3f5fca88008;p=catagits%2FCatalyst-Authentication-Store-LDAP.git get entries in array context rather than scalar context, allowing for multiple values. patch by scpham. --- diff --git a/Changes b/Changes index a0fe243..d7cdb60 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +0.1003 xxxx + - get entries in array context rather than scalar context, + allowing for multiple values. patch by scpham. + + 0.1002 9 July 2008 - tests updated to use Net::LDAP::Server::Test 0.03 diff --git a/lib/Catalyst/Authentication/Store/LDAP/Backend.pm b/lib/Catalyst/Authentication/Store/LDAP/Backend.pm index cef2d35..b897704 100644 --- a/lib/Catalyst/Authentication/Store/LDAP/Backend.pm +++ b/lib/Catalyst/Authentication/Store/LDAP/Backend.pm @@ -395,14 +395,8 @@ sub lookup_roles { } my $rolesearch = $ldap->search(@searchopts); my @roles; -RESULT: while ( my $entry = $rolesearch->pop_entry ) { - my ($role) = $entry->get_value( $self->role_field ); - if ($role) { - push( @roles, $role ); - } - else { - next RESULT; - } +RESULT: foreach my $entry ( $rolesearch->entries ) { + push( @roles, $entry->get_value( $self->role_field ) ); } return @roles; }