1.002 2008-10-02 09:20:30Z
- Add Test::WWW::Mechanize::Catalyst and Test::use::ok
- to build_requires. CPANTs will keep hitting me until
+ to build_requires. CPANTs will keep hitting me until
I get it right :(
- Add code and docs for user_field configuration option
- Add code and docs for user_class configuration option
server = github
Test::MinimumVersion.max_target_perl = 5.008003
StaticInstall.dry_run = 0 ; we can safely set this here
--remove = Test::EOL ; TODO
-remove = Test::NoTabs ; TODO
-remove = Test::CleanNamespaces ; TODO
-remove = Test::PodSpelling ; TODO
sub new {
my ($class, $config, $app, $realm) = @_;
-
+
my $file = delete $config->{file};
unless (ref $file) {
my $filename = ($file =~ m|^/|) ? $file : $app->path_to($file)->stringify;
$config->{file} = $file;
$config->{user_class} ||= __PACKAGE__ . '::User';
$config->{user_field} ||= 'username';
-
+
bless { %$config }, $class;
}
sub user_supports {
my $self = shift;
- # this can work as a class method, but in that case you can't have
+ # this can work as a class method, but in that case you can't have
# a custom user class
ref($self) ? $self->user_class->supports(@_)
: Catalyst::Authentication::Store::Htpasswd::User->supports(@_);
},
},
},
- },
+ },
);
sub login : Global {
=head2 file
The path to the htpasswd file. If the path starts with a slash, then it is assumed to be a fully
-qualified path, otherwise the path is fed through C<< $c->path_to >> and so normalised to the
+qualified path, otherwise the path is fed through C<< $c->path_to >> and so normalised to the
application root.
Alternatively, it is possible to pass in an L<Authen::Htpasswd> object here, and this will be
sub AUTOLOAD {
my $self = shift;
-
+
( my $method ) = ( our $AUTOLOAD =~ /([^:]+)$/ );
return if $method eq "DESTROY";
-
+
$self->_user->$method;
}
=head2 new($store,$user)
-Creates a new object from a store object, normally an instance of
+Creates a new object from a store object, normally an instance of
L<Catalyst::Plugin::Authentication::Store::Htpasswd::Backend>, and a user object,
normally an instance of L<Authen::Htpasswd::User>.
},
},
},
- },
+ },
);
__PACKAGE__->setup;
use base 'Catalyst::Controller';
# your actions replace this one
-sub default : Private {
+sub default : Private {
my ($self, $c) = @_;
my $body = '';
if ($c->authenticate({ username => 'mufasa', password => 'Circle of Life'})) {
- $body .= "Authenticated:";
+ $body .= "Authenticated:";
$body .= $c->user->id;
}
$c->res->body($body);
#!/usr/bin/env perl
-BEGIN {
+BEGIN {
$ENV{CATALYST_ENGINE} ||= 'HTTP';
$ENV{CATALYST_SCRIPT_GEN} = 31;
require Catalyst::Engine::HTTP;
-}
+}
use strict;
use warnings;
'restartregex|rr=s' => \$restart_regex,
'restartdirectory=s' => \$restart_directory,
'daemon' => \$background,
- 'pidfile=s' => \$pidfile,
+ 'pidfile=s' => \$pidfile,
);
pod2usage(1) if $help;
restart_regex => qr/$restart_regex/,
restart_directory => $restart_directory,
background => $background,
- pidfile => $pidfile,
+ pidfile => $pidfile,
} );
1;