added version
[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
ab3925cc 8our $VERSION = '0.01';
9
e8a7c384 10use Catalyst::Plugin::Authentication::Store::Htpasswd::Backend;
0b5b70ba 11
12sub 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 32Catalyst::Plugin::Authentication::Store::Htpasswd - Authentication
0b5b70ba 33database in C<<$c->config>>.
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 53This plugin uses C<Authen::Htpasswd> to let your application use C<.htpasswd>
e8a7c384 54files for it's authentication storage.
0b5b70ba 55
56=head1 METHODS
57
cedb9fb4 58=head2 setup
0b5b70ba 59
60This method will popultate C<< $c->config->{authentication}{store} >> so that
61L<Catalyst::Plugin::Authentication/default_auth_store> can use it.
62
e8a7c384 63=head1 CONFIGURATION
64
cedb9fb4 65=head2 $c->config->{authentication}{htpasswd}
e8a7c384 66
67The path to the htpasswd file.
68
cedb9fb4 69=head1 AUTHORS
70
71Yuval Kogman C<nothingmuch@woobling.org>
72
73David Kamholz C<dkamholz@cpan.org>
74
75=head1 SEE ALSO
76
77L<Authen::Htpasswd>.
78
79=head1 COPYRIGHT & LICNESE
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