X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Authentication-Store-Htpasswd.git;a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FAuthentication%2FStore%2FHtpasswd%2FUser.pm;h=b5efe7c886e1402731770cb724630feae0729a50;hp=dc2bd834ed44c9fcebaaeb53c00e51d0f1691991;hb=3e0bbcff879384a81c842abcede0dba6b4314790;hpb=e517ed3d8c939c232d895d45b66085a6573be39e diff --git a/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm b/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm index dc2bd83..b5efe7c 100644 --- a/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm +++ b/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm @@ -6,15 +6,12 @@ use base qw/Catalyst::Plugin::Authentication::User Class::Accessor::Fast/; use strict; use warnings; -BEGIN { __PACKAGE__->mk_accessors(qw/file name/) } +BEGIN { __PACKAGE__->mk_accessors(qw/user/) } sub new { - my ( $class, $name, $file ) = @_; + my ( $class, $user ) = @_; - bless { - name => $name, - file => $file, - }, $class; + bless { user => $user }, $class; } sub supported_features { @@ -28,17 +25,12 @@ sub supported_features { sub check_password { my ( $self, $password ) = @_; - return $self->file->htCheckPassword( $self->name, $password ); + return $self->user->check_password( $password ); } sub roles { my $self = shift; - split( ",", $self->info_string ); -} - -sub info_string { - my $self = shift; - $self->file->fetchInfo( $self->name ); + split( ",", $self->user->extra_info ); } __PACKAGE__;