X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FAuthentication%2FStore%2FHtpasswd%2FUser.pm;fp=lib%2FCatalyst%2FPlugin%2FAuthentication%2FStore%2FHtpasswd%2FUser.pm;h=ce4388a9d0e1f078da76d5a1296c89c5c94bf8dc;hb=039544ff7e03ea53d05dab5e7dcf6cdb3122f886;hp=a242ba57aa01d08090b31216debe2b67808c9d79;hpb=ec31fe73dbbe0ab07357ea5959f29aed83d03c81;p=catagits%2FCatalyst-Authentication-Store-Htpasswd.git diff --git a/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm b/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm index a242ba5..ce4388a 100644 --- a/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm +++ b/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm @@ -6,14 +6,14 @@ use base qw/Catalyst::Plugin::Authentication::User Class::Accessor::Fast/; use strict; use warnings; -BEGIN { __PACKAGE__->mk_accessors(qw/user/) } +BEGIN { __PACKAGE__->mk_accessors(qw/user store/) } use overload '""' => sub { shift->user->username }; sub new { - my ( $class, $user ) = @_; + my ( $class, $store, $user ) = @_; - bless { user => $user }, $class; + bless { store => $store, user => $user }, $class; } sub supported_features { @@ -41,9 +41,14 @@ sub for_session { return $self->user->username; } -sub from_session { - my ($class,$c,$user) = @_; - return $user; +sub AUTOLOAD { + my $self = shift; + + ( my $method ) = ( our $AUTOLOAD =~ /([^:]+)$/ ); + + return if $method eq "DESTROY"; + + $self->user->$method; } __PACKAGE__;