line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## @file |
2
|
|
|
|
|
|
|
# Add get_key_from_all_sessions() function to Apache::Session modules. |
3
|
|
|
|
|
|
|
# This file is used by Lemonldap::NG::Manager::Status and by the |
4
|
|
|
|
|
|
|
# purgeCentralCache script. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Warning, this works only with SQL databases, simple or Berkeley files (not |
7
|
|
|
|
|
|
|
# for Apache::Session::Memcached for example) |
8
|
|
|
|
|
|
|
package Lemonldap::NG::Common::Apache::Session; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
11
|
1
|
|
|
1
|
|
668
|
use AutoLoader 'AUTOLOAD'; |
|
1
|
|
|
|
|
1481
|
|
|
1
|
|
|
|
|
5
|
|
12
|
1
|
|
|
1
|
|
657
|
use Apache::Session; |
|
1
|
|
|
|
|
1454
|
|
|
1
|
|
|
|
|
43
|
|
13
|
1
|
|
|
1
|
|
7
|
use base qw(Apache::Session); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
130
|
|
14
|
1
|
|
|
1
|
|
768
|
use Lemonldap::NG::Common::Apache::Session::Store; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
15
|
1
|
|
|
1
|
|
378
|
use Lemonldap::NG::Common::Apache::Session::Lock; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
135
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '1.4.0'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _load { |
20
|
2
|
|
|
2
|
|
4
|
my $backend = shift; |
21
|
2
|
50
|
|
|
|
29
|
unless ( $backend->can('populate') ) { |
22
|
0
|
|
|
|
|
0
|
eval "require $backend"; |
23
|
0
|
0
|
|
|
|
0
|
die $@ if ($@); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub populate { |
28
|
2
|
|
|
2
|
0
|
49
|
my $self = shift; |
29
|
2
|
|
|
|
|
14
|
my $backend = $self->{args}->{backend}; |
30
|
2
|
|
|
|
|
8
|
_load($backend); |
31
|
2
|
|
|
|
|
4
|
$backend .= "::populate"; |
32
|
|
|
|
|
|
|
{ |
33
|
1
|
|
|
1
|
|
4
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
181
|
|
|
2
|
|
|
|
|
4
|
|
34
|
2
|
|
|
|
|
11
|
$self = $self->$backend(@_); |
35
|
|
|
|
|
|
|
} |
36
|
2
|
100
|
|
|
|
149
|
if ( $self->{args}->{generateModule} ) { |
37
|
1
|
|
|
|
|
7
|
my $generate = $self->{args}->{generateModule}; |
38
|
1
|
|
|
|
|
101
|
eval "require $generate"; |
39
|
1
|
50
|
|
|
|
6
|
die $@ if ($@); |
40
|
1
|
|
|
|
|
3
|
$self->{generate} = \&{ $generate . "::generate" }; |
|
1
|
|
|
|
|
10
|
|
41
|
1
|
|
|
|
|
2
|
$self->{validate} = \&{ $generate . "::validate" }; |
|
1
|
|
|
|
|
6
|
|
42
|
|
|
|
|
|
|
} |
43
|
2
|
50
|
|
|
|
11
|
if ( $self->{args}->{setId} ) { |
44
|
0
|
|
|
|
|
0
|
$self->{generate} = \&setId; |
45
|
0
|
|
|
0
|
|
0
|
$self->{validate} = sub { 1 }; |
|
0
|
|
|
|
|
0
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# If cache is configured, use our specific object store module |
49
|
2
|
50
|
|
|
|
9
|
if ( $self->{args}->{localStorage} ) { |
50
|
0
|
|
|
|
|
0
|
$self->{args}->{object_store} = $self->{object_store}; |
51
|
0
|
|
|
|
|
0
|
$self->{object_store} = |
52
|
|
|
|
|
|
|
Lemonldap::NG::Common::Apache::Session::Store->new($self); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# If cache is configured, use our specific lock_manager object module |
56
|
2
|
50
|
|
|
|
9
|
if ( $self->{args}->{localStorage} ) { |
57
|
0
|
|
|
|
|
0
|
$self->{args}->{lock_manager} = $self->{lock_manager}; |
58
|
0
|
|
|
|
|
0
|
$self->{lock_manager} = |
59
|
|
|
|
|
|
|
Lemonldap::NG::Common::Apache::Session::Lock->new($self); |
60
|
|
|
|
|
|
|
} |
61
|
2
|
|
|
|
|
7
|
return $self; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |