line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
15
|
|
|
15
|
|
11458
|
use strict; |
|
15
|
|
|
|
|
30
|
|
|
15
|
|
|
|
|
530
|
|
2
|
15
|
|
|
15
|
|
75
|
use warnings; |
|
15
|
|
|
|
|
30
|
|
|
15
|
|
|
|
|
773
|
|
3
|
|
|
|
|
|
|
package HTML::Widget::Plugin::Password; |
4
|
|
|
|
|
|
|
# ABSTRACT: for SECRET input |
5
|
|
|
|
|
|
|
$HTML::Widget::Plugin::Password::VERSION = '0.202'; |
6
|
15
|
|
|
15
|
|
76
|
use parent 'HTML::Widget::Plugin::Input'; |
|
15
|
|
|
|
|
38
|
|
|
15
|
|
|
|
|
82
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#pod =head1 SYNOPSIS |
9
|
|
|
|
|
|
|
#pod |
10
|
|
|
|
|
|
|
#pod $widget_factory->password({ |
11
|
|
|
|
|
|
|
#pod id => 'user_secret', |
12
|
|
|
|
|
|
|
#pod value => "not visible in html", |
13
|
|
|
|
|
|
|
#pod }); |
14
|
|
|
|
|
|
|
#pod |
15
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
16
|
|
|
|
|
|
|
#pod |
17
|
|
|
|
|
|
|
#pod This plugin provides a widget for password-entry inputs. |
18
|
|
|
|
|
|
|
#pod |
19
|
|
|
|
|
|
|
#pod =cut |
20
|
|
|
|
|
|
|
|
21
|
15
|
|
|
15
|
|
877
|
use HTML::Element; |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
95
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#pod =head1 METHODS |
24
|
|
|
|
|
|
|
#pod |
25
|
|
|
|
|
|
|
#pod =head2 C< provided_widgets > |
26
|
|
|
|
|
|
|
#pod |
27
|
|
|
|
|
|
|
#pod This plugin provides the following widgets: password |
28
|
|
|
|
|
|
|
#pod |
29
|
|
|
|
|
|
|
#pod =cut |
30
|
|
|
|
|
|
|
|
31
|
17
|
|
|
17
|
1
|
73
|
sub provided_widgets { [ input => 'password' ] } |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#pod =head2 C< password > |
34
|
|
|
|
|
|
|
#pod |
35
|
|
|
|
|
|
|
#pod This method returns a password-entry widget. |
36
|
|
|
|
|
|
|
#pod |
37
|
|
|
|
|
|
|
#pod In addition to the generic L attributes, the following |
38
|
|
|
|
|
|
|
#pod are valid arguments: |
39
|
|
|
|
|
|
|
#pod |
40
|
|
|
|
|
|
|
#pod =over |
41
|
|
|
|
|
|
|
#pod |
42
|
|
|
|
|
|
|
#pod =item value |
43
|
|
|
|
|
|
|
#pod |
44
|
|
|
|
|
|
|
#pod This is the widget's initial value. The value is eaten and displayed as a |
45
|
|
|
|
|
|
|
#pod series of spaces, if the value is defined. |
46
|
|
|
|
|
|
|
#pod |
47
|
|
|
|
|
|
|
#pod =back |
48
|
|
|
|
|
|
|
#pod |
49
|
|
|
|
|
|
|
#pod =cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
#pod =head2 C< rewrite_arg > |
52
|
|
|
|
|
|
|
#pod |
53
|
|
|
|
|
|
|
#pod The password plugin's rewrite_arg replaces any non-empty value with a string of |
54
|
|
|
|
|
|
|
#pod spaces so that passwords are not inadvertantly sent as plain text. |
55
|
|
|
|
|
|
|
#pod |
56
|
|
|
|
|
|
|
#pod =cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub rewrite_arg { |
59
|
3
|
|
|
3
|
1
|
8
|
my ($self, $arg, @rest) = @_; |
60
|
|
|
|
|
|
|
|
61
|
3
|
|
|
|
|
14
|
$arg = $self->SUPER::rewrite_arg($arg, @rest); |
62
|
|
|
|
|
|
|
|
63
|
3
|
|
|
|
|
7
|
$arg->{attr}{type} = "password"; |
64
|
|
|
|
|
|
|
|
65
|
3
|
100
|
100
|
|
|
17
|
$arg->{attr}{value} = q{ } x 8 |
66
|
|
|
|
|
|
|
if defined $arg->{attr}{value} and length $arg->{attr}{value}; |
67
|
|
|
|
|
|
|
|
68
|
3
|
|
|
|
|
9
|
return $arg; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |