line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::MobileUserID;
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
33781
|
use strict;
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
74
|
|
4
|
2
|
|
|
2
|
|
13
|
use warnings;
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
70
|
|
5
|
2
|
|
|
2
|
|
17
|
use base qw/Class::Data::Accessor/;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
2043
|
|
6
|
|
|
|
|
|
|
__PACKAGE__->mk_classaccessors(qw/agent user_id supported/);
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.02';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new {
|
11
|
9
|
|
|
9
|
0
|
1057
|
my $proto = shift;
|
12
|
9
|
|
33
|
|
|
52
|
my $self = bless {} , ref $proto || $proto;
|
13
|
9
|
|
|
|
|
32
|
$self->init(@_);
|
14
|
9
|
|
|
|
|
96
|
return $self;
|
15
|
|
|
|
|
|
|
}
|
16
|
|
|
|
|
|
|
|
17
|
9
|
|
|
9
|
0
|
62
|
sub has_user_id { shift->user_id }
|
18
|
9
|
|
|
9
|
0
|
57
|
sub no_user_id { !shift->user_id }
|
19
|
15
|
|
|
15
|
0
|
68
|
sub unsupported { !shift->supported }
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
*id = \&user_id;
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub init {
|
24
|
9
|
|
|
9
|
0
|
14
|
my $self = shift;
|
25
|
9
|
|
|
|
|
34
|
my $agent = $self->agent(shift);
|
26
|
9
|
|
|
|
|
95
|
$self->supported(1);
|
27
|
|
|
|
|
|
|
|
28
|
9
|
100
|
|
|
|
72
|
if ( $agent->is_docomo ) {
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
29
|
4
|
100
|
66
|
|
|
29
|
$self->supported(0) if $agent->html_version && $agent->html_version <= 2.0;
|
30
|
4
|
100
|
|
|
|
382
|
return if $self->unsupported;
|
31
|
3
|
|
|
|
|
36
|
$self->user_id($agent->serial_number);
|
32
|
|
|
|
|
|
|
}
|
33
|
|
|
|
|
|
|
elsif ( $agent->is_softbank ) {
|
34
|
2
|
100
|
|
|
|
35
|
$self->supported(0) if $agent->is_type_c;
|
35
|
2
|
100
|
|
|
|
60
|
return if $self->unsupported;
|
36
|
1
|
|
50
|
|
|
10
|
my $user_id = $agent->get_header('x-jphone-uid') || 'NULL';
|
37
|
1
|
50
|
|
|
|
17
|
$self->user_id($user_id) if $user_id ne 'NULL';
|
38
|
|
|
|
|
|
|
}
|
39
|
|
|
|
|
|
|
elsif ( $agent->is_ezweb ) {
|
40
|
2
|
|
|
|
|
31
|
$self->user_id($agent->get_header('x-up-subno'));
|
41
|
|
|
|
|
|
|
}
|
42
|
|
|
|
|
|
|
else {
|
43
|
1
|
|
|
|
|
21
|
$self->supported(0);
|
44
|
|
|
|
|
|
|
}
|
45
|
|
|
|
|
|
|
}
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1;
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__
|