line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*- |
2
|
|
|
|
|
|
|
# vim:ts=8:sw=2:et:sta:sts=2 |
3
|
|
|
|
|
|
|
######### |
4
|
|
|
|
|
|
|
# Author: rmp |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package ClearPress::authenticator::passwd; |
7
|
1
|
|
|
1
|
|
1349
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
8
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
44
|
|
9
|
1
|
|
|
1
|
|
8
|
use base qw(ClearPress::authenticator); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
428
|
|
10
|
1
|
|
|
1
|
|
10
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
195
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = q[477.1.2]; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub authen_credentials { |
15
|
6
|
|
|
6
|
1
|
54
|
my ($self, $ref) = @_; |
16
|
|
|
|
|
|
|
|
17
|
6
|
100
|
100
|
|
|
47
|
if(!$ref || |
|
|
|
100
|
|
|
|
|
18
|
|
|
|
|
|
|
!$ref->{username} || |
19
|
|
|
|
|
|
|
!$ref->{password} ) { |
20
|
3
|
|
|
|
|
22
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
16
|
my ($name, $passwd) = getpwnam $ref->{username}; |
24
|
3
|
100
|
|
|
|
39
|
if(!$name) { |
25
|
1
|
|
|
|
|
6
|
return; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
2
|
100
|
|
|
|
493
|
if((crypt $ref->{password}, $passwd) eq $passwd) { |
29
|
1
|
|
|
|
|
7
|
return $ref; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
7
|
return; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |