line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Kwiki::Email; |
2
|
1
|
|
|
1
|
|
24192
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
41
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
526
|
use Kwiki::Plugin '-Base'; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use Email::Valid; |
6
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
const class_id => 'email'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub register { |
11
|
|
|
|
|
|
|
my $registry = shift; |
12
|
|
|
|
|
|
|
$registry->add( |
13
|
|
|
|
|
|
|
preference => 'email', |
14
|
|
|
|
|
|
|
object => $self->email, |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub email { |
19
|
|
|
|
|
|
|
my $p = $self->new_preference('email'); |
20
|
|
|
|
|
|
|
$p->query('Enter your email address.'); |
21
|
|
|
|
|
|
|
$p->type('input'); |
22
|
|
|
|
|
|
|
$p->size(30); |
23
|
|
|
|
|
|
|
$p->edit('check_email'); |
24
|
|
|
|
|
|
|
$p->default(''); |
25
|
|
|
|
|
|
|
return $p; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub check_email { |
29
|
|
|
|
|
|
|
my $preference = shift; |
30
|
|
|
|
|
|
|
my $value = $preference->new_value; |
31
|
|
|
|
|
|
|
return unless length $value; |
32
|
|
|
|
|
|
|
$preference->error('Invalid Email Adress.') |
33
|
|
|
|
|
|
|
unless Email::Valid->address($value); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__DATA__ |