bump version, add basic test
[catagits/Catalyst-Authentication-Store-LDAP.git] / lib / Catalyst / Authentication / Store / LDAP / User.pm
index 9f82980..d63c765 100644 (file)
@@ -49,7 +49,7 @@ use base qw( Catalyst::Authentication::User Class::Accessor::Fast );
 use strict;
 use warnings;
 
-our $VERSION = '0.1004';
+our $VERSION = '1.006';
 
 BEGIN { __PACKAGE__->mk_accessors(qw/user store _ldap_connection_password/) }
 
@@ -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<Catalyst::Authentication::Store::LDAP::Backend> 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<Catalyst::Authentication::Store::LDAP::User> object.
 
 =cut
 
 sub new {
-    my ( $class, $store, $user ) = @_;
+    my ( $class, $store, $user, $c ) = @_;
 
     return unless $user;
 
@@ -241,11 +243,8 @@ as, and returns a L<Net::LDAP> object which you can use to do further queries.
 
 sub ldap_connection {
     my $self = shift;
-    my $msg = $self->store->ldap_bind( undef, $self->ldap_entry->dn,
+    $self->store->ldap_bind( undef, $self->ldap_entry->dn,
         $self->_ldap_connection_password->() );
-    $msg->code && die("Error whilst re-binding as " . $self->ldap_entry->dn
-        . " after auth: " . $msg->error . " (" . $msg->code . ")");
-    return $self->store;
 }
 
 =head2 AUTOLOADed methods