line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sledge::SessionManager::MobileID; |
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
6
|
use base 'Sledge::SessionManager'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
772
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.02; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
903
|
use Digest::SHA1 qw(sha1_hex); |
|
1
|
|
|
|
|
888
|
|
|
1
|
|
|
|
|
87
|
|
9
|
1
|
|
|
1
|
|
1118
|
use Time::HiRes qw(gettimeofday); |
|
1
|
|
|
|
|
7760
|
|
|
1
|
|
|
|
|
6
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
0
|
|
|
0
|
0
|
|
my ($class, $page) = @_; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
$page->add_trigger( |
15
|
|
|
|
|
|
|
AFTER_INIT => sub { |
16
|
0
|
|
|
0
|
|
|
my $page = shift; |
17
|
0
|
0
|
|
|
|
|
$page->construct_session unless $page->session; |
18
|
0
|
|
|
|
|
|
my $session_class = ref($page->{session}) . "::__MobileID"; |
19
|
|
|
|
|
|
|
{ |
20
|
1
|
|
|
1
|
|
285
|
no strict 'refs'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
273
|
|
|
0
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
unless (@{"$session_class\::ISA"}) { |
|
0
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
unshift @{"$session_class\::ISA"}, ref $page->{session}; |
|
0
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
*{"$session_class\::_gen_session_id"} = sub { |
25
|
0
|
|
|
|
|
|
my $self = shift; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
return ( |
28
|
0
|
|
0
|
|
|
|
$ENV{HTTP_X_UP_SUBNO} |
29
|
|
|
|
|
|
|
|| $ENV{HTTP_X_JPHONE_UID} |
30
|
|
|
|
|
|
|
|| die "can't get moile id !" |
31
|
|
|
|
|
|
|
); |
32
|
0
|
|
|
|
|
|
}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
|
$page->{session} = bless +{ %{$page->{session}} }, $session_class; |
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
0
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
bless {}, $class; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub get_session_id { |
43
|
0
|
|
|
0
|
0
|
|
my ( $self, $page ) = @_; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
0
|
|
|
|
return ( $page->r->header_in("X_UP_SUBNO") |
46
|
|
|
|
|
|
|
|| $page->r->header_in("X_JPHONE_UID") ); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
0
|
0
|
|
sub set_session_id {} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
__END__ |