Commit | Line | Data |
0b5b70ba |
1 | #!/usr/bin/perl |
2 | |
e8a7c384 |
3 | package Catalyst::Plugin::Authentication::Store::Htpasswd; |
0b5b70ba |
4 | |
5 | use strict; |
6 | use warnings; |
7 | |
75fd14db |
8 | our $VERSION = '0.02'; |
ab3925cc |
9 | |
e8a7c384 |
10 | use Catalyst::Plugin::Authentication::Store::Htpasswd::Backend; |
0b5b70ba |
11 | |
12 | sub setup { |
13 | my $c = shift; |
14 | |
15 | $c->default_auth_store( |
e8a7c384 |
16 | Catalyst::Plugin::Authentication::Store::Htpasswd::Backend->new( |
17 | $c->config->{authentication}{htpasswd} |
0b5b70ba |
18 | ) |
19 | ); |
20 | |
21 | $c->NEXT::setup(@_); |
22 | } |
23 | |
24 | __PACKAGE__; |
25 | |
26 | __END__ |
27 | |
28 | =pod |
29 | |
30 | =head1 NAME |
31 | |
e8a7c384 |
32 | Catalyst::Plugin::Authentication::Store::Htpasswd - Authentication |
e9faac26 |
33 | database in C<< $c->config >>. |
0b5b70ba |
34 | |
35 | =head1 SYNOPSIS |
36 | |
37 | use Catalyst qw/ |
38 | Authentication |
e8a7c384 |
39 | Authentication::Store::Htpasswd |
0b5b70ba |
40 | Authentication::Credential::Password |
41 | /; |
42 | |
cedb9fb4 |
43 | __PACKAGE__->config->{authentication}{htpasswd} = "passwdfile"; |
0b5b70ba |
44 | |
45 | sub login : Global { |
46 | my ( $self, $c ) = @_; |
47 | |
48 | $c->login( $c->req->param("login"), $c->req->param("password"), ); |
49 | } |
50 | |
51 | =head1 DESCRIPTION |
52 | |
cedb9fb4 |
53 | This plugin uses C<Authen::Htpasswd> to let your application use C<.htpasswd> |
e8a7c384 |
54 | files for it's authentication storage. |
0b5b70ba |
55 | |
56 | =head1 METHODS |
57 | |
cedb9fb4 |
58 | =head2 setup |
0b5b70ba |
59 | |
60 | This method will popultate C<< $c->config->{authentication}{store} >> so that |
61 | L<Catalyst::Plugin::Authentication/default_auth_store> can use it. |
62 | |
e8a7c384 |
63 | =head1 CONFIGURATION |
64 | |
cedb9fb4 |
65 | =head2 $c->config->{authentication}{htpasswd} |
e8a7c384 |
66 | |
67 | The path to the htpasswd file. |
68 | |
cedb9fb4 |
69 | =head1 AUTHORS |
70 | |
71 | Yuval Kogman C<nothingmuch@woobling.org> |
72 | |
73 | David Kamholz C<dkamholz@cpan.org> |
74 | |
75 | =head1 SEE ALSO |
76 | |
77 | L<Authen::Htpasswd>. |
78 | |
f3ed9b84 |
79 | =head1 COPYRIGHT & LICENSE |
cedb9fb4 |
80 | |
81 | Copyright (c) 2005 the aforementioned authors. All rights |
82 | reserved. This program is free software; you can redistribute |
83 | it and/or modify it under the same terms as Perl itself. |
e8a7c384 |
84 | |
0b5b70ba |
85 | =cut |
86 | |
87 | |