I think this actually works
[catagits/Catalyst-Authentication-Store-LDAP.git] / lib / Catalyst / Authentication / Store / LDAP / Backend.pm
index 5602802..6ba93bd 100644 (file)
@@ -71,6 +71,7 @@ use base qw( Class::Accessor::Fast );
 
 use strict;
 use warnings;
+use Scalar::Util qw/refaddr/;
 
 our $VERSION = '1.011';
 
@@ -437,7 +438,14 @@ Returns get_user() for I<id>.
 
 sub from_session {
     my ( $self, $c, $id ) = @_;
-    $self->get_user($id, $c);
+    my $pass;
+    ($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;
 }
 
 1;