use strict;
use warnings;
+use Scalar::Util qw/refaddr/;
our $VERSION = '1.011';
sub from_session {
my ( $self, $c, $id ) = @_;
my $pass;
- if ($id =~ s/,(.*)//) {
- my $pass = $1;
- }
+ ($id, $pass) = split /,/, $id;
my $user = $self->get_user($id, $c);
if ($pass) {
$Catalyst::Authentication::Store::LDAP::User::_ldap_connection_passwords{refaddr($user)} = $pass;
+ warn("SET PASS FOR RESTORED USER TO $pass");
}
return $user;
}
sub ldap_connection {
my $self = shift;
+ my $password = $_ldap_connection_passwords{refaddr($self)};
+ unless ($password) {
+ warn("No password stored with user, cannot restore from session");
+ return;
+ }
$self->store->ldap_bind( undef, $self->ldap_entry->dn,
- $_ldap_connection_passwords{refaddr($self)} );
+ $password );
}
=head2 AUTOLOADed methods