line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Apache::Auth::User |
3
|
|
|
|
|
|
|
# An Apache authentication user class. |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# (C) 2003-2007 Julian Mehnle |
6
|
|
|
|
|
|
|
# $Id: User.pm 31 2007-09-18 01:39:14Z julian $ |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
############################################################################## |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
package Apache::Auth::User; |
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
4
|
|
25
|
use version; our $VERSION = qv('0.120'); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
23
|
|
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
294
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
99
|
|
15
|
4
|
|
|
4
|
|
20
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
183
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use overload |
18
|
4
|
|
|
|
|
26
|
'""' => 'signature', |
19
|
4
|
|
|
4
|
|
3533
|
fallback => 1; |
|
4
|
|
|
|
|
3352
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Constants: |
22
|
|
|
|
|
|
|
############################################################################## |
23
|
|
|
|
|
|
|
|
24
|
4
|
|
|
4
|
|
323
|
use constant TRUE => (0 == 0); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
381
|
|
25
|
4
|
|
|
4
|
|
35
|
use constant FALSE => not TRUE; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1596
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Interface: |
28
|
|
|
|
|
|
|
############################################################################## |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub name; |
33
|
|
|
|
|
|
|
sub password; |
34
|
|
|
|
|
|
|
sub password_digest; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# Implementation: |
37
|
|
|
|
|
|
|
############################################################################## |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub new { |
40
|
9
|
|
|
9
|
0
|
1797
|
my ($class, %options) = @_; |
41
|
9
|
|
|
|
|
31
|
my $self = bless(\%options, $class); |
42
|
9
|
|
|
|
|
30
|
return $self; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub name { |
46
|
34
|
|
|
34
|
0
|
62
|
my ($self, @value) = @_; |
47
|
34
|
50
|
|
|
|
117
|
$self->{name} = $value[0] if @value; |
48
|
34
|
|
|
|
|
305
|
return $self->{name}; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub password { |
52
|
0
|
|
|
0
|
0
|
0
|
my ($self, @value) = @_; |
53
|
0
|
0
|
|
|
|
0
|
if (@value) { |
54
|
0
|
|
|
|
|
0
|
$self->{password} = $value[0]; |
55
|
0
|
|
|
|
|
0
|
$self->{password_digest} = undef; |
56
|
|
|
|
|
|
|
} |
57
|
0
|
|
|
|
|
0
|
return $self->{password}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub password_digest { |
61
|
7
|
|
|
7
|
0
|
34
|
my ($self, @value) = @_; |
62
|
7
|
50
|
|
|
|
38
|
if (@value) { |
|
|
50
|
|
|
|
|
|
63
|
0
|
|
|
|
|
0
|
$self->{password_digest} = $value[0]; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
elsif (not defined($self->{password_digest})) { |
66
|
7
|
|
|
|
|
30
|
$self->{password_digest} = $self->_build_password_digest(); |
67
|
|
|
|
|
|
|
} |
68
|
7
|
|
|
|
|
582
|
return $self->{password_digest}; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
TRUE; |