2008-12-28 09:36:52 +01:00
|
|
|
|
##@file
|
|
|
|
|
# Cross-domain mechanism for handler
|
|
|
|
|
|
|
|
|
|
##@class
|
|
|
|
|
# Cross-domain mechanism for handler
|
2007-02-24 14:30:53 +01:00
|
|
|
|
package Lemonldap::NG::Handler::CDA;
|
2007-02-23 07:03:58 +01:00
|
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
|
|
use Lemonldap::NG::Handler::SharedConf qw(:all);
|
|
|
|
|
|
2012-10-15 06:12:21 +02:00
|
|
|
|
our $VERSION = '1.2.2';
|
2007-02-23 07:03:58 +01:00
|
|
|
|
|
2008-12-04 14:53:05 +01:00
|
|
|
|
use base qw(Lemonldap::NG::Handler::SharedConf);
|
2007-02-23 07:03:58 +01:00
|
|
|
|
|
2009-02-25 19:10:07 +01:00
|
|
|
|
## @rmethod int run(Apache2::RequestRec apacheRequest)
|
2008-12-28 09:36:52 +01:00
|
|
|
|
# overload run subroutine to implement cross-domain mechanism.
|
|
|
|
|
# @param $apacheRequest
|
|
|
|
|
# @return Apache constant
|
2007-02-23 07:03:58 +01:00
|
|
|
|
sub run ($$) {
|
|
|
|
|
my $class;
|
2010-01-31 09:25:05 +01:00
|
|
|
|
( $class, $apacheRequest ) = splice @_;
|
2009-06-10 22:47:57 +02:00
|
|
|
|
$cda = 1;
|
|
|
|
|
return $class->SUPER::run($apacheRequest);
|
2007-02-23 07:03:58 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
__END__
|
|
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
|
2010-01-03 09:09:59 +01:00
|
|
|
|
=encoding utf8
|
|
|
|
|
|
2007-02-23 07:03:58 +01:00
|
|
|
|
Lemonldap::NG::Handler::CDA - Module to use Lemonldap::NG::Handler
|
|
|
|
|
mechanisms with Cross-Domain-Authentication.
|
|
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
|
|
New usage:
|
|
|
|
|
|
|
|
|
|
package My::Package;
|
2009-06-10 22:47:57 +02:00
|
|
|
|
use Lemonldap::NG::Handler;
|
|
|
|
|
@ISA = qw(Lemonldap::NG::Handler);
|
2007-02-23 07:03:58 +01:00
|
|
|
|
__PACKAGE__->init ( {
|
2009-06-10 22:47:57 +02:00
|
|
|
|
cda => 1,
|
2007-02-23 07:03:58 +01:00
|
|
|
|
localStorage => "Cache::FileCache",
|
|
|
|
|
localStorageOptions => {
|
2012-02-09 18:36:13 +01:00
|
|
|
|
'namespace' => 'lemonldap-ng',
|
2007-02-23 07:03:58 +01:00
|
|
|
|
'default_expires_in' => 600,
|
|
|
|
|
},
|
|
|
|
|
reloadTime => 1200, # Default: 600
|
|
|
|
|
configStorage => {
|
|
|
|
|
type => "DBI"
|
|
|
|
|
dbiChain => "DBI:mysql:database=$database;host=$hostname;port=$port",
|
|
|
|
|
dbiUser => "lemonldap",
|
|
|
|
|
dbiPassword => "password",
|
|
|
|
|
},
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
Call your package in /apache-dir/conf/httpd.conf :
|
|
|
|
|
|
|
|
|
|
PerlRequire MyFile
|
|
|
|
|
# TOTAL PROTECTION
|
|
|
|
|
PerlHeaderParserHandler My::Package
|
|
|
|
|
# OR SELECTED AREA
|
|
|
|
|
<Location /protected-area>
|
|
|
|
|
PerlHeaderParserHandler My::Package
|
|
|
|
|
</Location>
|
|
|
|
|
|
|
|
|
|
The configuration is loaded only at Apache start. Create an URI to force
|
|
|
|
|
configuration reload, so you don't need to restart Apache at each change :
|
|
|
|
|
|
|
|
|
|
# /apache-dir/conf/httpd.conf
|
|
|
|
|
<Location /location/that/I/ve/choosed>
|
|
|
|
|
Order deny,allow
|
|
|
|
|
Deny from all
|
|
|
|
|
Allow from my.manager.com
|
|
|
|
|
PerlHeaderParserHandler My::Package->refresh
|
|
|
|
|
</Location>
|
|
|
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
|
|
|
|
|
This library inherit from L<Lemonldap::NG::Handler::SharedConf> and add the
|
|
|
|
|
capability to control users that are authenticated with a
|
2009-04-20 21:41:23 +02:00
|
|
|
|
L<Lemonldap::NG::Portal::CDA> CGI in another domain.
|
2007-02-23 07:03:58 +01:00
|
|
|
|
|
|
|
|
|
=head2 EXPORT
|
|
|
|
|
|
|
|
|
|
Same as L<Lemonldap::NG::Handler::SharedConf>.
|
|
|
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
|
|
|
|
|
L<Lemonldap::NG::Manager>, L<Lemonldap::NG::Handler>,
|
2007-04-02 21:13:05 +02:00
|
|
|
|
L<Lemonldap::NG::Handler::SharedConf>,
|
2010-10-26 08:08:16 +02:00
|
|
|
|
L<http://lemonldap-ng.org/>
|
2007-02-23 07:03:58 +01:00
|
|
|
|
|
|
|
|
|
=head1 AUTHOR
|
|
|
|
|
|
2013-01-31 06:33:10 +01:00
|
|
|
|
=over
|
|
|
|
|
|
|
|
|
|
=item Clement Oudot, E<lt>clem.oudot@gmail.comE<gt>
|
|
|
|
|
|
|
|
|
|
=item Fran<EFBFBD>ois-Xavier Deltombe, E<lt>fxdeltombe@gmail.com.E<gt>
|
|
|
|
|
|
|
|
|
|
=item Xavier Guimard, E<lt>x.guimard@free.frE<gt>
|
|
|
|
|
|
|
|
|
|
=back
|
2007-02-23 07:03:58 +01:00
|
|
|
|
|
2007-04-14 15:12:11 +02:00
|
|
|
|
=head1 BUG REPORT
|
|
|
|
|
|
|
|
|
|
Use OW2 system to report bug or ask for features:
|
2010-10-26 08:08:16 +02:00
|
|
|
|
L<http://jira.ow2.org>
|
2007-04-14 15:12:11 +02:00
|
|
|
|
|
|
|
|
|
=head1 DOWNLOAD
|
|
|
|
|
|
|
|
|
|
Lemonldap::NG is available at
|
|
|
|
|
L<http://forge.objectweb.org/project/showfiles.php?group_id=274>
|
|
|
|
|
|
2007-02-23 07:03:58 +01:00
|
|
|
|
=head1 COPYRIGHT AND LICENSE
|
|
|
|
|
|
2013-01-31 06:33:10 +01:00
|
|
|
|
=over
|
|
|
|
|
|
|
|
|
|
=item Copyright (C) 2007, 2008, 2009, 2010, 2012 by Xavier Guimard, E<lt>x.guimard@free.frE<gt>
|
|
|
|
|
|
|
|
|
|
=item Copyright (C) 2012 by Fran<EFBFBD>ois-Xavier Deltombe, E<lt>fxdeltombe@gmail.com.E<gt>
|
|
|
|
|
|
|
|
|
|
=item Copyright (C) 2010, 2012 by Clement Oudot, E<lt>clem.oudot@gmail.comE<gt>
|
|
|
|
|
|
|
|
|
|
=back
|
2007-02-23 07:03:58 +01:00
|
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify
|
2013-01-31 06:33:10 +01:00
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program. If not, see L<http://www.gnu.org/licenses/>.
|
2007-02-23 07:03:58 +01:00
|
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
|