From 8364a0e78dc114ac5a2a79401074886f84ff4ffa Mon Sep 17 00:00:00 2001
From: Xavier Guimard
Date: Mon, 25 Aug 2008 19:54:24 +0000
Subject: [PATCH] LEMONLDAP::NG : CPAN versions update and little doc update
---
modules/lemonldap-ng-handler/MANIFEST | 2 +
.../lib/Lemonldap/NG/Handler.pm | 2 +-
.../lib/Lemonldap/NG/Handler/Simple.pm | 2 +-
.../lib/Lemonldap/NG/Handler/Vhost.pm | 2 +-
modules/lemonldap-ng-manager/MANIFEST | 4 +-
.../lib/Lemonldap/NG/Manager.pm | 2 +-
.../lib/Lemonldap/NG/Manager/Help.pm | 65 ++++++++++++++++---
.../lib/Lemonldap/NG/Manager/_HTML.pm | 2 +-
.../lib/Lemonldap/NG/Manager/_i18n.pm | 2 +-
.../lib/Lemonldap/NG/Portal.pm | 2 +-
.../lib/Lemonldap/NG/Portal/Simple.pm | 2 +-
11 files changed, 68 insertions(+), 19 deletions(-)
diff --git a/modules/lemonldap-ng-handler/MANIFEST b/modules/lemonldap-ng-handler/MANIFEST
index 77f4000bb..b1011f878 100644
--- a/modules/lemonldap-ng-handler/MANIFEST
+++ b/modules/lemonldap-ng-handler/MANIFEST
@@ -2,9 +2,11 @@ Changes
example/autoProtectedCGI.pl
example/lmH-apache.conf
example/lmH-apache2.conf
+example/menu.pl
example/MyHandler.pm
example/MyHandlerLog4Perl.pm
lib/Lemonldap/NG/Handler.pm
+lib/Lemonldap/NG/Handler/AuthBasic.pm
lib/Lemonldap/NG/Handler/CDA.pm
lib/Lemonldap/NG/Handler/CGI.pm
lib/Lemonldap/NG/Handler/Proxy.pm
diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm
index e7eba6bb9..051882965 100644
--- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm
+++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler.pm
@@ -2,7 +2,7 @@ package Lemonldap::NG::Handler;
print STDERR
"See Lemonldap::NG::Handler(3) to know which Lemonldap::NG::Handler::* module to use.";
-our $VERSION = "0.88";
+our $VERSION = "0.89";
1;
diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm
index 4e49a469f..9d2504d26 100644
--- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm
+++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Simple.pm
@@ -8,7 +8,7 @@ use Safe;
require Data::Dumper;
require POSIX;
-our $VERSION = '0.88';
+our $VERSION = '0.89';
our %EXPORT_TAGS;
diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm
index 8457dde03..62b6c6b02 100644
--- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm
+++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Vhost.pm
@@ -4,7 +4,7 @@ use Lemonldap::NG::Handler::Simple qw(:locationRules :headers);
use strict;
use MIME::Base64;
-our $VERSION = '0.52';
+our $VERSION = '0.53';
# TODO: split locationRules into 2 arrays
sub locationRulesInit {
diff --git a/modules/lemonldap-ng-manager/MANIFEST b/modules/lemonldap-ng-manager/MANIFEST
index 3b9ccf935..043a54e8a 100644
--- a/modules/lemonldap-ng-manager/MANIFEST
+++ b/modules/lemonldap-ng-manager/MANIFEST
@@ -19,7 +19,7 @@ example/imgs/iconJob.gif
example/imgs/iconReport.gif
example/imgs/iconTask.gif
example/imgs/iconTimeRecordsEdit.gif
-example/imgs/iconUnCheckAll.gif
+example/imgs/iconUncheckAll.gif
example/imgs/item.gif
example/imgs/item2.gif
example/imgs/leaf.gif
@@ -50,9 +50,9 @@ example/lmConfig.mysql
example/scripts/lmConfigEditor
example/scripts/lmSessionDump
example/soapserver.pl
-example/theme/logo_lemonldap-ng.png
example/theme/default.css
example/theme/hatch.gif
+example/theme/logo_lemonldap-ng.png
lib/Lemonldap/NG/Manager.pm
lib/Lemonldap/NG/Manager/_HTML.pm
lib/Lemonldap/NG/Manager/_i18n.pm
diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
index 259a7668e..e5e21f554 100644
--- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
+++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
@@ -17,7 +17,7 @@ use MIME::Base64;
our @ISA = qw(Lemonldap::NG::Manager::Base);
-our $VERSION = '0.85';
+our $VERSION = '0.86';
sub new {
my ( $class, $args ) = @_;
diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm
index 9e6a6bccf..f9fa7939a 100644
--- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm
+++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Help.pm
@@ -1,7 +1,7 @@
package Lemonldap::NG::Manager::Help;
use AutoLoader qw(AUTOLOAD);
-our $VERSION = '0.35';
+our $VERSION = '0.36';
sub import {
my ($caller_package) = caller;
@@ -300,14 +300,37 @@ This mechanism avoid to do more than one time the same operation in the
authentication phase. Example :
# macros
- long_name => \$givenname . " " . \$surname
- admin => \$uid eq "foo" or \$uid eq "bar"
+ long_name => \$givenname . " " . \$surname
+ admin => \$uid eq "foo" or \$uid eq "bar"
# test.example.com - Headers
- Name => \$long_name
+ Name => \$long_name
# test.example.com - Rules
- ^/admin/ => \$admin
+ ^/admin/ => \$admin
+
+
+ Tips
+
+ Redefining LDAP attributes
+ You can create a macro with the same name than an exported value. If so,
+the attribute is redefined. Example :
+
+ uid => $uid . "\\\@domain.com"
+
+
+ Using regexp
+
+ Suppose you want to extract the string 'admin' or 'user' in an attribute,
+in Perl, you can use \$mail =~ s/^.*(user|admin)/\$1/. To
+use it in Lemonldap::NG, you have to do the following :
+
+ mail => (\$mail =~ /(user|admin)/)[0]
+
+ Explanation : '\$mail =~ /(user|admin)/' returns 0 or 1, but
+'(\$mail =~ /(user|admin)/)' is a "list context" so it returns an array
+containing all elements recognized. So '(\$mail =~ /(user|admin)/)[0]'
+returns the first element.
EOT
}
@@ -321,14 +344,38 @@ Elles évitent de répéter le même calcul plusieurs
fois dans la phase d'authentification. Exemple :
# macros
- nom_complet => \$givenname . " " . \$surname
- admin => \$uid eq "foo" or \$uid eq "bar"
+ nom_complet => \$givenname . " " . \$surname
+ admin => \$uid eq "foo" or \$uid eq "bar"
# test.example.com - En-têtes
- Nom => \$nom_complet
+ Nom => \$nom_complet
# test.example.com - Règles
- ^/admin/ => \$admin
+ ^/admin/ => \$admin
+
+
+ Astuces
+
+ Redéfinir les attributs LDAP
+ Une macro peut porter le même nom
+You can create a macro with the same name than an exported value. If so,
+the attribute is redefined. Example :
+
+ uid => $uid . "\\\@domain.com"
+
+
+ Using regexp
+
+ Suppose you want to extract the string 'admin' or 'user' in an attribute,
+in Perl, you can use \$mail =~ s/^.*(user|admin)/\$1/. To
+use it in Lemonldap::NG, you have to do the following :
+
+ mail => (\$mail =~ /(user|admin)/)[0]
+
+ Explanation : '\$mail =~ /(user|admin)/' returns 0 or 1, but
+'(\$mail =~ /(user|admin)/)' is a "list context" so it returns an array
+containing all elements recognized. So '(\$mail =~ /(user|admin)/)[0]'
+returns the first element.
EOT
}
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 e0f9fd7c2..6ed66a43f 100644
--- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm
+++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm
@@ -8,7 +8,7 @@ use AutoLoader qw(AUTOLOAD);
require Lemonldap::NG::Manager::_i18n;
use Lemonldap::NG::Manager::Conf::Constants;
-our $VERSION = '0.30';
+our $VERSION = '0.31';
# TODO: Delete buttons in headers and rules if 'read-only'
diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm
index 5054be73b..a50bfeaf4 100644
--- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm
+++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm
@@ -3,7 +3,7 @@ package Lemonldap::NG::Manager::_i18n;
# Developer warning : this file must be utf8 encoded
use AutoLoader qw(AUTOLOAD);
-our $VERSION = '0.32';
+our $VERSION = '0.33';
sub import {
my ($caller_package) = caller;
diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm
index 284a8fc29..07376b031 100644
--- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm
+++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal.pm
@@ -2,7 +2,7 @@ package Lemonldap::NG::Portal;
print STDERR
"See Lemonldap::NG::Portal(3) to know which Lemonldap::NG::Portal::* module to use.";
-our $VERSION = "0.84";
+our $VERSION = "0.85";
1;
diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm
index 1d7360499..d3b7a60f9 100644
--- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm
+++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm
@@ -13,7 +13,7 @@ use CGI::Cookie;
require POSIX;
use Lemonldap::NG::Portal::_i18n;
-our $VERSION = '0.84';
+our $VERSION = '0.85';
our @ISA = qw(CGI Exporter);