get entries in array context rather than scalar context, allowing for multiple values...
Peter Karman [Thu, 10 Jul 2008 21:20:54 +0000 (21:20 +0000)]
Changes
lib/Catalyst/Authentication/Store/LDAP/Backend.pm

diff --git a/Changes b/Changes
index a0fe243..d7cdb60 100644 (file)
--- 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
 
index cef2d35..b897704 100644 (file)
@@ -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;
 }