line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Processor::Field::MD5_Password; |
2
|
|
|
|
|
|
|
$Form::Processor::Field::MD5_Password::VERSION = '1.162360'; |
3
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
19
|
|
5
|
1
|
|
|
1
|
|
3
|
use base 'Form::Processor::Field::Password'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
354
|
|
6
|
1
|
|
|
1
|
|
4
|
use Digest::MD5 'md5_hex'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
42
|
|
7
|
1
|
|
|
1
|
|
4
|
use Encode; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
130
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub validate { |
13
|
1
|
|
|
1
|
1
|
1
|
my $self = shift; |
14
|
|
|
|
|
|
|
|
15
|
1
|
50
|
|
|
|
3
|
return unless $self->SUPER::validate; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
2
|
my $input = $self->input; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
50
|
|
|
|
3
|
return $self->add_error( 'Passwords must include one or more digits' ) |
21
|
|
|
|
|
|
|
unless $input =~ /\d/; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
2
|
return 1; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub input_to_value { |
27
|
1
|
|
|
1
|
1
|
1
|
my $field = shift; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Failing test |
30
|
|
|
|
|
|
|
#$field->value( md5_hex( $field->input ) ); |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
3
|
$field->value( md5_hex( Encode::encode_utf8( $field->input ) ) ); |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
8
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# ABSTRACT: convert passwords to MD5 hashes |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |