Commit | Line | Data |
e8a7c384 |
1 | #!/usr/bin/perl |
2 | |
3 | package Catalyst::Plugin::Authentication::Store::Htpasswd::User; |
4 | use base qw/Catalyst::Plugin::Authentication::User Class::Accessor::Fast/; |
5 | |
6 | use strict; |
7 | use warnings; |
8 | |
3e0bbcff |
9 | BEGIN { __PACKAGE__->mk_accessors(qw/user/) } |
e8a7c384 |
10 | |
11 | sub new { |
3e0bbcff |
12 | my ( $class, $user ) = @_; |
e8a7c384 |
13 | |
3e0bbcff |
14 | bless { user => $user }, $class; |
e8a7c384 |
15 | } |
16 | |
17 | sub supported_features { |
18 | return { |
19 | password => { |
20 | self_check => 1, |
21 | } |
22 | }; |
23 | } |
24 | |
25 | sub check_password { |
26 | my ( $self, $password ) = @_; |
27 | |
3e0bbcff |
28 | return $self->user->check_password( $password ); |
e8a7c384 |
29 | } |
30 | |
31 | sub roles { |
32 | my $self = shift; |
3e0bbcff |
33 | split( ",", $self->user->extra_info ); |
e8a7c384 |
34 | } |
35 | |
36 | __PACKAGE__; |
37 | |
38 | __END__ |
39 | |
40 | =pod |
41 | |
42 | =head1 NAME |
43 | |
44 | Catalyst::Plugin::Authentication::Store::Htpasswd::User - A user object |
45 | representing an entry in an htpasswd file. |
46 | |
47 | =head1 SYNOPSIS |
48 | |
49 | use Catalyst::Plugin::Authentication::Store::Htpasswd::User; |
50 | |
51 | =head1 DESCRIPTION |
52 | |
53 | =cut |
54 | |
55 | |