Merge 'better_model_integration' into 'trunk'
Tomas Doran [Thu, 10 Dec 2009 17:25:51 +0000 (17:25 +0000)]
r27891@omni (orig r10889):  t0m | 2009-07-15 16:47:25 +0100
I don't actually need any of the extra lines, calling ->ldap_bind on the store I already have hands me the right thing back or throws

1  2 
lib/Catalyst/Authentication/Store/LDAP/User.pm

@@@ -49,7 -49,7 +49,7 @@@ use base qw( Catalyst::Authentication::
  use strict;
  use warnings;
  
 -our $VERSION = '0.1004';
 +our $VERSION = '0.1005';
  
  BEGIN { __PACKAGE__->mk_accessors(qw/user store _ldap_connection_password/) }
  
@@@ -57,20 -57,18 +57,20 @@@ use overload '""' => sub { shift->strin
  
  =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;
  
@@@ -243,11 -241,8 +243,8 @@@ as, and returns a L<Net::LDAP> object w
  
  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