X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FStore%2FLDAP%2FBackend.pm;h=bd7bae05305761d904fcd72ae8549cb38ea3c8a0;hb=e8af16df6acc4ead2efaa53c20f5b289f037c476;hp=59f029987e140eda57c1c4fd31d471ef01ecd6c0;hpb=e5e1d261e90dcc1f0e6a055185816c2f1b7735cd;p=catagits%2FCatalyst-Authentication-Store-LDAP.git diff --git a/lib/Catalyst/Authentication/Store/LDAP/Backend.pm b/lib/Catalyst/Authentication/Store/LDAP/Backend.pm index 59f0299..bd7bae0 100644 --- a/lib/Catalyst/Authentication/Store/LDAP/Backend.pm +++ b/lib/Catalyst/Authentication/Store/LDAP/Backend.pm @@ -79,6 +79,7 @@ our $VERSION = '1.015'; use Catalyst::Authentication::Store::LDAP::User; use Net::LDAP; use Catalyst::Utils (); +use Catalyst::Exception; BEGIN { __PACKAGE__->mk_accessors( @@ -120,7 +121,8 @@ sub new { $config_hash{'role_filter'} ||= '(memberUid=%s)'; $config_hash{'role_scope'} ||= 'sub'; $config_hash{'role_field'} ||= 'cn'; - $config_hash{'use_roles'} ||= '1'; + $config_hash{'use_roles'} = '1' + unless exists $config_hash{use_roles}; $config_hash{'start_tls'} ||= '0'; $config_hash{'entry_class'} ||= 'Catalyst::Model::LDAP::Entry'; $config_hash{'user_class'} @@ -390,7 +392,7 @@ objects that match it's criteria. sub lookup_roles { my ( $self, $userobj, $ldap ) = @_; if ( $self->use_roles == 0 || $self->use_roles =~ /^false$/i ) { - return undef; + return (); } $ldap ||= $self->role_search_as_user ? $userobj->ldap_connection : $self->ldap_bind;