X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FStore%2FLDAP%2FUser.pm;h=e0b6e7f9b70fa7cebdacf7afd8654b767c654a85;hb=2690c1e351ec34f25c67ceae98ce025ad86f3fb1;hp=96dc6e7b48ddc5a6a62699a246d14382120bbb20;hpb=aa44391ef3a7c8733af638f12421df48c6c759bd;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 96dc6e7..e0b6e7f 100644 --- a/lib/Catalyst/Authentication/Store/LDAP/User.pm +++ b/lib/Catalyst/Authentication/Store/LDAP/User.pm @@ -25,7 +25,7 @@ username. =head1 DESCRIPTION -This wraps up an LDAP object and presents a simplified interface to it's +This wraps up an LDAP object and presents a simplified interface to its contents. It uses some AUTOLOAD magic to pass method calls it doesn't understand through as simple read only accessors for the LDAP entries various attributes. @@ -51,7 +51,7 @@ use warnings; use Scalar::Util qw/refaddr/; use Net::LDAP::Entry; -our $VERSION = '1.015'; +our $VERSION = '1.017'; BEGIN { __PACKAGE__->mk_accessors(qw/user store/) } @@ -168,6 +168,9 @@ sub roles { Returns the user for persistence in the session depending on the persist_in_session config option. +Stores the persist_in_session setting so it can be used to revive the user +even if the setting has been changed. + =cut sub for_session { @@ -175,7 +178,13 @@ sub for_session { if ( $self->store->persist_in_session eq 'all' ) { # use the roles accessor to ensure the roles are fetched - return { user => $self->user, _roles => [ $self->roles ] }; + return { + # store the persistance setting in the session to know how to + # restore the user + persist_in_session => $self->store->persist_in_session, + user => $self->user, + _roles => [ $self->roles ], + }; } return $self->stringify;