Commit 4764c0fe authored by Xavier Guimard's avatar Xavier Guimard

Update to lemonldap-ng-07



git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/trunk@3 1dbb9719-a921-0410-b57f-c3a383c2c641
parent c9edfe9a
Revision history for Perl extension Lemonldap::NG::Handler.
0.64 Sun Dec 17 14:54:14 2006
0.7 Tue Dec 19 19:09:09 2006
- config is now shared with Lemonldap::NG::Manager::Conf
- use Safe for locationRules and exportedHeaders 'eval'
0.63 Sun Dec 17 14:54:14 2006
- bug corrections
0.621 Tue Dec 5 20:12:12 2006
- move Handler.pod to Handler.pm to avoid CPAN bug
......
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Lemonldap-NG-Handler
version: 0.63
version: 0.7
version_from: lib/Lemonldap/NG/Handler.pm
installdirs: site
requires:
......@@ -9,6 +9,7 @@ requires:
Cache::Cache: 0
DBI: 0
Exporter: 0
Lemonldap::NG::Manager: 0.03
LWP::UserAgent: 0
MIME::Base64: 0
......
package My::Package;
use Lemonldap::NG::Handler::SharedConf::File;
@ISA = qw(Lemonldap::NG::Handler::SharedConf::File);
use Lemonldap::NG::Handler::SharedConf;
@ISA = qw(Lemonldap::NG::Handler::SharedConf);
__PACKAGE__->init ( {
localStorage => "Cache::FileCache",
......@@ -11,7 +11,7 @@ __PACKAGE__->init ( {
configStorage => {
type => 'File',
dirName => '__DIR__',
dirName => '__DIR__/conf',
},
https => 0,
......
#Listen 127.0.0.3:80
# On Apache2, uncomment this:
# PerlOptions +GlobalRequest
<VirtualHost 127.0.0.3:*>
ServerName test.example.com
PerlRequire __DIR__/MyHandler.pm
PerlRequire __DIR__/handler/MyHandler.pm
PerlInitHandler My::Package
<Location /reload>
Order deny,allow
......
package Lemonldap::NG::Handler;
print STDERR "See Lemonldap::NG::Handler(3) to know which Lemonldap::NG::Handler::* module to use.";
our $VERSION = "0.64";
our $VERSION = "0.7";
1;
......
......@@ -9,7 +9,7 @@ use Cache::Cache qw($EXPIRES_NEVER);
our @ISA = qw(Lemonldap::NG::Handler::Vhost Lemonldap::NG::Handler::Simple);
our $VERSION = '0.4';
our $VERSION = '0.5';
our $cfgNum = 0;
our $lastReload = 0;
our $reloadTime;
......
......@@ -14,7 +14,7 @@ BEGIN {
}
}
our $VERSION = '0.4';
our $VERSION = '0.5';
our @ISA = qw(Lemonldap::NG::Handler::SharedConf);
......
......@@ -4,8 +4,9 @@ use strict;
use MIME::Base64;
use Exporter 'import';
use Safe;
our $VERSION = '0.6';
our $VERSION = '0.7';
our %EXPORT_TAGS = (
localStorage => [
......@@ -17,7 +18,7 @@ our %EXPORT_TAGS = (
locationRules => [
qw(
$locationCondition $defaultCondition $locationCount
$locationRegexp $apacheRequest $datas
$locationRegexp $apacheRequest $datas $safe
)
],
import => [
......@@ -55,6 +56,7 @@ our (
$apacheRequest, $locationCount, $cookieName, $portal,
$datas, $globalStorage, $globalStorageOptions, $localStorage,
$localStorageOptions, $whatToTrace, $https, $refLocalStorage,
$safe,
);
##########################################
......@@ -184,11 +186,9 @@ sub lmSetErrHeaderOut {
sub lmSetHeaderOut {
my ( $r, $h, $v ) = @_;
if ( MP() == 2 ) {
print STDERR "DEBUG2 $h => $v\n";
return $r->headers_out->set( $h => $v );
}
else {
print STDERR "DEBUG1 $h => $v\n";
return $r->header_out( $h => $v );
}
}
......@@ -207,6 +207,10 @@ sub lmHeaderOut {
# Initialization subroutines #
##############################
# Security jail
$safe = new Safe;
$safe->share('&encode_base64','$datas');
# init() : by default, it calls localInit and globalInit, but with
# a shared configuration, init() is overloaded to call only
# localInit; globalInit is called later when the configuration
......@@ -302,7 +306,7 @@ sub conditionSub {
if ( $cond =~ /^deny$/i );
$cond =~ s/\$(\w+)/\$datas->{$1}/g;
my $sub;
eval '$sub = sub {return (' . $cond . ')}';
$sub = $safe->reval("sub {return ( $cond )}");
return $sub;
}
......@@ -357,9 +361,10 @@ sub forgeHeadersInit {
foreach ( keys %tmp ) {
$sub .= "lmSetHeaderIn(\$apacheRequest,'$_' => join('',split(/[\\r\\n]+/," . $tmp{$_} . ")));";
}
$sub = "\$forgeHeaders = sub {$sub};";
eval "$sub";
$class->lmLog( "$class: Unable to forge headers: $@ $sub", 'error' ) if ($@);
#$sub = "\$forgeHeaders = sub {$sub};";
#eval "$sub";
$forgeHeaders = $safe->reval("sub {$sub};");
$class->lmLog( "$class: Unable to forge headers: $@: sub {$sub}", 'error' ) if ($@);
}
################
......
......@@ -4,7 +4,7 @@ use Lemonldap::NG::Handler::Simple qw(:locationRules :headers);
use strict;
use MIME::Base64;
our $VERSION = '0.3';
our $VERSION = '0.4';
sub locationRulesInit {
my ( $class, $args ) = @_;
......@@ -43,9 +43,10 @@ sub forgeHeadersInit {
foreach ( keys %tmp ) {
$sub .= "lmSetHeaderIn(\$apacheRequest,'$_' => join('',split(/[\\r\\n]+/," . $tmp{$_} . ")));";
}
$sub = "\$forgeHeaders->{'$vhost'} = sub {$sub};";
eval "$sub";
$class->lmLog( "$class: Unable to forge headers: $@ $sub", 'error' ) if ($@);
#$sub = "\$forgeHeaders->{'$vhost'} = sub {$sub};";
#eval "$sub";
$forgeHeaders->{'$vhost'} = $safe->reval("sub {$sub}");
$class->lmLog( "$class: Unable to forge headers: $@: sub {$sub}", 'error' ) if ($@);
}
}
......
Changes
example/cgi.pl
example/imgs/_customers.gif
example/imgs/blank.gif
example/imgs/book.gif
example/imgs/book_titel.gif
example/imgs/books_close.gif
example/imgs/books_open.gif
example/imgs/btn_up1.gif
example/imgs/btn_up2.gif
example/imgs/close2.gif
example/imgs/folderClosed.gif
example/imgs/folderOpen.gif
example/imgs/iconCheckAll.gif
example/imgs/iconCheckGray.gif
example/imgs/iconClient.gif
example/imgs/iconDeleteSelected.gif
example/imgs/iconJob.gif
example/imgs/iconReport.gif
example/imgs/iconTask.gif
example/imgs/iconTimeRecordsEdit.gif
example/imgs/iconUnCheckAll.gif
example/imgs/item.gif
example/imgs/item2.gif
example/imgs/leaf.gif
example/imgs/line1.gif
example/imgs/line2.gif
example/imgs/line3.gif
example/imgs/line4.gif
example/imgs/magazines_close.gif
example/imgs/magazines_open.gif
example/imgs/minus.gif
example/imgs/minus2.gif
example/imgs/minus3.gif
example/imgs/minus4.gif
example/imgs/minus5.gif
example/imgs/minus_ar.gif
example/imgs/open2.gif
example/imgs/plus.gif
example/imgs/plus2.gif
example/imgs/plus3.gif
example/imgs/plus4.gif
example/imgs/plus5.gif
example/imgs/plus_ar.gif
example/imgs/tombs.gif
example/imgs/tombs_mag.gif
example/lemonldap-ng-manager.js
imgs/_customers.gif
imgs/blank.gif
imgs/book.gif
imgs/book_titel.gif
imgs/books_close.gif
imgs/books_open.gif
imgs/btn_up1.gif
imgs/btn_up2.gif
imgs/close2.gif
imgs/folderClosed.gif
imgs/folderOpen.gif
imgs/iconCheckAll.gif
imgs/iconCheckGray.gif
imgs/iconClient.gif
imgs/iconDeleteSelected.gif
imgs/iconJob.gif
imgs/iconReport.gif
imgs/iconTask.gif
imgs/iconTimeRecordsEdit.gif
imgs/iconUnCheckAll.gif
imgs/item.gif
imgs/item2.gif
imgs/leaf.gif
imgs/line1.gif
imgs/line2.gif
imgs/line3.gif
imgs/line4.gif
imgs/magazines_close.gif
imgs/magazines_open.gif
imgs/minus.gif
imgs/minus2.gif
imgs/minus3.gif
imgs/minus4.gif
imgs/minus5.gif
imgs/minus_ar.gif
imgs/open2.gif
imgs/plus.gif
imgs/plus2.gif
imgs/plus3.gif
imgs/plus4.gif
imgs/plus5.gif
imgs/plus_ar.gif
imgs/tombs.gif
imgs/tombs_mag.gif
example/index.pl
lemonldap-ng-manager.js
lib/Lemonldap/NG/Manager.pm
lib/Lemonldap/NG/Manager/Base.pm
......@@ -53,6 +53,6 @@ lib/Lemonldap/NG/Manager/Conf/DBI.pm
lib/Lemonldap/NG/Manager/Conf/File.pm
Makefile.PL
MANIFEST
META.yml Module meta-data (added by MakeMaker)
README
t/Lemonldap-NG-Manager.t
META.yml Module meta-data (added by MakeMaker)
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Lemonldap-NG-Manager
version: 0.03
version: 0.04
version_from: lib/Lemonldap/NG/Manager.pm
installdirs: site
requires:
......
This diff is collapsed.
......@@ -6,7 +6,7 @@ WriteMakefile(
VERSION_FROM => 'lib/Lemonldap/NG/Manager.pm', # finds $VERSION
PREREQ_PM => {
DBI => 0,
CGI => 0,
CGI => 3.08,
Storable => 0,
XML::Simple => 0
}, # e.g., Module::Name => 1.1
......
......@@ -6,9 +6,9 @@ my $h=new Lemonldap::NG::Manager(
{
configStorage=>{
type=>'File',
dirName=>"/tmp/",
dirName=>"__DIR__/conf/",
},
dhtmlXTreeImageLocation=> "/img/",
dhtmlXTreeImageLocation=> "/imgs/",
# jsFile => /path/to/lemonldap-ng-manager.js,
}
) or die "Impossible de dmarrer";
......
This diff is collapsed.
......@@ -9,7 +9,7 @@ use Lemonldap::NG::Manager::Conf;
our @ISA = qw(Lemonldap::NG::Manager::Base);
our $VERSION = '0.03';
our $VERSION = '0.04';
sub new {
my($class,$args) = @_;
......@@ -295,7 +295,7 @@ sub upload {
$config->{globalStorage} = $tree->{generalParameters}->{sessionStorage}->{globalStorage}->{value};
while ( my ( $v, $h ) = each( %{$tree->{generalParameters}->{sessionStorage}->{globalStorageOptions}})) {
next unless ( ref($h) );
$config->{globalStorageOptions}->{$v} = $h->{value};
$config->{globalStorageOptions}->{$h->{text}} = $h->{value};
}
foreach (qw(ldapBase ldapPort ldapServer managerDn managerPassword)) {
$config->{$_} = $tree->{generalParameters}->{ldapParameters}->{$_}->{value};
......
......@@ -4,9 +4,8 @@ use strict;
use Storable qw(thaw freeze);
use MIME::Base64;
our $VERSION = 0.1;
our $VERSION = 0.3;
our @ISA;
my $mdone = 0;
sub new {
my $class = shift;
......@@ -19,7 +18,7 @@ sub new {
}
$args ||= {};
my $self = bless $args, $class;
unless($mdone) {
unless($self->{mdone}) {
unless($self->{type}) {
print STDERR "configStorage: type is not defined\n";
return 0;
......@@ -29,7 +28,7 @@ sub new {
die ($@) if($@);
push @ISA, $self->{type};
return 0 unless $self->prereq;
$mdone++;
$self->{mdone}++;
}
return $self;
}
......
Revision history for Perl extension Lemonldap::NG::Portal.
0.43 Sun Dec 26 14:55:45 2006
0.5 Tue Dec 19 19:11:15
- config is now shared with Lemonldap::NG::Manager::Conf
0.42 Thu Dec 7 12:23:52 2006
- remove html code written after redirection because of a Firefox-2 bug
- move Portal.pod to Portal.pm because CPAN does not index correctly
......
Changes
example/index.pl
lib/Lemonldap/NG/Portal.pm
lib/Lemonldap/NG/Portal/AuthSSL.pm
lib/Lemonldap/NG/Portal/SharedConf.pm
......
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Lemonldap-NG-Portal
version: 0.42
version: 0.5
version_from: lib/Lemonldap/NG/Portal.pm
installdirs: site
requires:
Apache::Session: 0
CGI: 3.08
DBI: 0
Lemonldap::NG::Manager: 0.03
MIME::Base64: 0
Net::LDAP: 0
......
This diff is collapsed.
......@@ -5,7 +5,7 @@ use Lemonldap::NG::Portal::SharedConf;
my $portal = Lemonldap::NG::Portal::SharedConf->new ( {
configStorage => {
type => 'File',
dirname => '__DIR__',
dirName => '__DIR__/conf/',
}
});
......
package Lemonldap::NG::Portal;
print STDERR "See Lemonldap::NG::Portal(3) to know which Lemonldap::NG::Portal::* module to use.";
our $VERSION = "0.42";
our $VERSION = "0.5";
1;
......@@ -18,9 +18,9 @@ system.
use Lemonldap::NG::Portal::SharedConf::DBI;
my $portal = new Lemonldap::NG::Portal::SharedConf::DBI (
dbiChain => "dbi:mysql:database=sso_sessions;host=128.101.20.41",
dbiUser => "sso_consult",
dbiPassword => "pass;sso_consult!",
dbiChain => "dbi:mysql:database=lmSessions;host=1.2.3.4",
dbiUser => "lemon",
dbiPassword => "pass",
);
......
......@@ -8,7 +8,7 @@ use Lemonldap::NG::Manager::Conf;
*EXPORT_TAGS = *Lemonldap::NG::Portal::Simple::EXPORT_TAGS;
*EXPORT = *Lemonldap::NG::Portal::Simple::EXPORT;
our $VERSION = "0.2";
our $VERSION = "0.3";
our @ISA = qw(Lemonldap::NG::Portal::Simple);
sub getConf {
......@@ -19,6 +19,7 @@ sub getConf {
my $tmp = $self->{lmConf}->getConf;
return 0 unless $tmp;
$self->{$_} = $tmp->{$_} foreach(keys %$tmp);
1;
}
sub setGroups {
......
......@@ -12,7 +12,7 @@ use MIME::Base64;
*EXPORT_TAGS = *Lemonldap::NG::Portal::SharedConf::EXPORT_TAGS;
*EXPORT = *Lemonldap::NG::Portal::SharedConf::EXPORT;
our $VERSION = '0.2';
our $VERSION = '0.3';
our @ISA = qw(Lemonldap::NG::Portal::SharedConf);
......@@ -88,7 +88,7 @@ constructor C<new()>:
=over
=item * B<dbiChain>: the string to use to connect to the database. Ex:
"dbi:mysql:database:sso_config:host:127.0.0.1",
"dbi:mysql:database:lmSessions:host:127.0.0.1",
=item * B<dbiUser>: the name of the user to use to connect to the database if
needed,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment