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);
|
|
|
|
|
2010-11-20 16:05:40 +01:00
|
|
|
our $VERSION = '1.0.0';
|
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
|
|
|
|
|
|
|
|
Xavier Guimard, E<lt>x.guimard@free.frE<gt>
|
|
|
|
|
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
|
|
|
|
|
2010-10-23 10:35:38 +02:00
|
|
|
Copyright (C) 2007, 2010 by Xavier Guimard E<lt>x.guimard@free.frE<gt>
|
2007-02-23 07:03:58 +01:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify
|
2010-10-24 09:25:44 +02:00
|
|
|
it under the same terms as Perl itself, either Perl version 5.10.0 or,
|
2007-02-23 07:03:58 +01:00
|
|
|
at your option, any later version of Perl 5 you may have available.
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|