/usr/share/perl5/Apache/Session/Browseable/_common.pm is in libapache-session-browseable-perl 1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | package Apache::Session::Browseable::_common;
use strict;
use AutoLoader 'AUTOLOAD';
our $VERSION = '1.0';
sub _tabInTab {
my ( $class, $t1, $t2 ) = @_;
# if no fields are required, return 0
return 0 unless(@$t1 and @$t2);
foreach my $f (@$t1) {
unless ( grep { $_ eq $f } @$t2 ) {
return 0;
}
}
return 1;
}
sub _fieldIsIndexed {
my ( $class, $args, $field ) = @_;
my $index =
ref( $args->{Index} ) ? $args->{Index} : [ split /\s+/, $args->{Index} ];
return ( grep { $_ eq $field } @$index );
}
1;
__END__
sub searchOn {
my ( $class, $args, $selectField, $value, @fields ) = splice @_;
my %res = ();
$class->get_key_from_all_sessions(
$args,
sub {
my $entry = shift;
my $id = shift;
return undef unless ( $entry->{$selectField} eq $value );
if (@fields) {
$res{$id}->{$_} = $entry->{$_} foreach (@fields);
}
else {
$res{$id} = $entry;
}
undef;
}
);
return \%res;
}
sub searchOnExpr {
my ( $class, $args, $selectField, $value, @fields ) = splice @_;
$value = quotemeta($value);
$value =~ s/\\\*/\.\*/g;
$value = qr/^$value$/;
my %res = ();
$class->get_key_from_all_sessions(
$args,
sub {
my $entry = shift;
my $id = shift;
return undef unless ( $entry->{$selectField} =~ $value );
if (@fields) {
$res{$id}->{$_} = $entry->{$_} foreach (@fields);
}
else {
$res{$id} = $entry;
}
undef;
}
);
return \%res;
}
1;
|