diff --git a/build/lemonldap-ng/debian/handler-apache.conf b/build/lemonldap-ng/debian/handler-apache.conf
index 914c52150..edfe34e1d 100644
--- a/build/lemonldap-ng/debian/handler-apache.conf
+++ b/build/lemonldap-ng/debian/handler-apache.conf
@@ -1,7 +1,7 @@
ServerName protected.example.com
- PerlRequire /var/lib/lemonldap-ng/handler/MyHandler.pm
+ PerlRequire /var/lib/lemonldap-ng/handler/MyHandler.pm
# Area protection
PerlHeaderParserHandler My::Package
@@ -15,9 +15,12 @@
PerlHeaderParserHandler My::Package->refresh
- # Optional interception of the logout URL => single logout
- # if not done in configuration interface
-
- PerlHeaderParserHandler My::Package->logout
-
+ # Uncomment this to activate status module
+ #
+ # Order deny,allow
+ # Deny from all
+ # Allow from 127.0.0.0/8
+ # PerlHeaderParserHandler My::Package->status
+ #
+
diff --git a/build/lemonldap-ng/debian/handler-apache2.conf b/build/lemonldap-ng/debian/handler-apache2.conf
index 85fa72bbe..115ba178c 100644
--- a/build/lemonldap-ng/debian/handler-apache2.conf
+++ b/build/lemonldap-ng/debian/handler-apache2.conf
@@ -1,8 +1,8 @@
PerlOptions +GlobalRequest
+
ServerName protected.example.com
PerlRequire /var/lib/lemonldap-ng/handler/MyHandler.pm
-
# Area protection
PerlHeaderParserHandler My::Package
@@ -16,9 +16,12 @@ PerlOptions +GlobalRequest
PerlHeaderParserHandler My::Package->refresh
- # Optional interception of the logout URL => single logout
- # if not done in configuration interface
-
- PerlHeaderParserHandler My::Package->logout
-
+ # Uncomment this to activate status module
+ #
+ # Order deny,allow
+ # Deny from all
+ # Allow from 127.0.0.0/8
+ # PerlHeaderParserHandler My::Package->status
+ #
+
diff --git a/build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.examples b/build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.examples
index 3d854f18b..02912849b 100644
--- a/build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.examples
+++ b/build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.examples
@@ -1,2 +1,2 @@
debian/tmp/var/lib/lemonldap-ng/handler/*
-debian/handler-apache*.conf
+debian/tmp/var/lib/lemonldap-ng/apache*-protected-area.conf
diff --git a/build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.postinst b/build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.postinst
index 93ec33197..574b66f54 100755
--- a/build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.postinst
+++ b/build/lemonldap-ng/debian/liblemonldap-ng-handler-perl.postinst
@@ -3,16 +3,13 @@
. /usr/share/debconf/confmodule
-EXAMPLEHANDLERFILE=/usr/share/doc/liblemonldap-ng-handler-perl/examples/MyHandler.pm
+EXAMPLEHANDLERFILE=/usr/share/doc/liblemonldap-ng-handler-perl/examples/MyHandler-Debian.pm
HANDLERFILE=/var/lib/lemonldap-ng/handler/MyHandler.pm
SESSIONSDIR=/var/lib/lemonldap-ng/sessions
if [ "$1" == "configure" ]
then
- [ -e $HANDLERFILE ] || \
- perl -000 -pe 's/(configStorage\s*=>\s*){[^}]+}/$1\$Lemonldap::NG::Conf::configStorage/;
- s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
- $EXAMPLEHANDLERFILE >$HANDLERFILE
+ [ -e $HANDLERFILE ] || cp $EXAMPLEHANDLERFILE $HANDLERFILE
chmod 770 $SESSIONSDIR
chmod 770 $SESSIONSDIR/lock
chown -R www-data.www-data $SESSIONSDIR
diff --git a/build/lemonldap-ng/debian/liblemonldap-ng-manager-perl.postinst b/build/lemonldap-ng/debian/liblemonldap-ng-manager-perl.postinst
index c167ec8eb..fb6e62765 100755
--- a/build/lemonldap-ng/debian/liblemonldap-ng-manager-perl.postinst
+++ b/build/lemonldap-ng/debian/liblemonldap-ng-manager-perl.postinst
@@ -3,16 +3,12 @@
. /usr/share/debconf/confmodule
-EXAMPLEMANAGERFILE=/usr/share/doc/liblemonldap-ng-manager-perl/examples/index.pl
+EXAMPLEMANAGERFILE=/usr/share/doc/liblemonldap-ng-manager-perl/examples/index-Debian.pl
MANAGERFILE=/var/lib/lemonldap-ng/manager/index.pl
if [ "$1" == "configure" ]
then
- [ -e $MANAGERFILE ] || \
- perl -000 -pe 's/(configStorage\s*=>\s*){[^}]+}/$1\$Lemonldap::NG::Conf::configStorage/;
- s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;
- s#(applyConfFile\s*=>\s*)(['"'"'"]).*?\2#$1$2/etc/lemonldap-ng/apply.conf$2#' \
- $EXAMPLEMANAGERFILE >$MANAGERFILE
+ [ -e $MANAGERFILE ] || cp $EXAMPLEMANAGERFILE $MANAGERFILE
chmod +x $MANAGERFILE
chgrp www-data /etc/lemonldap-ng/apply.conf
chmod 640 /etc/lemonldap-ng/apply.conf
diff --git a/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.postinst b/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.postinst
index 53ecc7c19..479e6b9db 100644
--- a/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.postinst
+++ b/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.postinst
@@ -3,29 +3,17 @@
. /usr/share/debconf/confmodule
-LAEXAMPLEPORTALFILE=/usr/share/doc/liblemonldap-ng-portal-perl/examples/liberty-alliance-sp-portal/index.pl
+LAEXAMPLEPORTALFILE=/usr/share/doc/liblemonldap-ng-portal-perl/examples/liberty-alliance-sp-portal/index-Debian.pl
LAPORTALFILE=/var/lib/lemonldap-ng/liberty-alliance-sp-portal/index.pl
-EXAMPLEPORTALFILE=/usr/share/doc/liblemonldap-ng-portal-perl/examples/index_skin.pl
+EXAMPLEPORTALFILE=/usr/share/doc/liblemonldap-ng-portal-perl/examples/index_skin-Debian.pl
PORTALFILE=/var/lib/lemonldap-ng/portal/index.pl
-CLEANERFILE=/usr/share/lemonldap-ng/bin/purgeCentralCache
SESSIONSDIR=/var/lib/lemonldap-ng/sessions
if [ "$1" == "configure" ]
then
- [ -e $LAPORTALFILE ] || \
- perl -000 -pe 's/(configStorage\s*=>\s*){[^}]+}/$1\$Lemonldap::NG::Conf::configStorage/;
- s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
- $LAEXAMPLEPORTALFILE >$LAPORTALFILE
- [ -e $PORTALFILE ] || \
- perl -000 -pe 's/(configStorage\s*=>\s*){[^}]+}/$1\$Lemonldap::NG::Conf::configStorage/;
- s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
- $EXAMPLEPORTALFILE >$PORTALFILE
- [ -e $CLEANERFILE ] || \
- perl -i -000 -pe 's/(configStorage\s*=>\s*){[^}]+}/$1\$Lemonldap::NG::Conf::configStorage/;
- s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
- $CLEANERFILE
+ [ -e $LAPORTALFILE ] || cp $LAEXAMPLEPORTALFILE $LAPORTALFILE
+ [ -e $PORTALFILE ] || cp $EXAMPLEPORTALFILE $PORTALFILE
chmod +x $PORTALFILE
- chmod +x $CLEANERFILE
chmod +x $LAPORTALFILE
chmod 770 $SESSIONSDIR
chmod 770 $SESSIONSDIR/lock
diff --git a/build/lemonldap-ng/debian/rules b/build/lemonldap-ng/debian/rules
index fa3129f5c..676b13ba9 100755
--- a/build/lemonldap-ng/debian/rules
+++ b/build/lemonldap-ng/debian/rules
@@ -11,6 +11,8 @@
export PERL_MM_USE_DEFAULT=1
+LM_ROOT=/var/lib/lemonldap-ng/
+DEB_TMP_LM_ROOT=debian/tmp$(LM_ROOT)
configure: configure-stamp
configure-stamp:
@@ -51,33 +53,47 @@ install: build
$(MAKE) test
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr
$(MAKE) example \
- EXAMPLEDIRBUILD=debian/tmp/var/lib/lemonldap-ng/ \
- EXAMPLEDIR=/var/lib/lemonldap-ng/ \
- EXAMPLECONFDIR=/var/lib/lemonldap-ng/conf/ \
- EXAMPLELASPDIRBUILD=debian/tmp/var/lib/lemonldap-ng/liberty-alliance-sp-portal/ \
- EXAMPLELASPDIR=/var/lib/lemonldap-ng/liberty-alliance-sp-portal/
- cp debian/tmp/var/lib/lemonldap-ng/handler/MyHandler.pm debian/tmp/var/lib/lemonldap-ng/handler/MyHandler-Debian.pm
- mv debian/tmp/var/lib/lemonldap-ng/index.pl debian/tmp/var/lib/lemonldap-ng/test.pl
- mv debian/tmp/var/lib/lemonldap-ng/handler/lmH-apache.conf debian/tmp/var/lib/lemonldap-ng/apache-protected-area.conf
- mv debian/tmp/var/lib/lemonldap-ng/handler/lmH-apache2.conf debian/tmp/var/lib/lemonldap-ng/apache2-protected-area.conf
- perl -000 -i -pe 's/(new\s*\(\s*){[^}]+}/$$1\$$Lemonldap::NG::Conf::configStorage/; s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
- debian/tmp/var/lib/lemonldap-ng/manager/scripts/lmConfigEditor \
- debian/tmp/var/lib/lemonldap-ng/handler/MyHandler-Debian.pm \
- debian/tmp/var/lib/lemonldap-ng/portal/scripts/purgeCentralCache
+ EXAMPLEDIRBUILD=$(DEB_TMP_LM_ROOT) \
+ EXAMPLEDIR=$(LM_ROOT) \
+ EXAMPLECONFDIR=$(LM_ROOT)conf/ \
+ EXAMPLELASPDIRBUILD=$(DEB_TMP_LM_ROOT)liberty-alliance-sp-portal/ \
+ EXAMPLELASPDIR=$(LM_ROOT)liberty-alliance-sp-portal/
+ # Debian example files
+ cp $(DEB_TMP_LM_ROOT)handler/MyHandler.pm $(DEB_TMP_LM_ROOT)handler/MyHandler-Debian.pm
+ cp $(DEB_TMP_LM_ROOT)portal/index.pl $(DEB_TMP_LM_ROOT)portal/index-Debian.pl
+ cp $(DEB_TMP_LM_ROOT)portal/index_skin.pl $(DEB_TMP_LM_ROOT)portal/index_skin-Debian.pl
+ cp $(DEB_TMP_LM_ROOT)liberty-alliance-sp-portal/index.pl $(DEB_TMP_LM_ROOT)liberty-alliance-sp-portal/index-Debian.pl
+ cp $(DEB_TMP_LM_ROOT)manager/index.pl $(DEB_TMP_LM_ROOT)manager/index-Debian.pl
+ mv $(DEB_TMP_LM_ROOT)index.pl $(DEB_TMP_LM_ROOT)test.pl
+ mv $(DEB_TMP_LM_ROOT)handler/lmH-apache.conf $(DEB_TMP_LM_ROOT)apache-protected-area.conf
+ mv $(DEB_TMP_LM_ROOT)handler/lmH-apache2.conf $(DEB_TMP_LM_ROOT)apache2-protected-area.conf
+ perl -i -pe 's#__DIR__/?#'/var/lib/lemonldap-ng'#g;s#__CONFDIR__/?#'$(LM_ROOT)conf'#g;' \
+ $(DEB_TMP_LM_ROOT)apache*-protected-area.conf
+
+ # System to use /etc/lemonldap-ng/storage.conf instead of setting
+ # manually the configStorage parameter
+ perl -000 -i -pe 's/(Lemonldap::NG::Manager::Conf.*new\s*\(\s*){[^}]+}/$$1\$$Lemonldap::NG::Conf::configStorage/; s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
+ $(DEB_TMP_LM_ROOT)manager/scripts/lmConfigEditor \
+ $(DEB_TMP_LM_ROOT)portal/scripts/purgeCentralCache
+
+ perl -000 -i -pe 's/(configStorage\s*=>\s*){[^}]+}/$$1\$$Lemonldap::NG::Conf::configStorage/; s#^use#\nrequire "/usr/share/lemonldap-ng/configStorage.pm";\nuse#m;' \
+ $(DEB_TMP_LM_ROOT)handler/MyHandler-Debian.pm \
+ $(DEB_TMP_LM_ROOT)manager/index-Debian.pl \
+ $(DEB_TMP_LM_ROOT)portal/index-Debian.pl \
+ $(DEB_TMP_LM_ROOT)portal/index_skin-Debian.pl \
+ $(DEB_TMP_LM_ROOT)liberty-alliance-sp-portal/index-Debian.pl
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs changelog
dh_installdocs
- mkdir debian/tmp/var/lib/lemonldap-ng/protected
- cp _example/index.pl debian/tmp/var/lib/lemonldap-ng/protected
+ mkdir $(DEB_TMP_LM_ROOT)protected
find debian/tmp/var/lib/lemonldap-ng -type f -perm /111 -exec chmod -x {} \;
- chmod +x debian/tmp/var/lib/lemonldap-ng/manager/scripts/lmConfigEditor
+ chmod +x $(DEB_TMP_LM_ROOT)manager/scripts/lmConfigEditor
find debian/tmp/var/lib/lemonldap-ng -type f -name *.pl -exec chmod +x {} \;
dh_installexamples
- find debian/lemonldap-ng -type f -exec perl -i -pe 's#__DIR__/?#'/var/lib/lemonldap-ng'#g;s#__CONFDIR__/?#'/var/lib/lemonldap-ng/conf'#g;' {} \;
dh_install
chmod +x debian/liblemonldap-ng-portal-perl/usr/share/lemonldap-ng/bin/purgeCentralCache
# dh_installmenu
diff --git a/modules/lemonldap-ng-handler/example/lmH-apache.conf b/modules/lemonldap-ng-handler/example/lmH-apache.conf
index 00795375a..6737b58b3 100644
--- a/modules/lemonldap-ng-handler/example/lmH-apache.conf
+++ b/modules/lemonldap-ng-handler/example/lmH-apache.conf
@@ -2,7 +2,12 @@
ServerName test.example.com
PerlRequire __DIR__/handler/MyHandler.pm
+ # Area protection
PerlHeaderParserHandler My::Package
+
+ # Configuration reload mechanism (only 1 per physical server is
+ # needed): choose your URL to avoid restarting Apache when
+ # configuration change
Order deny,allow
Deny from all
diff --git a/modules/lemonldap-ng-handler/example/lmH-apache2.conf b/modules/lemonldap-ng-handler/example/lmH-apache2.conf
index ce9b05f27..5d65478e0 100644
--- a/modules/lemonldap-ng-handler/example/lmH-apache2.conf
+++ b/modules/lemonldap-ng-handler/example/lmH-apache2.conf
@@ -1,38 +1,43 @@
PerlOptions +GlobalRequest
- ServerName test.example.com
- PerlRequire __DIR__/handler/MyHandler.pm
- PerlHeaderParserHandler My::Package
-
- Order deny,allow
- Deny from all
- Allow from 127.0.0.0/8
- PerlHeaderParserHandler My::Package->refresh
-
+ ServerName test.example.com
+ PerlRequire __DIR__/handler/MyHandler.pm
+ # Area protection
+ PerlHeaderParserHandler My::Package
+
+ # Configuration reload mechanism (only 1 per physical server is
+ # needed): choose your URL to avoid restarting Apache when
+ # configuration change
+
+ Order deny,allow
+ Deny from all
+ Allow from 127.0.0.0/8
+ PerlHeaderParserHandler My::Package->refresh
+
# Uncomment this to activate status module
- #
- # Order deny,allow
- # Deny from all
- # Allow from 127.0.0.0/8
- # PerlHeaderParserHandler My::Package->status
- #
+ #
+ # Order deny,allow
+ # Deny from all
+ # Allow from 127.0.0.0/8
+ # PerlHeaderParserHandler My::Package->status
+ #
- # Just to make example running (index.pl display authenticated user)
- DocumentRoot __DIR__
-
- Order allow,deny
- Allow from all
- Options +ExecCGI
-
-
- SetHandler perl-script
- PerlResponseHandler ModPerl::Registry
-
+ # Just to make example running (index.pl display authenticated user)
+ DocumentRoot __DIR__
+
+ Order allow,deny
+ Allow from all
+ Options +ExecCGI
+
+
+ SetHandler perl-script
+ PerlResponseHandler ModPerl::Registry
+
-
- DirectoryIndex index.pl index.html
-
+
+ DirectoryIndex index.pl index.html
+
diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
index 53ee212fd..e90acd798 100644
--- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
+++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
@@ -102,7 +102,7 @@ sub print_libjs {
sub print_lmjs {
my $self = shift;
print $self->header_public( $ENV{SCRIPT_FILENAME},
- -type => 'text/javascript' );
+ -type => 'text/javascript; charset=utf8' );
$self->javascript;
}
@@ -136,7 +136,7 @@ sub print_delete {
# Configuration download subroutines
sub print_conf {
my $self = shift;
- print $self->header( -type => "text/xml", '-Cache-Control' => 'private' );
+ print $self->header( -type => "text/xml; charset=utf8", '-Cache-Control' => 'private' );
$self->printXmlConf( { cfgNum => $self->param('cfgNum'), } );
exit;
}
@@ -157,6 +157,7 @@ sub printXmlConf {
KeyAttr => { item => 'id', username => 'name' },
NoIndent => 1,
NoSort => 0,
+ XMLDecl => '',
);
}
@@ -349,7 +350,7 @@ sub xmlField {
sub print_upload {
my $self = shift;
my $datas = shift;
- print $self->header( -type => "text/javascript" );
+ print $self->header( -type => "text/javascript; charset=utf8" );
my $r = Lemonldap::NG::Manager::_Response->new();
my $tmp = $self->upload( $datas, $r );
if ( $tmp == 0 ) {
diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm
index c9a3328a6..84da0ee03 100644
--- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm
+++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm
@@ -74,17 +74,21 @@ EOT
sub javascript {
my $self = shift;
- Lemonldap::NG::Manager::_i18n::import( $ENV{HTTP_ACCEPT_LANGUAGE} ) unless(__PACKAGE__->can('txt_newVirtualHost'));
+ Lemonldap::NG::Manager::_i18n::import( $ENV{HTTP_ACCEPT_LANGUAGE} )
+ unless ( __PACKAGE__->can('txt_newVirtualHost') );
my %text;
- foreach(qw(newVirtualHost newMacro newGroup newVar newGSOpt saveConf
+ foreach (
+ qw(newVirtualHost newMacro newGroup newVar newGSOpt saveConf
deleteNode locationRules unableToSave confSaved saveFailure
newRule newHeader httpHeaders waitingResult unknownError
configurationWasChanged configLoaded warningConfNotApplied
applyConf prevConf lastConf nextConf deleteVirtualHost
areYouSure syntaxError deleteConf confirmDeleteConf
- invalidVirtualHostName)) {
+ invalidVirtualHostName)
+ )
+ {
$text{$_} = &{"txt_$_"};
- $text{$_} =~s/'/\\'/g;
+ $text{$_} =~ s/'/\\'/g;
}
print qq#
function loadConf(n) {
@@ -209,7 +213,7 @@ function onNodeSelect(nodeId) {
+button('$text{lastConf}','lastConf',nodeId)
+button('$text{deleteConf}','deleteConf',nodeId);
#;
- if( $self->{applyConfFile} ) {
+ if ( $self->{applyConfFile} ) {
print "but+=button('$text{applyConf}','applyConf',nodeId);";
}
print qq#
@@ -410,19 +414,20 @@ sub start_html {
$args{'-style'} = { -src => [ $args{'-style'} ] }
if ( $args{'-style'} and !ref( $args{'-style'} ) );
unshift @{ $args{'-style'}->{'-src'} }, "$ENV{SCRIPT_NAME}?lmQuery=css";
- $args{'-title'} ||= 'Lemonldap::NG Configuration';
+ $args{'-title'} ||= 'Lemonldap::NG Configuration';
+ $args{'-encoding'} ||= 'utf8';
$self->CGI::start_html(%args);
}
sub main {
- Lemonldap::NG::Manager::_i18n::import( $ENV{HTTP_ACCEPT_LANGUAGE} ) unless(__PACKAGE__->can('txt_field'));
+ Lemonldap::NG::Manager::_i18n::import( $ENV{HTTP_ACCEPT_LANGUAGE} )
+ unless ( __PACKAGE__->can('txt_field') );
my %text;
- foreach(qw(field value)) {
+ foreach (qw(field value)) {
$text{$_} = &{"txt_$_"};
- $text{$_} =~s/'/\\'/g;
+ $text{$_} =~ s/'/\\'/g;
}
-
# Lemonldap::Manager javascripts;
print
qq#\n#;
diff --git a/modules/lemonldap-ng-portal/t/01-Lemonldap-NG-Portal-Simple.t b/modules/lemonldap-ng-portal/t/01-Lemonldap-NG-Portal-Simple.t
index 5d32bdb10..1ceafb6fd 100644
--- a/modules/lemonldap-ng-portal/t/01-Lemonldap-NG-Portal-Simple.t
+++ b/modules/lemonldap-ng-portal/t/01-Lemonldap-NG-Portal-Simple.t
@@ -77,7 +77,7 @@ $p->{search} = sub { PE_OK };
$p->{setSessionInfo} = sub { PE_OK };
$p->{unbind} = sub { PE_OK };
$p->{store} = sub { PE_OK };
-ok( $p->process == PE_OK , 'User OK' );
+ok( $p->process, 'User OK' );
# Cookie test
$p->{id} = 1;