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