X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FStore%2FLDAP%2FUser.pm;h=69d2c33e79263780ba084467b4141936ec7154cd;hb=baf99620bce87348b86c56eb46edef9395eb7ebe;hp=527ee477513c1f5009fc11769d97827b7e0b92a6;hpb=57e643d28afe2c8479ba2591327231003d8c4687;p=catagits%2FCatalyst-Authentication-Store-LDAP.git diff --git a/lib/Catalyst/Authentication/Store/LDAP/User.pm b/lib/Catalyst/Authentication/Store/LDAP/User.pm index 527ee47..69d2c33 100644 --- a/lib/Catalyst/Authentication/Store/LDAP/User.pm +++ b/lib/Catalyst/Authentication/Store/LDAP/User.pm @@ -49,7 +49,7 @@ use base qw( Catalyst::Authentication::User Class::Accessor::Fast ); use strict; use warnings; -our $VERSION = '0.1004'; +our $VERSION = '0.1005'; BEGIN { __PACKAGE__->mk_accessors(qw/user store _ldap_connection/) } @@ -57,18 +57,20 @@ use overload '""' => sub { shift->stringify }, fallback => 1; =head1 METHODS -=head2 new($store, $user) +=head2 new($store, $user, $c) Takes a L object as $store, and the data structure returned by that class's "get_user" -method as $user. +method as $user. The final argument is an instance of your application, +which is passed along for those wanting to subclass User and perhaps use +models for fetching data. Returns a L object. =cut sub new { - my ( $class, $store, $user ) = @_; + my ( $class, $store, $user, $c ) = @_; return unless $user; @@ -145,7 +147,9 @@ sub check_password { $self->roles($ldap); } # Stash a closure which can be used to retrieve the connection in the users context later. - $self->_ldap_connection( sub { $self->store->ldap_bind( undef, $self->ldap_entry->dn, $password ) } ); + $self->_ldap_connection( sub { + $self->store->ldap_bind( undef, $self->ldap_entry->dn, $password ) + }); return 1; } else {