Commit 3a46dd24 authored by Eric German's avatar Eric German

version definitive

git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/trunk@50 1dbb9719-a921-0410-b57f-c3a383c2c641
parent ca16c197
......@@ -9,4 +9,9 @@ Revision history for Perl extension Lemonldap::Handlers::Generic.
-minor changes in doc
3.0.0 Tue Jul 04 10:00:00 2006
- great modification from DGI
3.1.0 Tue Mar 01 10:00:00 2007
- definitive version
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lemonldap::Handlers::AuthorizationHeader - Plugin for Lemonldap sso system</title>
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#overlay">Overlay</a></li>
</ul>
<li><a href="#see_also">SEE ALSO</a></li>
<li><a href="#copyright_and_license">COPYRIGHT AND LICENSE</a></li>
</ul>
<!-- INDEX END -->
<hr />
<center> <H1> Lemonldap::Handlers::AuthorizationHeader </H1></center><p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<pre>
Lemonldap::Handlers::AuthorizationHeader - Plugin for Lemonldap sso system</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<pre>
AuthorizationHeader is the default header builder manager of lemonldap websso framework .</pre>
<pre>
see <a href="http://lemonldap.sf.net">http://lemonldap.sf.net</a> for more infos .</pre>
<p>
</p>
<h2><a name="overlay">Overlay</a></h2>
<p>If you want use your own header method you must use PLUGINHEADER parameter like this :
in httpd.conf : perlsetvar lemonldappluginheader MyModule</p>
<pre>
Your module must accept 3 parameters : config (all the hash of config ) , dn and sting of role (profil) .</pre>
<pre>
Your module must provide the 'get' and 'forge' methods .
Those methods work with HEADER parameter which tells what will be the header (NONE value for no header)</pre>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>Lemonldap(3), Lemonldap::Portal::Standard</p>
<p><a href="http://lemonldap.sourceforge.net/">http://lemonldap.sourceforge.net/</a></p>
<p>``Writing Apache Modules with Perl and C'' by Lincoln Stein &amp; Doug
MacEachern - O'REILLY</p>
<dl>
<dt><strong><a name="item_eric_german_2c__3cgermanlinux_40yahoo_2efr_3e">Eric German, &lt;<a href="mailto:germanlinux@yahoo.fr">germanlinux@yahoo.fr</a>&gt;</a></strong><br />
</dt>
<dt><strong><a name="item_xavier_guimard_2c__3cx_2eguimard_40free_2efr_3e">Xavier Guimard, &lt;<a href="mailto:x.guimard@free.fr">x.guimard@free.fr</a>&gt;</a></strong><br />
</dt>
<dt><strong><a name="item_isabelle_serre_2c__3cisabelle_2eserre_40justice_2e">Isabelle Serre, &lt;<a href="mailto:isabelle.serre@justice.gouv.fr">isabelle.serre@justice.gouv.fr</a>&gt;</a></strong><br />
</dt>
</dl>
<p>
</p>
<hr />
<h1><a name="copyright_and_license">COPYRIGHT AND LICENSE</a></h1>
<p>Copyright (C) 2004 by Eric German &amp; Xavier Guimard &amp; Isabelle Serre</p>
<p>Lemonldap originaly written by Eric german who decided to publish him in 2003
under the terms of the GNU General Public License version 2.</p>
<dl>
<dt><strong><a name="item_this_package_is_under_the_gnu_general_public_licen">This package is under the GNU General Public License, Version 2.</a></strong><br />
</dt>
<dt><strong><a name="item_the_primary_copyright_holder_is_eric_german_2e">The primary copyright holder is Eric German.</a></strong><br />
</dt>
<dt><strong><a name="item_portions_are_copyrighted_under_the_same_license_as">Portions are copyrighted under the same license as Perl itself.</a></strong><br />
</dt>
<dt><strong><a name="item_portions_are_copyrighted_by_doug_maceachern_and_li">Portions are copyrighted by Doug MacEachern and Lincoln Stein.
This library is under the GNU General Public License, Version 2.</a></strong><br />
</dt>
<dt><strong><a name="item_ahmadi">Portage under Apache2 is made with help of : Ali Pouya and
Shervin Ahmadi (MINEFI/DGI)</a></strong><br />
</dt>
</dl>
<pre>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.</pre>
<pre>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</pre>
<pre>
A copy of the GNU General Public License is available in the source tree;
if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
</pre>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lemonldap::Handlers::MatrixPolicy - Plugin for Lemonldap sso system</title>
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#overlay">Overlay</a></li>
</ul>
<li><a href="#see_also">SEE ALSO</a></li>
<li><a href="#copyright_and_license">COPYRIGHT AND LICENSE</a></li>
</ul>
<!-- INDEX END -->
<hr />
<center> <H1> Lemonldap::Handlers::MatrixPolicy </H1></center><p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<pre>
Lemonldap::Handlers::MatrixPolicy - Plugin for Lemonldap sso system</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<pre>
MatrixPolicy is the default authorization manager of lemonldap websso framework .
This module uses matrix (hash with two dimensions) in order to grant access or deny on ressource.
The first axial line is given by ATTRLDAP (or Majeur) the second axial line is LDAPCONTROL (Mineur) parameter.</pre>
<pre>
see <a href="http://lemonldap.sf.net">http://lemonldap.sf.net</a> for more infos .</pre>
<p>
</p>
<h2><a name="overlay">Overlay</a></h2>
<p>If you wat use your own autorization method you must use PLUGINPOLICY parameter like this :
in httpd.conf : perlsetvar lemonldappluginpolicy MyModule</p>
<pre>
Your module must accept 2 parameters : config (all the hash of config ) and session (all hash of session)
Your module must provide the 'get' method and provide 'response' and 'profil' data object.</pre>
<pre>
response may content : 0 : no session (time out)
403: deny access by rules
503: deny access for all (service not available)
profil may content : string of role</pre>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>Lemonldap(3), Lemonldap::Portal::Standard</p>
<p><a href="http://lemonldap.sourceforge.net/">http://lemonldap.sourceforge.net/</a></p>
<p>``Writing Apache Modules with Perl and C'' by Lincoln Stein &amp; Doug
MacEachern - O'REILLY</p>
<dl>
<dt><strong><a name="item_eric_german_2c__3cgermanlinux_40yahoo_2efr_3e">Eric German, &lt;<a href="mailto:germanlinux@yahoo.fr">germanlinux@yahoo.fr</a>&gt;</a></strong><br />
</dt>
<dt><strong><a name="item_xavier_guimard_2c__3cx_2eguimard_40free_2efr_3e">Xavier Guimard, &lt;<a href="mailto:x.guimard@free.fr">x.guimard@free.fr</a>&gt;</a></strong><br />
</dt>
<dt><strong><a name="item_isabelle_serre_2c__3cisabelle_2eserre_40justice_2e">Isabelle Serre, &lt;<a href="mailto:isabelle.serre@justice.gouv.fr">isabelle.serre@justice.gouv.fr</a>&gt;</a></strong><br />
</dt>
</dl>
<p>
</p>
<hr />
<h1><a name="copyright_and_license">COPYRIGHT AND LICENSE</a></h1>
<p>Copyright (C) 2004 by Eric German &amp; Xavier Guimard &amp; Isabelle Serre</p>
<p>Lemonldap originaly written by Eric german who decided to publish him in 2003
under the terms of the GNU General Public License version 2.</p>
<dl>
<dt><strong><a name="item_this_package_is_under_the_gnu_general_public_licen">This package is under the GNU General Public License, Version 2.</a></strong><br />
</dt>
<dt><strong><a name="item_the_primary_copyright_holder_is_eric_german_2e">The primary copyright holder is Eric German.</a></strong><br />
</dt>
<dt><strong><a name="item_portions_are_copyrighted_under_the_same_license_as">Portions are copyrighted under the same license as Perl itself.</a></strong><br />
</dt>
<dt><strong><a name="item_portions_are_copyrighted_by_doug_maceachern_and_li">Portions are copyrighted by Doug MacEachern and Lincoln Stein.
This library is under the GNU General Public License, Version 2.</a></strong><br />
</dt>
<dt><strong><a name="item_ahmadi">Portage under Apache2 is made with help of : Ali Pouya and
Shervin Ahmadi (MINEFI/DGI)</a></strong><br />
</dt>
</dl>
<pre>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.</pre>
<pre>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</pre>
<pre>
A copy of the GNU General Public License is available in the source tree;
if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</pre>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lemonldap::Handlers::Memsession - Plugin for Lemonldap sso system</title>
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#overlay">Overlay</a></li>
</ul>
<li><a href="#see_also">SEE ALSO</a></li>
<li><a href="#copyright_and_license">COPYRIGHT AND LICENSE</a></li>
</ul>
<!-- INDEX END -->
<hr />
<center> <H1> Lemonldap::Handlers::Memsession </H1></center><p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<pre>
Lemonldap::Handlers::Memsession - Plugin for Lemonldap sso system</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<pre>
Memsession is the default session backend manager of lemonldap websso framework .
This module uses memcached in order to store information.
see <a href="http://lemonldap.sf.net">http://lemonldap.sf.net</a> for more infos .</pre>
<p>
</p>
<h2><a name="overlay">Overlay</a></h2>
<p>If you wat use your own session backend method you must use PLUGINBACKEND parameter like this :
in httpd.conf : perlsetvar lemonldappluginbackend MyModule</p>
<pre>
Your module must accept 2 parameters : config (all the hash of config ) and id (collect in the cookie )
Your module must provide the 'get' method and return a reference on hash of session.</pre>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>Lemonldap(3), Lemonldap::Portal::Standard</p>
<p><a href="http://lemonldap.sourceforge.net/">http://lemonldap.sourceforge.net/</a></p>
<p>``Writing Apache Modules with Perl and C'' by Lincoln Stein &amp; Doug
MacEachern - O'REILLY</p>
<dl>
<dt><strong><a name="item_eric_german_2c__3cgermanlinux_40yahoo_2efr_3e">Eric German, &lt;<a href="mailto:germanlinux@yahoo.fr">germanlinux@yahoo.fr</a>&gt;</a></strong><br />
</dt>
<dt><strong><a name="item_xavier_guimard_2c__3cx_2eguimard_40free_2efr_3e">Xavier Guimard, &lt;<a href="mailto:x.guimard@free.fr">x.guimard@free.fr</a>&gt;</a></strong><br />
</dt>
<dt><strong><a name="item_isabelle_serre_2c__3cisabelle_2eserre_40justice_2e">Isabelle Serre, &lt;<a href="mailto:isabelle.serre@justice.gouv.fr">isabelle.serre@justice.gouv.fr</a>&gt;</a></strong><br />
</dt>
</dl>
<p>
</p>
<hr />
<h1><a name="copyright_and_license">COPYRIGHT AND LICENSE</a></h1>
<p>Copyright (C) 2004 by Eric German &amp; Xavier Guimard &amp; Isabelle Serre</p>
<p>Lemonldap originaly written by Eric german who decided to publish him in 2003
under the terms of the GNU General Public License version 2.</p>
<dl>
<dt><strong><a name="item_this_package_is_under_the_gnu_general_public_licen">This package is under the GNU General Public License, Version 2.</a></strong><br />
</dt>
<dt><strong><a name="item_the_primary_copyright_holder_is_eric_german_2e">The primary copyright holder is Eric German.</a></strong><br />
</dt>
<dt><strong><a name="item_portions_are_copyrighted_under_the_same_license_as">Portions are copyrighted under the same license as Perl itself.</a></strong><br />
</dt>
<dt><strong><a name="item_portions_are_copyrighted_by_doug_maceachern_and_li">Portions are copyrighted by Doug MacEachern and Lincoln Stein.
This library is under the GNU General Public License, Version 2.</a></strong><br />
</dt>
<dt><strong><a name="item_ahmadi">Portage under Apache2 is made with help of : Ali Pouya and
Shervin Ahmadi (MINEFI/DGI)</a></strong><br />
</dt>
</dl>
<pre>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.</pre>
<pre>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</pre>
<pre>
A copy of the GNU General Public License is available in the source tree;
if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</pre>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lemonldap::Handlers::RewriteHTML - Plugin for Lemonldap sso system</title>
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#overlay">Overlay</a></li>
</ul>
<li><a href="#see_also">SEE ALSO</a></li>
<li><a href="#copyright_and_license">COPYRIGHT AND LICENSE</a></li>
</ul>
<!-- INDEX END -->
<hr />
<center> <H1> Lemonldap::Handlers::RewriteHTML </H1></center><p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<pre>
Lemonldap::Handlers::RewriteHTML - Plugin for Lemonldap sso system</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<pre>
RewriteHTML is the default rewriter manager of lemonldap websso framework .
This module rewrite on fly html response
see <a href="http://lemonldap.sf.net">http://lemonldap.sf.net</a> for more infos .</pre>
<p>
</p>
<h2><a name="overlay">Overlay</a></h2>
<pre>
If you wat use your own rewriter method you must use PLUGINHTML parameter like this :
in httpd.conf : perlsetvar lemonldappluginhtml MyModule</pre>
<pre>
Your module must accept 4 parameters : host :(the virtual host actived) ,target (the host target)
https (true if https request ) and html (the source page in html )
Your module must provide the 'get' method and return a html string.</pre>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>Lemonldap(3), Lemonldap::Portal::Standard</p>
<p><a href="http://lemonldap.sourceforge.net/">http://lemonldap.sourceforge.net/</a></p>
<p>``Writing Apache Modules with Perl and C'' by Lincoln Stein &amp; Doug
MacEachern - O'REILLY</p>
<dl>
<dt><strong><a name="item_eric_german_2c__3cgermanlinux_40yahoo_2efr_3e">Eric German, &lt;<a href="mailto:germanlinux@yahoo.fr">germanlinux@yahoo.fr</a>&gt;</a></strong><br />
</dt>
<dt><strong><a name="item_xavier_guimard_2c__3cx_2eguimard_40free_2efr_3e">Xavier Guimard, &lt;<a href="mailto:x.guimard@free.fr">x.guimard@free.fr</a>&gt;</a></strong><br />
</dt>
<dt><strong><a name="item_isabelle_serre_2c__3cisabelle_2eserre_40justice_2e">Isabelle Serre, &lt;<a href="mailto:isabelle.serre@justice.gouv.fr">isabelle.serre@justice.gouv.fr</a>&gt;</a></strong><br />
</dt>
</dl>
<p>
</p>
<hr />
<h1><a name="copyright_and_license">COPYRIGHT AND LICENSE</a></h1>
<p>Copyright (C) 2004 by Eric German &amp; Xavier Guimard &amp; Isabelle Serre</p>
<p>Lemonldap originaly written by Eric german who decided to publish him in 2003
under the terms of the GNU General Public License version 2.</p>
<dl>
<dt><strong><a name="item_this_package_is_under_the_gnu_general_public_licen">This package is under the GNU General Public License, Version 2.</a></strong><br />
</dt>
<dt><strong><a name="item_the_primary_copyright_holder_is_eric_german_2e">The primary copyright holder is Eric German.</a></strong><br />
</dt>
<dt><strong><a name="item_portions_are_copyrighted_under_the_same_license_as">Portions are copyrighted under the same license as Perl itself.</a></strong><br />
</dt>
<dt><strong><a name="item_portions_are_copyrighted_by_doug_maceachern_and_li">Portions are copyrighted by Doug MacEachern and Lincoln Stein.
This library is under the GNU General Public License, Version 2.</a></strong><br />
</dt>
<dt><strong><a name="item_ahmadi">Portage under Apache2 is made with help of : Ali Pouya and
Shervin Ahmadi (MINEFI/DGI)</a></strong><br />
</dt>
</dl>
<pre>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.</pre>
<pre>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.</pre>
<pre>
A copy of the GNU General Public License is available in the source tree;
if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</pre>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>index.pod</title>
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<!-- INDEX END -->
<p><a href="Generic4a2.html.en">Generic4a2.html.en</a></p>
<p><a href="Memsession.html.en">Memsession.html.en</a></p>
<p><a href="MatrixPolicy.html.en">MatrixPolicy.html.en</a></p>
<p><a href="RewriteHTML.html.en">RewriteHTML.html.en</a></p>
<p><a href="AuthorizationHeader.html.en">AuthorizationHeader.html.en</a></p>
<p></p>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>index.pod</title>
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<!-- INDEX END -->
<p><a href="Generic4a2.html.en">Generic4a2.html.en</a></p>
<p><a href="Memsession.html.en">Memsession.html.en</a></p>
<p><a href="MatrixPolicy.html.en">MatrixPolicy.html.en</a></p>
<p><a href="RewriteHTML.html.en">RewriteHTML.html.en</a></p>
<p><a href="AuthorizationHeader.html.en">AuthorizationHeader.html.en</a></p>
<p></p>
</body>
</html>
=pod
for html <h1> Index </h1>
L<file://Generic4a2.html.en>
L<file://Memsession.html.en>
L<file://MatrixPolicy.html.en>
L<file://RewriteHTML.html.en>
L<file://AuthorizationHeader.html.en>
=cut
package Lemonldap::Handlers::MatrixPolicy;
use strict;
use warnings;
our $VERSION = '2.00';
our $VERSION_LEMONLDAP = "2.0";
our $VERSION_INTERNAL = "2.0";
sub get {
my $class = shift;
my %_param = @_;
my $self;
my $config = $_param{parameters}->{'config'};
my $session = $_param{'session'};
unless ($session) {
$self->{response} = 0; #0 time out
bless $self, $class;
return $self;
}
my $complement;
my $dn = $session->{dn};
$dn =~ s/ //g;
my $major = $config->{ORGANIZATION};
if ( !defined($major) ) {
$major = "authz_headers";
}
my $minor = lc( $config->{APPLCODE} );
if ( defined($major)
&& defined($minor)
&& exists( $session->{$major}->{$minor} ) )
{
$complement = $session->{$major}->{$minor};
#### begin: here for he compatibility with older lemonldap
$complement =~ s/#.*//;
### end : here for he compatibility with older lemonldap
if ( defined( $config->{REGEXPMATRIXPOLICY} )
&& $complement !~ $config->{REGEXPMATRIXPOLICY} )
{
undef $complement;
}
else {
$self->{response} = 200;
}
}
$self->{response} = 503 if lc( $config->{ALLOW} ) eq 'disabled';
unless ( defined $complement ) {
$complement = '_DENY_';
$self->{response} = 403; #403 = FORBIDDEN 200 = OK
$complement = '_ALLOW_' && $self->{response} = '_ALLOW_'
if lc( $config->{ALLOW} ) eq 'all';
undef $complement
if ( $self->{response} == '403' or $self->{response} == '503' );
}
undef $complement
if ( $self->{response} == '403' or $self->{response} == '503' );
$self->{profil} = $complement;
bless $self, $class;
return $self;
our $VERSION = '3.1.0';
our $VERSION_LEMONLDAP = "3.1";
our $VERSION_INTERNAL = "3.1";
sub get
{
my $class= shift;
my %_param= @_;
my $self;
my $config =$_param{parameters}->{'config'};
my $session= $_param{'session'};
unless ($session) {
$self->{response} = 0; #0 time out
bless $self,$class;
return $self;
}
my $complement;
my $dn = $session->{dn};
$dn =~ s/ //g;
my $major = $config->{ORGANIZATION};
if( !defined($major) ){
$major = "authz_headers";
}
my $minor = lc($config->{APPLCODE});
if ( defined($major) && defined($minor) && exists($session->{$major}->{$minor}))
{
$complement = $session->{$major}->{$minor};
#### begin: here for he compatibility with older lemonldap
$complement =~ s/#.*//;
### end : here for he compatibility with older lemonldap
if ( defined($config->{REGEXPMATRIXPOLICY}) && $complement !~ $config->{REGEXPMATRIXPOLICY} ){
undef $complement;
}else{
$self->{response} = 200;
}
}
unless (defined $complement) {
$complement = '_DENY_';
$self->{response} = 403; #403 = FORBIDDEN 200 = OK
$complement = '_ALLOW_' && $self->{response} = '200' if lc($config->{ALLOW}) eq 'all';
undef $complement if ($self->{response} == '403' or $self->{response} == '503' );
}
$self->{response} = 503 if lc($config->{ALLOW}) eq 'disabled';
undef $complement if ($self->{response} == '403' or $self->{response} == '503' );
$self->{profil} = $complement ;
bless $self,$class;
return $self;
}
1;
......@@ -2,38 +2,37 @@ package Lemonldap::Handlers::Memsession;
use strict;
use Apache::Session::Memorycached;
our ( @ISA, $VERSION, @EXPORTS );
$VERSION = '2.00';
our $VERSION_LEMONLDAP = "2.0";
our $VERSION_INTERNAL = "2.0";
sub get {
my $class = shift;
my %_param = @_;
my $id = $_param{'id'};
return 0 unless $id;
my $config = $_param{'config'};
my $SERVERS = $config->{SERVERS};
my %session;
tie %session, 'Apache::Session::Memorycached', $id, $SERVERS;
unless ( $session{dn} )
{ ## the cookie is present but i can't retrieve session
## three causes : Too many connection are served.
## the server of session was restarted
## It's time out
untie %session;
$VERSION = '3.1.0';
our $VERSION_LEMONLDAP = "3.1.0";
our $VERSION_INTERNAL = "3.1.0";
sub get
{
my $class =shift;
my %_param= @_;
my $id =$_param{'id'};
return 0 unless $id;;
my $config =$_param{'config'};
my $SERVERS = $config->{SERVERS};
my %session ;
tie %session, 'Apache::Session::Memorycached', $id,$SERVERS;
unless ($session{dn}) { ## the cookie is present but i can't retrieve session
## three causes : Too many connection are served.
## the server of session was restarted
## It's time out
untie %session ;
# I say it's time out
}
# I say it's time out
}
my %_session = %session;
untie %session;
my $self = \%_session;
bless $self, $class;
return $self;
untie %session ;
my $self = \%_session;
bless $self,$class;
return $self;
}
1;
......