Memsession.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 33 CC 3 SCAR 20.8
CC
3
Cov
0%
get
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 8.0
1 package Lemonldap::Handlers::Memsession;
2 use strict;
3 use Apache::Session::Memorycached;
4 our ( @ISA, $VERSION, @EXPORTS );
5 $VERSION = '3.1.0';
6 our $VERSION_LEMONLDAP = "3.1.0";
7 our $VERSION_INTERNAL = "3.1.0";
8 sub get
9 {
10 my $class =shift;
11 my %_param= @_;
12
13 my $id =$_param{'id'};
14 return 0 unless $id;;
15  
16 my $config =$_param{'config'};
17  
18 my $SERVERS = $config->{SERVERS};
19  
20 my %session ;
21 tie %session, 'Apache::Session::Memorycached', $id,$SERVERS;
22 unless ($session{dn}) { ## the cookie is present but i can't retrieve session
23 ## three causes : Too many connection are served.
24 ## the server of session was restarted
25 ## It's time out
26
27 untie %session ;
28  
29 # I say it's time out
30 }
31 my %_session = %session;
32 untie %session ;
33 my $self = \%_session;
34 bless $self,$class;
35 return $self;
36 }
37 1;
38  
39 =pod
40  
41 =for html <center> <H1> Lemonldap::Handlers::Memsession </H1></center>
42  
43  
44 =head1 NAME
45  
46 Lemonldap::Handlers::Memsession - Plugin for Lemonldap sso system
47  
48 =head1 DESCRIPTION
49  
50 Memsession is the default session backend manager of lemonldap websso framework .
51 This module uses memcached in order to store information.
52
53 see http://lemonldap.sf.net for more infos .
54  
55 =head2 Overlay
56  
57 If you wat use your own session backend method you must use SESSIONSTOREPLUGIN parameter like this :
58 in httpd.conf : perlsetvar lemonldappluginbackend MyModule
59  
60 Your module must accept 2 parameters : config (all the hash of config ) and id (collect in the cookie )
61 Your module must provide the 'get' method and return a reference on hash of session.
62  
63 =head1 SEE ALSO
64  
65 Lemonldap(3), Lemonldap::Portal::Standard
66  
67 http://lemonldap.sourceforge.net/
68  
69 "Writing Apache Modules with Perl and C" by Lincoln Stein E<amp> Doug
70 MacEachern - O'REILLY
71  
72 =over 1
73  
74 =item Eric German, E<lt>germanlinux@yahoo.frE<gt>
75  
76 =item Isabelle Serre, E<lt>isabelle.serre@justice.gouv.frE<gt>
77  
78 =back
79  
80 =head1 COPYRIGHT AND LICENSE
81  
82 Copyright (C) 2004 by Eric German E<amp> Isabelle Serre
83  
84 Lemonldap originaly written by Eric german who decided to publish him in 2003
85 under the terms of the GNU General Public License version 2.
86  
87 =over 1
88  
89 =item This package is under the GNU General Public License, Version 2.
90  
91 =item The primary copyright holder is Eric German.
92  
93 =item Portions are copyrighted under the same license as Perl itself.
94  
95 =item Portions are copyrighted by Doug MacEachern and Lincoln Stein.
96 This library is under the GNU General Public License, Version 2.
97  
98 =item Portage under Apache2 is made with help of : Ali Pouya and
99 Shervin Ahmadi (MINEFI/DGI)
100  
101 =back
102  
103 This program is free software; you can redistribute it and/or modify
104 it under the terms of the GNU General Public License as published by
105 the Free Software Foundation; version 2 dated June, 1991.
106  
107 This program is distributed in the hope that it will be useful,
108 but WITHOUT ANY WARRANTY; without even the implied warranty of
109 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
110 GNU General Public License for more details.
111  
112 A copy of the GNU General Public License is available in the source tree;
113 if not, write to the Free Software Foundation, Inc.,
114 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
115  
116 =cut
117