line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PlugAuth::Plugin::AuthenSimple; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
16736
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
55
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
56
|
|
5
|
2
|
|
|
2
|
|
1363
|
use Authen::Simple; |
|
2
|
|
|
|
|
11037
|
|
|
2
|
|
|
|
|
54
|
|
6
|
2
|
|
|
2
|
|
6801
|
use Role::Tiny::With; |
|
2
|
|
|
|
|
5381
|
|
|
2
|
|
|
|
|
545
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'PlugAuth::Role::Plugin'; |
9
|
|
|
|
|
|
|
with 'PlugAuth::Role::Auth'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: AuthenSimple plugin for PlugAuth |
12
|
|
|
|
|
|
|
our $VERSION = '0.02'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub init |
16
|
|
|
|
|
|
|
{ |
17
|
1
|
|
|
1
|
0
|
1944
|
my($self) = @_; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
5
|
my $config_list = $self->plugin_config; |
20
|
1
|
50
|
|
|
|
12
|
$config_list = [ $config_list ] unless ref($config_list) eq 'ARRAY'; |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
2
|
my @simple_list; |
23
|
1
|
|
|
|
|
3
|
foreach my $item (@$config_list) |
24
|
|
|
|
|
|
|
{ |
25
|
2
|
|
|
|
|
142
|
while(my($class, $config) = each %$item) |
26
|
|
|
|
|
|
|
{ |
27
|
2
|
|
|
|
|
119
|
eval qq{ require $class }; |
28
|
2
|
50
|
|
|
|
12
|
die $@ if $@; |
29
|
2
|
|
|
|
|
22
|
push @simple_list, $class->new(%$config); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
90
|
$self->{simple} = Authen::Simple->new(@simple_list); |
34
|
1
|
|
|
|
|
43
|
$self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub check_credentials |
38
|
|
|
|
|
|
|
{ |
39
|
3
|
|
|
3
|
0
|
96052
|
my($self, $user, $pass) = @_; |
40
|
3
|
100
|
|
|
|
16
|
return 1 if $self->{simple}->authenticate($user, $pass); |
41
|
1
|
|
|
|
|
115
|
$self->deligate_check_credentials($user, $pass); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |