From: David Kamholz Date: Sun, 27 Nov 2005 12:12:31 +0000 (+0000) Subject: implement id() in Auth::Store::Htpasswd and change other methods to use it X-Git-Tag: v0.02~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Authentication-Store-Htpasswd.git;a=commitdiff_plain;h=7efcea1c2ca10adaad1feb4a4a8c667704d2667c implement id() in Auth::Store::Htpasswd and change other methods to use it --- diff --git a/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm b/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm index ce4388a..f018026 100644 --- a/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm +++ b/lib/Catalyst/Plugin/Authentication/Store/Htpasswd/User.pm @@ -8,7 +8,7 @@ use warnings; BEGIN { __PACKAGE__->mk_accessors(qw/user store/) } -use overload '""' => sub { shift->user->username }; +use overload '""' => sub { shift->id }, fallback => 1; sub new { my ( $class, $store, $user ) = @_; @@ -16,6 +16,11 @@ sub new { bless { store => $store, user => $user }, $class; } +sub id { + my $self = shift; + return $self->user->username; +} + sub supported_features { return { password => { @@ -27,18 +32,17 @@ sub supported_features { sub check_password { my ( $self, $password ) = @_; - return $self->user->check_password( $password ); } sub roles { my $self = shift; - split( ",", $self->user->extra_info ); + split( /,/, $self->user->extra_info ); } sub for_session { my $self = shift; - return $self->user->username; + return $self->id; } sub AUTOLOAD {