line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::MobileUID;
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
21562
|
use strict;
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
69
|
|
4
|
2
|
|
|
2
|
|
14
|
use warnings;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
72
|
|
5
|
2
|
|
|
2
|
|
12
|
use base qw/Class::Data::Accessor/;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1846
|
|
6
|
|
|
|
|
|
|
__PACKAGE__->mk_classaccessors(qw/agent uid convert_uid/);
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.01';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new {
|
11
|
11
|
|
|
11
|
0
|
1138
|
my $proto = shift;
|
12
|
11
|
|
33
|
|
|
55
|
my $self = bless {} , ref $proto || $proto;
|
13
|
11
|
|
|
|
|
33
|
$self->init(@_);
|
14
|
11
|
|
|
|
|
51
|
return $self;
|
15
|
|
|
|
|
|
|
}
|
16
|
|
|
|
|
|
|
|
17
|
11
|
|
|
11
|
1
|
65
|
sub has_uid { shift->uid }
|
18
|
11
|
|
|
11
|
1
|
65
|
sub no_uid { !shift->uid }
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
*id = \&uid;
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub init {
|
23
|
11
|
|
|
11
|
0
|
13
|
my $self = shift;
|
24
|
11
|
|
|
|
|
33
|
my $agent = $self->agent(shift);
|
25
|
|
|
|
|
|
|
|
26
|
11
|
100
|
|
|
|
121
|
if ( $agent->is_docomo ) {
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Apache::DoCoMoUIDを利用。
|
28
|
4
|
|
|
|
|
22
|
my $uid = $agent->get_header('x-docomo-uid');
|
29
|
4
|
100
|
|
|
|
48
|
if ( $self->is_docomo_uid($uid) ) {
|
30
|
1
|
|
|
|
|
8
|
$self->uid($uid);
|
31
|
1
|
|
|
|
|
9
|
$uid =~ s/^0[01]//;
|
32
|
1
|
|
|
|
|
3
|
$self->convert_uid($uid);
|
33
|
|
|
|
|
|
|
}
|
34
|
|
|
|
|
|
|
}
|
35
|
|
|
|
|
|
|
elsif ( $agent->is_softbank ) {
|
36
|
3
|
|
100
|
|
|
37
|
my $uid = $agent->get_header('x-jphone-uid') || 'NULL';
|
37
|
3
|
100
|
|
|
|
44
|
if ( $uid ne 'NULL' ) {
|
38
|
2
|
100
|
|
|
|
7
|
if ( $self->is_softbank_uid($uid) ) {
|
39
|
1
|
|
|
|
|
4
|
$self->uid($uid);
|
40
|
1
|
|
|
|
|
7
|
$uid =~ s/^.//;
|
41
|
1
|
|
|
|
|
4
|
$self->convert_uid($uid);
|
42
|
|
|
|
|
|
|
}
|
43
|
|
|
|
|
|
|
}
|
44
|
|
|
|
|
|
|
}
|
45
|
|
|
|
|
|
|
elsif ( $agent->is_ezweb ) {
|
46
|
3
|
|
|
|
|
39
|
my $uid = $agent->get_header('x-up-subno');
|
47
|
3
|
100
|
|
|
|
30
|
if ( $self->is_ezweb_uid($uid) ) {
|
48
|
1
|
|
|
|
|
3
|
$self->uid($uid);
|
49
|
1
|
|
|
|
|
7
|
$self->convert_uid($uid);
|
50
|
|
|
|
|
|
|
}
|
51
|
|
|
|
|
|
|
}
|
52
|
|
|
|
|
|
|
}
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub is_docomo_uid {
|
55
|
4
|
|
|
4
|
1
|
5
|
my $class = shift;
|
56
|
4
|
|
100
|
|
|
14
|
my $uid = shift || '';
|
57
|
4
|
100
|
|
|
|
17
|
return 0 if $uid eq 'NULLGWDOCOMO';
|
58
|
3
|
|
|
|
|
15
|
$uid =~ /^[0-9a-zA-Z]{12}$/;
|
59
|
|
|
|
|
|
|
}
|
60
|
2
|
|
50
|
2
|
1
|
3
|
sub is_softbank_uid { shift; ( shift || '' ) =~ /^[0-9a-zA-Z]{16}$/ }
|
|
2
|
|
|
|
|
11
|
|
61
|
3
|
|
100
|
3
|
1
|
3
|
sub is_ezweb_uid { shift; ( shift || '' ) =~ /^[0-9]+_[0-9a-zA-Z]+\.[0-9a-zA-Z.\-]+$/ }
|
|
3
|
|
|
|
|
33
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1;
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__
|