New target 'tidy' in Makefile

This commit is contained in:
Xavier Guimard 2010-03-01 20:32:28 +00:00
parent b5e2407728
commit 40d2c70604
42 changed files with 638 additions and 615 deletions

View File

@ -592,3 +592,7 @@ default-diff:
@$(DIFF) lemonldap-ng-manager/example/index.pl $(LMPREFIX)/htdocs/manager/index.pl ||true
@$(DIFF) lemonldap-ng-manager/example/sessions.pl $(LMPREFIX)/htdocs/manager/sessions.pl ||true
tidy: clean
find lemon*/ -type f -name '*.pm' -exec perltidy -b {} \;
find lemon*/ -name '*.bak' -delete

View File

@ -1,6 +1,6 @@
package Lemonldap::NG::Common;
our $VERSION='0.95';
our $VERSION = '0.95';
use strict;

View File

@ -194,12 +194,12 @@ sub get_key_from_all_sessions() {
my $r = $self->_soapCall( "get_key_from_all_sessions", $args );
my $res;
if ($r) {
foreach my $k ( keys %$r ) {
my $tmp = &$data( $r->{$k}, $k );
$res->{$k} = $tmp if ( defined($tmp) );
foreach my $k ( keys %$r ) {
my $tmp = &$data( $r->{$k}, $k );
$res->{$k} = $tmp if ( defined($tmp) );
}
}
}
}
else {
return $self->_soapCall( "get_key_from_all_sessions", $args, $data );
}

View File

@ -127,8 +127,10 @@ sub soapTest {
# If non form encoded datas are posted, we call SOAP Services
if ( $ENV{HTTP_SOAPACTION} ) {
require Lemonldap::NG::Common::CGI::SOAPServer; #link protected dispatcher
require Lemonldap::NG::Common::CGI::SOAPService; #link protected soapService
require
Lemonldap::NG::Common::CGI::SOAPServer; #link protected dispatcher
require
Lemonldap::NG::Common::CGI::SOAPService; #link protected soapService
my @func = (
ref($soapFunctions) ? @$soapFunctions : split /\s+/,
$soapFunctions

View File

@ -15,9 +15,9 @@ our $VERSION = '0.2';
# @param @func authorizated methods
# @return Lemonldap::NG::Common::CGI::SOAPService object
sub new {
my($class, $obj, @func) = @_;
s/.*::// foreach(@func);
return bless {obj=>$obj,func=>\@func}, $class;
my ( $class, $obj, @func ) = @_;
s/.*::// foreach (@func);
return bless { obj => $obj, func => \@func }, $class;
}
## @method datas AUTOLOAD()
@ -29,14 +29,14 @@ sub new {
sub AUTOLOAD {
my $self = shift;
$AUTOLOAD =~ s/.*:://;
if(grep {$_ eq $AUTOLOAD} @{$self->{func}}){
if ( grep { $_ eq $AUTOLOAD } @{ $self->{func} } ) {
my $tmp = $self->{obj}->$AUTOLOAD(@_);
unless(ref($tmp) and ref($tmp) eq 'SOAP::Data') {
unless ( ref($tmp) and ref($tmp) eq 'SOAP::Data' ) {
$tmp = SOAP::Data->name( result => $tmp );
}
return $tmp;
}
elsif($AUTOLOAD ne 'DESTROY') {
elsif ( $AUTOLOAD ne 'DESTROY' ) {
die "$AUTOLOAD is not an authorizated function";
}
1;

View File

@ -9,7 +9,7 @@ package Lemonldap::NG::Common::Conf;
use strict;
no strict 'refs';
use Lemonldap::NG::Common::Conf::Constants; #inherits
use Lemonldap::NG::Common::Conf::Constants; #inherits
use Lemonldap::NG::Common::Crypto
; #link protected cipher Object "cypher" in configuration hash
use Regexp::Assemble;

View File

@ -3,7 +3,7 @@ package Lemonldap::NG::Common::Conf::CDBI;
use strict;
use DBI;
require Storable;
use Lemonldap::NG::Common::Conf::Constants; #inherits
use Lemonldap::NG::Common::Conf::Constants; #inherits
our $VERSION = 0.1;
@ -84,7 +84,8 @@ sub store {
$fields =~ s/'/''/gs;
my $tmp =
$self->_dbh->do( "insert into "
. $self->{dbiTable} . " (cfgNum,data) values ($cfgNum,'$fields')");
. $self->{dbiTable}
. " (cfgNum,data) values ($cfgNum,'$fields')" );
unless ($tmp) {
$self->logError;
return UNKNOWN_ERROR;
@ -107,9 +108,10 @@ sub load {
return 0;
}
my $r;
eval { $r = Storable::thaw($row->[1]); } ;
eval { $r = Storable::thaw( $row->[1] ); };
if ($@) {
$Lemonldap::NG::Common::Conf::msg = "Bad stored data in conf database: $@";
$Lemonldap::NG::Common::Conf::msg =
"Bad stored data in conf database: $@";
return 0;
}
return $r;

View File

@ -1,7 +1,7 @@
package Lemonldap::NG::Common::Conf::File;
use strict;
use Lemonldap::NG::Common::Conf::Constants; #inherits
use Lemonldap::NG::Common::Conf::Constants; #inherits
use Lemonldap::NG::Common::Conf::Serializer;
our $VERSION = 0.23;
@ -74,8 +74,8 @@ sub store {
$self->unlock;
return UNKNOWN_ERROR;
}
foreach my $k (sort keys %$fields) {
print FILE "$k\n\t$fields->{$k}\n\n";
foreach my $k ( sort keys %$fields ) {
print FILE "$k\n\t$fields->{$k}\n\n";
}
close FILE;
umask($mask);

View File

@ -13,7 +13,7 @@ use Lemonldap::NG::Common::Conf::Serializer;
our $VERSION = 0.02;
BEGIN {
*Lemonldap::NG::Common::Conf::ldap = \&ldap;
*Lemonldap::NG::Common::Conf::ldap = \&ldap;
}
sub prereq {
@ -56,7 +56,7 @@ sub lastCfg {
sub ldap {
my $self = shift;
return $self->{ldap} if($self->{ldap});
return $self->{ldap} if ( $self->{ldap} );
# Parse servers configuration
my $useTls = 0;
@ -106,16 +106,19 @@ sub ldap {
}
sub lock {
# No lock for LDAP
return 1;
}
sub isLocked {
# No lock for LDAP
return 0;
}
sub unlock {
# No lock for LDAP
return 1;
}

View File

@ -119,7 +119,7 @@ sub load {
while ( @row = $sth->fetchrow_array ) {
$res->{ $row[1] } = $row[2];
}
unless($res) {
unless ($res) {
$Lemonldap::NG::Common::Conf::msg .= "No configuration $cfgNum found";
return 0;
}

View File

@ -218,7 +218,7 @@ sub toXML {
# Return this object in configuration string format.
# @return string
sub toConf {
my $self = shift;
my $self = shift;
my $fields = $self->toHash();
local $Data::Dumper::Indent = 0;
local $Data::Dumper::Varname = "data";
@ -233,11 +233,10 @@ sub toConf {
# Return this object in configuration hash format.
# @return hashref
sub toHash {
my $self = shift;
my $self = shift;
my $fields = ();
foreach (keys %$self)
{
$fields->{$_} = $self->{$_};
foreach ( keys %$self ) {
$fields->{$_} = $self->{$_};
}
return $fields;
}

View File

@ -10,7 +10,7 @@ our $VERSION = 0.21;
BEGIN {
*Lemonldap::NG::Common::Conf::_soapCall = \&_soapCall;
*Lemonldap::NG::Common::Conf::_connect = \&_connect;
*Lemonldap::NG::Common::Conf::_connect = \&_connect;
sub SOAP::Transport::HTTP::Client::get_basic_credentials {
return $Lemonldap::NG::Common::Conf::SOAP::username =>

View File

@ -3,14 +3,14 @@ package Lemonldap::NG::Common::Conf::Serializer;
use Data::Dumper;
BEGIN {
*Lemonldap::NG::Common::Conf::serialize = \&serialize;
*Lemonldap::NG::Common::Conf::serialize = \&serialize;
*Lemonldap::NG::Common::Conf::unserialize = \&unserialize;
}
sub serialize {
my ( $self, $conf ) = @_;
my $fields;
local $Data::Dumper::Indent = 0;
local $Data::Dumper::Indent = 0;
local $Data::Dumper::Varname = "data";
while ( my ( $k, $v ) = each(%$conf) ) {
next if ( $k =~ /^(?:reVHosts|cipher)$/ );

View File

@ -66,7 +66,7 @@ sub decrypt {
$msg = '';
# Obscure Perl re bug...
$tmp .="\0";
$tmp .= "\0";
$tmp =~ s/\0*$//;
return $tmp;
}

View File

@ -23,7 +23,7 @@ our $functions = [qw(&checkLogonHours &checkDate)];
# @param $default_access optional what result to return for users without logons hours
# @return 1 if access allowed, 0 else
sub checkLogonHours {
my ($logon_hours, $syntax, $time_correction, $default_access) = @_;
my ( $logon_hours, $syntax, $time_correction, $default_access ) = @_;
# Active Directory - logonHours: $attr_src_syntax = octetstring
# Samba - sambaLogonHours: ???
@ -39,29 +39,31 @@ sub checkLogonHours {
# Begin with sunday at 0h00
my $base2_logon_hours;
if ( $syntax eq "octetstring" ) {
$base2_logon_hours = unpack ("B*", $logon_hours);
$base2_logon_hours = unpack( "B*", $logon_hours );
}
if ( $syntax eq "hexadecimal" ) {
# Remove white spaces
$logon_hours =~ s/ //g;
$base2_logon_hours = unpack ("B*", pack ("H*", $logon_hours));
$base2_logon_hours = unpack( "B*", pack( "H*", $logon_hours ) );
}
# Get the present day and hour
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
gmtime(time);
# Get the hour position
my $hourpos = $wday*24 + $hour;
my $hourpos = $wday * 24 + $hour;
# Use time_correction
if ($time_correction) {
my ($sign, $time) = ($time_correction =~ /([+|-]?)(\d+)/);
if ($sign =~ /-/) { $hourpos -= $time; }
else { $hourpos += $time; }
my ( $sign, $time ) = ( $time_correction =~ /([+|-]?)(\d+)/ );
if ( $sign =~ /-/ ) { $hourpos -= $time; }
else { $hourpos += $time; }
}
# Get the corresponding byte
return substr($base2_logon_hours, $hourpos, 1);
return substr( $base2_logon_hours, $hourpos, 1 );
}
## @function boolean checkDate(string start, string end, boolean default_access)
@ -71,15 +73,15 @@ sub checkLogonHours {
# @param $default_access optional what result to return for users without start or end start
# @return 1 if access allowed, 0 else
sub checkDate {
my ($start, $end, $default_access) = @_;
my ( $start, $end, $default_access ) = @_;
# Get date in string
$start = substr($start, 0, 14);
$end = substr($end, 0, 14);
$start = substr( $start, 0, 14 );
$end = substr( $end, 0, 14 );
# Default access if no value
$default_access ||= "0";
return $default_access unless ($start or $end);
return $default_access unless ( $start or $end );
# If no start, set start to 0
$start ||= 0;
@ -88,22 +90,22 @@ sub checkDate {
$end ||= 999999999999999;
# Get the present day and hour
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
gmtime(time);
$year += 1900;
$mon += 1;
$mon = "0".$mon if ($mon<10);
$mday = "0".$mday if ($mday<10);
$hour = "0".$hour if ($hour<10);
$min = "0".$min if ($min<10);
$sec = "0".$sec if ($sec<10);
$mon += 1;
$mon = "0" . $mon if ( $mon < 10 );
$mday = "0" . $mday if ( $mday < 10 );
$hour = "0" . $hour if ( $hour < 10 );
$min = "0" . $min if ( $min < 10 );
$sec = "0" . $sec if ( $sec < 10 );
my $date = $year.$mon.$mday.$hour.$min.$sec;
my $date = $year . $mon . $mday . $hour . $min . $sec;
return 1 if ( ($date >= $start) and ($date <= $end) );
return 1 if ( ( $date >= $start ) and ( $date <= $end ) );
return 0;
}
1;
__END__

View File

@ -7,11 +7,11 @@ __PACKAGE__->init(
# ACCESS TO CONFIGURATION
# By default, Lemonldap::NG uses the default lemonldap-ng.ini file to know
# where to find is configuration
# (generaly /etc/lemonldap-ng/lemonldap-ng.ini)
# You can specify by yourself this file :
#configStorage => { confFile => '/path/to/my/file' },
# By default, Lemonldap::NG uses the default lemonldap-ng.ini file to know
# where to find is configuration
# (generaly /etc/lemonldap-ng/lemonldap-ng.ini)
# You can specify by yourself this file :
#configStorage => { confFile => '/path/to/my/file' },
# You can also specify directly the configuration
# (see Lemonldap::NG::Handler::SharedConf(3))

View File

@ -20,11 +20,11 @@ __PACKAGE__->init(
# ACCESS TO CONFIGURATION
# By default, Lemonldap::NG uses the default lemonldap-ng.ini file to know
# where to find is configuration
# (generaly /etc/lemonldap-ng/lemonldap-ng.ini)
# You can specify by yourself this file :
#configStorage => { confFile => '/path/to/my/file' },
# By default, Lemonldap::NG uses the default lemonldap-ng.ini file to know
# where to find is configuration
# (generaly /etc/lemonldap-ng/lemonldap-ng.ini)
# You can specify by yourself this file :
#configStorage => { confFile => '/path/to/my/file' },
# You can also specify directly the configuration
# (see Lemonldap::NG::Handler::SharedConf(3))

View File

@ -25,7 +25,7 @@ our $VERSION = '0.4';
# @return new object
sub new {
my $class = shift;
my $self = $class->SUPER::new() or $class->abort("Unable to build CGI");
my $self = $class->SUPER::new() or $class->abort("Unable to build CGI");
$Lemonldap::NG::Handler::_CGI::_cgi = $self;
unless ($Lemonldap::NG::Handler::_CGI::cookieName) {
Lemonldap::NG::Handler::_CGI->init(@_);
@ -216,9 +216,9 @@ sub grant {
$vhost ||= $ENV{SERVER_NAME};
$apacheRequest = Lemonldap::NG::Apache::Request->new(
{
uri => $uri,
hostname => $vhost,
args => '',
uri => $uri,
hostname => $vhost,
args => '',
}
);
for ( my $i = 0 ; $i < $locationCount->{$vhost} ; $i++ ) {
@ -240,7 +240,7 @@ package Lemonldap::NG::Apache::Request;
sub new {
my $class = shift;
my $self = shift;
my $self = shift;
return bless $self, $class;
}

View File

@ -19,11 +19,12 @@ use strict;
use Lemonldap::NG::Handler::Simple qw(:all);
use Lemonldap::NG::Handler::Vhost;
use Lemonldap::NG::Common::Conf; #link protected lmConf
use Lemonldap::NG::Common::Conf::Constants; #inherits
use Lemonldap::NG::Common::Conf; #link protected lmConf
use Lemonldap::NG::Common::Conf::Constants; #inherits
use Cache::Cache qw($EXPIRES_NEVER);
use base qw(Lemonldap::NG::Handler::Vhost Lemonldap::NG::Handler::Simple);
#parameter reloadTime Time in second between 2 configuration check (600)
our $VERSION = '0.72';
@ -62,6 +63,7 @@ BEGIN {
# @param $args hash containing parameters
sub init($$) {
my ( $class, $args ) = splice @_;
# TODO reloadTime in defaultValuesInit ?
$reloadTime = $args->{reloadTime} || 600;
$class->localInit($args);
@ -91,8 +93,8 @@ sub localInit {
Lemonldap::NG::Common::Conf->new( $args->{configStorage} ) );
# Get local configuration parameters
my $localconf = $lmConf->getLocalConf( HANDLERSECTION );
if ( $localconf ) {
my $localconf = $lmConf->getLocalConf(HANDLERSECTION);
if ($localconf) {
$args->{$_} ||= $localconf->{$_} foreach ( keys %$localconf );
}

View File

@ -9,7 +9,7 @@ use Data::Dumper;
#inherits Cache::Cache
our $VERSION = "0.21";
our $VERSION = "0.21";
our $status = {};
our $activity = [];
@ -142,86 +142,86 @@ sub run {
}
else {
# Total requests
print "<h2>Total</h2>\n<div id=\"total\"><pre>\n";
print sprintf( "%-30s : \%6d (%.02f / mn)\n",
$_, $c->{$_}, $c->{$_} / $mn )
foreach ( sort keys %$c );
print "\n</pre></div>\n";
# Total requests
print "<h2>Total</h2>\n<div id=\"total\"><pre>\n";
print sprintf( "%-30s : \%6d (%.02f / mn)\n",
$_, $c->{$_}, $c->{$_} / $mn )
foreach ( sort keys %$c );
print "\n</pre></div>\n";
# Average
print "<h2>Average for last " . MN_COUNT
. " minutes</h2>\n<div id=\"average\"><pre>\n";
print sprintf( "%-30s : %6s / mn\n", $_, $m->{$_} )
foreach ( sort keys %$m );
print "\n</pre></div>\n";
# Average
print "<h2>Average for last " . MN_COUNT
. " minutes</h2>\n<div id=\"average\"><pre>\n";
print sprintf( "%-30s : %6s / mn\n", $_, $m->{$_} )
foreach ( sort keys %$m );
print "\n</pre></div>\n";
# Users connected
print "<div id=\"users\"><p>\nTotal users : $u\n</p></div>\n";
# Users connected
print "<div id=\"users\"><p>\nTotal users : $u\n</p></div>\n";
# Local cache
my @t =
# Local cache
my @t =
$refLocalStorage->get_keys(
$localStorageOptions->{namespace} );
print "<div id=\"cache\"><p>\nLocal Cache : " . @t
. " objects\n</p></div>\n";
print "<div id=\"cache\"><p>\nLocal Cache : " . @t
. " objects\n</p></div>\n";
# Uptime
print "<div id=\"up\"><p>\nServer up for : "
. &timeUp($mn)
. "\n</p></div>\n";
# Top uri
if ( $args->{top} ) {
print "<hr/>\n";
# Top uri
if ( $args->{top} ) {
print "<hr/>\n";
$args->{categories} ||=
'REJECT,PORTAL_FIRSTACCESS,LOGOUT,OK';
# Vhost activity
print
# Vhost activity
print
"<h2>Virtual Host activity</h2>\n<div id=\"vhost\"><pre>\n";
foreach (
sort { $count->{vhost}->{$b} <=> $count->{vhost}->{$a} }
keys %{ $count->{vhost} }
)
{
foreach (
sort { $count->{vhost}->{$b} <=> $count->{vhost}->{$a} }
keys %{ $count->{vhost} }
)
{
print
sprintf( "%-40s : %6d\n", $_, $count->{vhost}->{$_} );
}
print "\n</pre></div>\n";
}
print "\n</pre></div>\n";
# General
print "<h2>Top used URI</h2>\n<div id=\"uri\"><pre>\n";
my $i = 0;
foreach (
sort { $count->{uri}->{$b} <=> $count->{uri}->{$a} }
keys %{ $count->{uri} }
)
{
last if ( $i == $args->{top} );
last unless ( $count->{uri}->{$_} );
$i++;
# General
print "<h2>Top used URI</h2>\n<div id=\"uri\"><pre>\n";
my $i = 0;
foreach (
sort { $count->{uri}->{$b} <=> $count->{uri}->{$a} }
keys %{ $count->{uri} }
)
{
last if ( $i == $args->{top} );
last unless ( $count->{uri}->{$_} );
$i++;
print
sprintf( "%-80s : %6d\n", $_, $count->{uri}->{$_} );
}
print "\n</pre></div>\n";
}
print "\n</pre></div>\n";
# Top by category
print
"<table class=\"topByCat\"><tr><th style=\"width:20%\">Code</th><th>Top</th></tr>\n";
foreach my $cat ( split /,/, $args->{categories} ) {
# Top by category
print
"<table class=\"topByCat\"><tr><th style=\"width:20%\">Code</th><th>Top</th></tr>\n";
foreach my $cat ( split /,/, $args->{categories} ) {
print
"<tr><td>$cat</td><td nowrap>\n<div id=\"$cat\">\n";
topByCat( $cat, $args->{top} );
print "</div>\n</td></tr>";
topByCat( $cat, $args->{top} );
print "</div>\n</td></tr>";
}
print "</table>\n";
}
print "</table>\n";
}
&end;
&end;
}
}
}
}
}
## @rfn private string timeUp(int d)

View File

@ -7,31 +7,33 @@ use Digest::MD5;
our $VERSION = '0.11';
open S, '/etc/lemonldap-ng/sympa.secret' or die "Unable to open /etc/lemonldap-ng/sympa.secret";
our $sympaSecret = join('',<S>);
open S, '/etc/lemonldap-ng/sympa.secret'
or die "Unable to open /etc/lemonldap-ng/sympa.secret";
our $sympaSecret = join( '', <S> );
close S;
$sympaSecret =~ s/[\r\n]//g;
sub run {
my $class = shift;
my $r = $_[0];
my $ret = $class->SUPER::run(@_);
my $class = shift;
my $r = $_[0];
my $ret = $class->SUPER::run(@_);
# Building Sympa cookie
my $tmp = new Digest::MD5;
$tmp->reset;
$tmp->add($datas->{mail}.$sympaSecret);
my $str = "sympauser=$datas->{mail}:".substr(unpack("H*",$tmp->digest), -8);
my $tmp = new Digest::MD5;
$tmp->reset;
$tmp->add( $datas->{mail} . $sympaSecret );
my $str =
"sympauser=$datas->{mail}:" . substr( unpack( "H*", $tmp->digest ), -8 );
# Get cookie header, removing Sympa cookie if exists (avoid security
# problems) and set the new value
$tmp = lmHeaderIn( $r, 'Cookie' );
$tmp = lmHeaderIn( $r, 'Cookie' );
$tmp =~ s/\bsympauser=[^,;]*[,;]?//;
$tmp .= $tmp ? ";$str" : $str;
lmSetHeaderIn( $r, 'Cookie' => $tmp );
$tmp .= $tmp ? ";$str" : $str;
lmSetHeaderIn( $r, 'Cookie' => $tmp );
# Return SUPER::run() result
return $ret;
return $ret;
}
1;

View File

@ -5,7 +5,7 @@
# This class adds virtual host support for Lemonldap::NG handlers.
package Lemonldap::NG::Handler::Vhost;
use Lemonldap::NG::Handler::Simple qw(:locationRules :headers); #inherits
use Lemonldap::NG::Handler::Simple qw(:locationRules :headers); #inherits
use strict;
use MIME::Base64;
@ -35,8 +35,10 @@ sub locationRulesInit {
}
else {
$locationCondition->{$vhost}->[ $locationCount->{$vhost} ] =
$class->conditionSub( $args->{locationRules}->{$vhost}->{$_} );
$locationRegexp->{$vhost}->[ $locationCount->{$vhost} ] = qr/$_/;
$class->conditionSub(
$args->{locationRules}->{$vhost}->{$_} );
$locationRegexp->{$vhost}->[ $locationCount->{$vhost} ] =
qr/$_/;
$locationCount->{$vhost}++;
}
}

View File

@ -8,8 +8,8 @@ package Lemonldap::NG::Manager;
use strict;
use Lemonldap::NG::Handler::CGI qw(:globalStorage :locationRules); #inherits
use Lemonldap::NG::Manager::Help; #inherits
use Lemonldap::NG::Common::Conf; #link protected conf Configuration
use Lemonldap::NG::Common::Conf::Constants; #inherits
use Lemonldap::NG::Common::Conf; #link protected conf Configuration
use Lemonldap::NG::Common::Conf::Constants; #inherits
our $VERSION = '0.93';
our @ISA = qw(
@ -31,7 +31,7 @@ sub new {
'See Apache logs for more' );
# Try to load local configuration parameters
my $conf = Lemonldap::NG::Common::Conf->new( $self->{configStorage} );
my $conf = Lemonldap::NG::Common::Conf->new( $self->{configStorage} );
my $localconf = $conf->getLocalConf(MANAGERSECTION);
if ($localconf) {
$self->{$_} = $args->{$_} || $localconf->{$_}
@ -39,8 +39,8 @@ sub new {
}
# Default values
$self->{managerSkin} = "default" unless defined $self->{managerSkin};
$self->{managerCss} = "accordion.css" unless defined $self->{managerCss};
$self->{managerSkin} = "default" unless defined $self->{managerSkin};
$self->{managerCss} = "accordion.css" unless defined $self->{managerCss};
$self->{managerTreeAutoClose} = "true"
unless defined $self->{managerTreeAutoClose};
$self->{managerTreeJqueryCss} = "true"

View File

@ -187,7 +187,7 @@ sub confNode {
# saml metadata
elsif ( $target =~ s/^samlmetadata:// ) {
my $h = $self->keyToH($target, $self->conf);
my $h = $self->keyToH( $target, $self->conf );
$h = $h->{samlIDPMetaDataXML} if ( $h->{samlIDPMetaDataXML} );
my $metadata = Lemonldap::NG::Common::Conf::SAML::Metadata->new();
$metadata->initializeFromConfHash($h);
@ -195,11 +195,11 @@ sub confNode {
$text =~ s/^\/([^\/]+)\/.*$/$1/;
$res .= $self->li("$target/")
. $self->span(
id => "$target/",
text => $text,
data => $metadata->toXML(),
js => $js,
help => $help,
id => "$target/",
text => $text,
data => $metadata->toXML(),
js => $js,
help => $help,
target => "samlmetadata",
) . "</li>";
}
@ -216,11 +216,11 @@ sub confNode {
unless ( defined $h ) {
$self->lmLog( "$target does not exists in menu hash", "debug" );
$h = {
text => '',
hash => {},
'int' => 0,
text => '',
hash => {},
'int' => 0,
textarea => '',
bool => 0,
bool => 0,
}->{$type};
$self->lmLog( "Type $type unknown", 'warn' ) unless ( defined $h );
}
@ -449,7 +449,7 @@ sub span {
# Text
my $tmp = $args{text};
$tmp =~ s/"/&#39;/g;
$tmp =~ s/"/&#39;/g;
$args{text} = join ' ', map { $self->translate($_) } split /\s+/,
$args{text}
unless ( $args{noT} );

View File

@ -713,7 +713,7 @@ EOT
# fr
sub help_default_fr {
print <<EOT;
print <<EOT;
<h3>Bienvenue sur le gestionnaire de configuration</h3>
<p>Les paramètres sont listés dans l'arbre de configuration sous différentes catégories :
<ul>

View File

@ -7,9 +7,9 @@ package Lemonldap::NG::Manager::Sessions;
use strict;
use Lemonldap::NG::Handler::CGI qw(:globalStorage :locationRules);
use Lemonldap::NG::Common::Apache::Session; #inherits
use Lemonldap::NG::Common::Conf; #link protected conf Configuration
use Lemonldap::NG::Common::Conf::Constants; #inherits
use Lemonldap::NG::Common::Apache::Session; #inherits
use Lemonldap::NG::Common::Conf; #link protected conf Configuration
use Lemonldap::NG::Common::Conf::Constants; #inherits
#inherits Apache::Session
@ -38,7 +38,7 @@ sub new {
my $config = Lemonldap::NG::Common::Conf->new( $self->{configStorage} );
unless ($config) {
$self->abort( "Unable to start",
"Configuration not loaded\n" . $Lemonldap::NG::Common::Conf::msg );
"Configuration not loaded\n" . $Lemonldap::NG::Common::Conf::msg );
}
my $localconf = $config->getLocalConf(MANAGERSECTION);

View File

@ -67,7 +67,8 @@ sub confUpload {
$id =~ s/\r//g;
$id =~ s/^\///;
$id =~ s/(?:\/[^\/]*)?$/\/$name/ if ($NK);
next if ( $id =~ /^(generalParameters|virtualHosts|samlIDPMetaDataNode)/);
next
if ( $id =~ /^(generalParameters|virtualHosts|samlIDPMetaDataNode)/ );
my ( $confKey, $test ) = $self->getConfTests($id);
my ( $res, $m );
@ -317,15 +318,12 @@ sub findAllConfKeys {
sub formatValue {
my ( $self, $key, $value ) = @_;
my $newvalue = $value;
if ( $key =~ /^samlIDPMetaDataXML/ )
{
if ( $key =~ /^samlIDPMetaDataXML/ ) {
my $metadata = Lemonldap::NG::Common::Conf::SAML::Metadata->new();
if (ref($value))
{
if ( ref($value) ) {
$metadata->initializeFromConfHash($value);
}
else
{
else {
$metadata->initializeFromXML($value);
}
$newvalue = $metadata->toHash();
@ -346,7 +344,7 @@ sub setKeyToH {
my ( $self, $h, $key, $k2 ) = @_;
my $tmp = $h;
$key =~ s/^\///;
$value = $self->formatValue($key, $value);
$value = $self->formatValue( $key, $value );
while (1) {
if ( $key =~ /\// ) {
my $k = $`;

View File

@ -19,50 +19,48 @@ our $VERSION = '0.1';
sub cstruct {
shift;
my ( $h, $k ) = @_;
my @tmp = split(/\//, $k);
return $h unless (scalar(@tmp) > 1);
my @tmp = split( /\//, $k );
return $h unless ( scalar(@tmp) > 1 );
my $k1 = $tmp[0];
my $k2 = $tmp[1];
if ($k1 =~ /^virtualHosts/i)
{
%$h = (
%$h,
virtualHosts => {
$k2 => {
_nodes => [qw(rules:rules:rules headers)],
rules => {
_nodes => ["hash:/locationRules/$k2:rules:rules"],
_js => 'rulesRoot'
},
headers => {
_nodes => ["hash:/exportedHeaders/$k2"],
_js => 'hashRoot'
if ( $k1 =~ /^virtualHosts/i ) {
%$h = (
%$h,
virtualHosts => {
$k2 => {
_nodes => [qw(rules:rules:rules headers)],
rules => {
_nodes => ["hash:/locationRules/$k2:rules:rules"],
_js => 'rulesRoot'
},
headers => {
_nodes => ["hash:/exportedHeaders/$k2"],
_js => 'hashRoot'
},
}
}
);
}
elsif ($k1 =~ /^samlIDPMetaDataNode/i)
{
%$h = (
%$h,
samlIDPMetaDataNode => {
$k2 => {
_nodes => [
qw(samlIDPMetaDataExportedAttributes samlIDPMetaDataXML)
elsif ( $k1 =~ /^samlIDPMetaDataNode/i ) {
%$h = (
%$h,
samlIDPMetaDataNode => {
$k2 => {
_nodes => [
qw(samlIDPMetaDataExportedAttributes samlIDPMetaDataXML)
],
samlIDPMetaDataExportedAttributes => {
_nodes => [
"hash:/samlIDPMetaDataExportedAttributes/$k2"
. ":samlIDPMetaDataExportedAttributes:samlAttribute"
samlIDPMetaDataExportedAttributes => {
_nodes => [
"hash:/samlIDPMetaDataExportedAttributes/$k2"
. ":samlIDPMetaDataExportedAttributes:samlAttribute"
],
_js => 'samlAttributeRoot'
},
samlIDPMetaDataXML => "samlmetadata:/samlIDPMetaDataXML/$k2"
. ":samlIDPMetaDataXML:textarea",
_js => 'samlAttributeRoot'
},
samlIDPMetaDataXML => "samlmetadata:/samlIDPMetaDataXML/$k2"
. ":samlIDPMetaDataXML:textarea",
}
}
}
);
);
}
return $h;
}
@ -73,8 +71,10 @@ sub cstruct {
sub struct {
my $self = shift;
return {
_nodes => [qw(n:generalParameters n:variables n:virtualHosts n:samlServiceMetaData n:samlIDPMetaDataNode)],
_help => 'default',
_nodes => [
qw(n:generalParameters n:variables n:virtualHosts n:samlServiceMetaData n:samlIDPMetaDataNode)
],
_help => 'default',
######################
# GENERAL PARAMETERS #
@ -83,7 +83,7 @@ sub struct {
_nodes => [
qw(portalParams n:authParams logParams cookieParams sessionParams n:advancedParams)
],
_help => 'default',
_help => 'default',
# PORTAL PARAMETERS
portalParams => {
@ -92,7 +92,7 @@ sub struct {
],
_help => 'portalParams',
portal => 'text:/portal',
portal => 'text:/portal',
portalSkin => 'text:/portalSkin',
portalDisplayLogout => 'text:/portalDisplayLogout',
portalDisplayResetPassword =>
@ -183,13 +183,13 @@ sub struct {
_js => 'hashRoot'
},
},
singleSession => 'bool:/singleSession',
singleIP => 'bool:/singleIP',
singleUserByIP => 'bool:/singleUserByIP',
notifyDeleted => 'bool:/notifyDeleted',
notifyOther => 'bool:/notifyOther',
storePassword => 'bool:/storePassword',
timeout => 'text:/timeout:timeout:text',
singleSession => 'bool:/singleSession',
singleIP => 'bool:/singleIP',
singleUserByIP => 'bool:/singleUserByIP',
notifyDeleted => 'bool:/notifyDeleted',
notifyOther => 'bool:/notifyOther',
storePassword => 'bool:/storePassword',
timeout => 'text:/timeout:timeout:text',
grantSessionRule => 'text:/grantSessionRule',
},
@ -272,185 +272,187 @@ sub struct {
########
# SAML #
########
# virtual keys should not begin like configuration keys.
samlIDPMetaDataNode => {
_nodes => ['nhash:/samlIDPMetaDataExportedAttributes:samlIDPMetaDataNode:samlMetaData'],
_upload => ['/samlIDPMetaDataXML'],
_help => 'default',
_call => '$(\'#newsamlmetadatab\').show();',
},
# virtual keys should not begin like configuration keys.
samlIDPMetaDataNode => {
_nodes => [
'nhash:/samlIDPMetaDataExportedAttributes:samlIDPMetaDataNode:samlMetaData'
],
_upload => ['/samlIDPMetaDataXML'],
_help => 'default',
_call => '$(\'#newsamlmetadatab\').show();',
},
samlServiceMetaData => {
_nodes => [
qw(samlEntityID
samlServicePrivateKey
n:samlOrganization
n:samlSPSSODescriptor
n:samlIDPSSODescriptor)
],
_help => 'default',
samlServiceMetaData => {
_nodes => [
qw(samlEntityID
samlServicePrivateKey
n:samlOrganization
n:samlSPSSODescriptor
n:samlIDPSSODescriptor)
],
_help => 'default',
# GLOBAL INFORMATIONS
samlEntityID => 'text:/samlEntityID',
# GLOBAL INFORMATIONS
samlEntityID => 'text:/samlEntityID',
samlServicePrivateKey =>
'textarea:/samlServicePrivateKey:samlServicePrivateKey:textarea',
samlOrganization => {
samlOrganization => {
_nodes => [
qw(samlOrganizationDisplayName
samlOrganizationName
samlOrganizationURL)
],
_help => 'default',
samlOrganizationDisplayName =>
'text:/samlOrganizationDisplayName',
samlOrganizationURL => 'text:/samlOrganizationURL',
samlOrganizationName => 'text:/samlOrganizationName',
},
# SERVICE PROVIDER
'samlSPSSODescriptor' => {
_nodes => [
qw(samlSPSSODescriptorAuthnRequestsSigned
samlSPSSODescriptorProtocolSupportEnumeration
samlSPSSODescriptorKeyDescriptorSigning
n:samlSPSSODescriptorSingleLogoutService
n:samlSPSSODescriptorAssertionConsumerService
n:samlSPSSODescriptorNameIDFormat)
],
_help => 'default',
samlSPSSODescriptorAuthnRequestsSigned =>
'bool:/samlSPSSODescriptorAuthnRequestsSigned',
samlSPSSODescriptorProtocolSupportEnumeration =>
'text:/samlSPSSODescriptorProtocolSupportEnumeration',
samlSPSSODescriptorKeyDescriptorSigning =>
'textarea:/samlSPSSODescriptorKeyDescriptorSigning',
samlSPSSODescriptorSingleLogoutService => {
_nodes => [
qw(samlOrganizationDisplayName
samlOrganizationName
samlOrganizationURL)
],
_help => 'default',
samlOrganizationDisplayName =>
'text:/samlOrganizationDisplayName',
samlOrganizationURL => 'text:/samlOrganizationURL',
samlOrganizationName => 'text:/samlOrganizationName',
},
qw(samlSPSSODescriptorSingleLogoutServiceHTTP
samlSPSSODescriptorSingleLogoutServiceSOAP)
],
_help => 'default',
samlSPSSODescriptorSingleLogoutServiceHTTP =>
'samlService:/samlSPSSODescriptorSingleLogoutServiceHTTP',
samlSPSSODescriptorSingleLogoutServiceSOAP =>
'samlService:/samlSPSSODescriptorSingleLogoutServiceSOAP',
},
# SERVICE PROVIDER
'samlSPSSODescriptor' => {
samlSPSSODescriptorAssertionConsumerService => {
_nodes => [
qw(samlSPSSODescriptorAuthnRequestsSigned
samlSPSSODescriptorProtocolSupportEnumeration
samlSPSSODescriptorKeyDescriptorSigning
n:samlSPSSODescriptorSingleLogoutService
n:samlSPSSODescriptorAssertionConsumerService
n:samlSPSSODescriptorNameIDFormat)
],
_help => 'default',
samlSPSSODescriptorAuthnRequestsSigned =>
'bool:/samlSPSSODescriptorAuthnRequestsSigned',
samlSPSSODescriptorProtocolSupportEnumeration =>
'text:/samlSPSSODescriptorProtocolSupportEnumeration',
samlSPSSODescriptorKeyDescriptorSigning =>
'textarea:/samlSPSSODescriptorKeyDescriptorSigning',
samlSPSSODescriptorSingleLogoutService => {
_nodes => [
qw(samlSPSSODescriptorSingleLogoutServiceHTTP
samlSPSSODescriptorSingleLogoutServiceSOAP)
],
_help => 'default',
samlSPSSODescriptorSingleLogoutServiceHTTP =>
'samlService:/samlSPSSODescriptorSingleLogoutServiceHTTP',
samlSPSSODescriptorSingleLogoutServiceSOAP =>
'samlService:/samlSPSSODescriptorSingleLogoutServiceSOAP',
},
samlSPSSODescriptorAssertionConsumerService => {
_nodes => [
qw(samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact
samlSPSSODescriptorAssertionConsumerServiceHTTPPost
samlSPSSODescriptorAssertionConsumerServiceHTTPRedirect)
],
_help => 'default',
samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact =>
qw(samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact
samlSPSSODescriptorAssertionConsumerServiceHTTPPost
samlSPSSODescriptorAssertionConsumerServiceHTTPRedirect)
],
_help => 'default',
samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact =>
'samlAssertion:/samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact',
samlSPSSODescriptorAssertionConsumerServiceHTTPPost =>
samlSPSSODescriptorAssertionConsumerServiceHTTPPost =>
'samlAssertion:/samlSPSSODescriptorAssertionConsumerServiceHTTPPost',
samlSPSSODescriptorAssertionConsumerServiceHTTPRedirect =>
samlSPSSODescriptorAssertionConsumerServiceHTTPRedirect =>
'samlAssertion:/samlSPSSODescriptorAssertionConsumerServiceHTTPRedirect',
},
},
samlSPSSODescriptorNameIDFormat => {
_nodes => [
qw(samlSPSSODescriptorNameIDFormatX509SubjectName
samlSPSSODescriptorNameIDFormatPersistent
samlSPSSODescriptorNameIDFormatTransient)
],
_help => 'default',
samlSPSSODescriptorNameIDFormatX509SubjectName =>
'bool:/samlSPSSODescriptorNameIDFormatX509SubjectName:samlNameIDFormatX509SubjectName:bool',
samlSPSSODescriptorNameIDFormatPersistent =>
'bool:/samlSPSSODescriptorNameIDFormatPersistent:samlNameIDFormatPersistent:bool',
samlSPSSODescriptorNameIDFormatTransient =>
'bool:/samlSPSSODescriptorNameIDFormatTransient:samlNameIDFormatTransient:bool',
},
},
# IDENTITY PROVIDER
samlIDPSSODescriptor => {
samlSPSSODescriptorNameIDFormat => {
_nodes => [
qw(samlIDPSSODescriptorWantAuthnRequestsSigned
samlIDPSSODescriptorProtocolSupportEnumeration
samlIDPSSODescriptorKeyDescriptorSigning
n:samlIDPSSODescriptorSingleSignOnService
n:samlIDPSSODescriptorSingleLogoutService
n:samlIDPSSODescriptorArtifactResolutionService
n:samlIDPSSODescriptorNameIDFormat
n:samlIDPSSODescriptorManageNameIDService)
],
_help => 'default',
qw(samlSPSSODescriptorNameIDFormatX509SubjectName
samlSPSSODescriptorNameIDFormatPersistent
samlSPSSODescriptorNameIDFormatTransient)
],
_help => 'default',
samlSPSSODescriptorNameIDFormatX509SubjectName =>
'bool:/samlSPSSODescriptorNameIDFormatX509SubjectName:samlNameIDFormatX509SubjectName:bool',
samlSPSSODescriptorNameIDFormatPersistent =>
'bool:/samlSPSSODescriptorNameIDFormatPersistent:samlNameIDFormatPersistent:bool',
samlSPSSODescriptorNameIDFormatTransient =>
'bool:/samlSPSSODescriptorNameIDFormatTransient:samlNameIDFormatTransient:bool',
},
},
samlIDPSSODescriptorWantAuthnRequestsSigned =>
'bool:/samlIDPSSODescriptorWantAuthnRequestsSigned',
samlIDPSSODescriptorProtocolSupportEnumeration =>
'text:/samlIDPSSODescriptorProtocolSupportEnumeration',
samlIDPSSODescriptorKeyDescriptorSigning =>
'textarea:/samlIDPSSODescriptorKeyDescriptorSigning',
# IDENTITY PROVIDER
samlIDPSSODescriptor => {
_nodes => [
qw(samlIDPSSODescriptorWantAuthnRequestsSigned
samlIDPSSODescriptorProtocolSupportEnumeration
samlIDPSSODescriptorKeyDescriptorSigning
n:samlIDPSSODescriptorSingleSignOnService
n:samlIDPSSODescriptorSingleLogoutService
n:samlIDPSSODescriptorArtifactResolutionService
n:samlIDPSSODescriptorNameIDFormat
n:samlIDPSSODescriptorManageNameIDService)
],
_help => 'default',
samlIDPSSODescriptorSingleSignOnService => {
_nodes => [
qw(samlIDPSSODescriptorSingleSignOnServiceHTTP
samlIDPSSODescriptorSingleSignOnServiceSOAP)
],
_help => 'default',
samlIDPSSODescriptorSingleSignOnServiceHTTP =>
samlIDPSSODescriptorWantAuthnRequestsSigned =>
'bool:/samlIDPSSODescriptorWantAuthnRequestsSigned',
samlIDPSSODescriptorProtocolSupportEnumeration =>
'text:/samlIDPSSODescriptorProtocolSupportEnumeration',
samlIDPSSODescriptorKeyDescriptorSigning =>
'textarea:/samlIDPSSODescriptorKeyDescriptorSigning',
samlIDPSSODescriptorSingleSignOnService => {
_nodes => [
qw(samlIDPSSODescriptorSingleSignOnServiceHTTP
samlIDPSSODescriptorSingleSignOnServiceSOAP)
],
_help => 'default',
samlIDPSSODescriptorSingleSignOnServiceHTTP =>
'samlService:/samlIDPSSODescriptorSingleSignOnServiceHTTP',
samlIDPSSODescriptorSingleSignOnServiceSOAP =>
samlIDPSSODescriptorSingleSignOnServiceSOAP =>
'samlService:/samlIDPSSODescriptorSingleSignOnServiceSOAP',
},
},
samlIDPSSODescriptorSingleLogoutService => {
_nodes => [
qw(samlIDPSSODescriptorSingleLogoutServiceHTTP
samlIDPSSODescriptorSingleLogoutServiceSOAP)
],
_help => 'default',
samlIDPSSODescriptorSingleLogoutServiceHTTP =>
samlIDPSSODescriptorSingleLogoutService => {
_nodes => [
qw(samlIDPSSODescriptorSingleLogoutServiceHTTP
samlIDPSSODescriptorSingleLogoutServiceSOAP)
],
_help => 'default',
samlIDPSSODescriptorSingleLogoutServiceHTTP =>
'samlService:/samlIDPSSODescriptorSingleLogoutServiceHTTP',
samlIDPSSODescriptorSingleLogoutServiceSOAP =>
samlIDPSSODescriptorSingleLogoutServiceSOAP =>
'samlService:/samlIDPSSODescriptorSingleLogoutServiceSOAP',
},
},
samlIDPSSODescriptorArtifactResolutionService => {
_nodes => [
qw(samlIDPSSODescriptorArtifactResolutionServiceArtifact)
],
_help => 'default',
samlIDPSSODescriptorArtifactResolutionServiceArtifact =>
samlIDPSSODescriptorArtifactResolutionService => {
_nodes => [
qw(samlIDPSSODescriptorArtifactResolutionServiceArtifact)
],
_help => 'default',
samlIDPSSODescriptorArtifactResolutionServiceArtifact =>
'samlAssertion:/samlIDPSSODescriptorArtifactResolutionServiceArtifact',
},
},
samlIDPSSODescriptorNameIDFormat => {
_nodes => [
qw(samlIDPSSODescriptorNameIDFormatX509SubjectName
samlIDPSSODescriptorNameIDFormatPersistent
samlIDPSSODescriptorNameIDFormatTransient)
],
_help => 'default',
samlIDPSSODescriptorNameIDFormatX509SubjectName =>
samlIDPSSODescriptorNameIDFormat => {
_nodes => [
qw(samlIDPSSODescriptorNameIDFormatX509SubjectName
samlIDPSSODescriptorNameIDFormatPersistent
samlIDPSSODescriptorNameIDFormatTransient)
],
_help => 'default',
samlIDPSSODescriptorNameIDFormatX509SubjectName =>
'bool:/samlIDPSSODescriptorNameIDFormatX509SubjectName:samlNameIDFormatX509SubjectName:bool',
samlIDPSSODescriptorNameIDFormatPersistent =>
samlIDPSSODescriptorNameIDFormatPersistent =>
'bool:/samlIDPSSODescriptorNameIDFormatPersistent:samlNameIDFormatPersistent:bool',
samlIDPSSODescriptorNameIDFormatTransient =>
samlIDPSSODescriptorNameIDFormatTransient =>
'bool:/samlIDPSSODescriptorNameIDFormatTransient:samlNameIDFormatTransient:bool',
},
},
samlIDPSSODescriptorManageNameIDService => {
_nodes => [
qw(samlIDPSSODescriptorManageNameIDServiceHTTP
samlIDPSSODescriptorManageNameIDServiceSOAP)
],
_help => 'default',
samlIDPSSODescriptorManageNameIDServiceHTTP =>
samlIDPSSODescriptorManageNameIDService => {
_nodes => [
qw(samlIDPSSODescriptorManageNameIDServiceHTTP
samlIDPSSODescriptorManageNameIDServiceSOAP)
],
_help => 'default',
samlIDPSSODescriptorManageNameIDServiceHTTP =>
'samlService:/samlIDPSSODescriptorManageNameIDServiceHTTP',
samlIDPSSODescriptorManageNameIDServiceSOAP =>
samlIDPSSODescriptorManageNameIDServiceSOAP =>
'samlService:/samlIDPSSODescriptorManageNameIDServiceSOAP',
},
},
},
},
},
},
};
}
@ -654,7 +656,7 @@ sub testStruct {
saml => $testNotDefined,
samlServiceMetaData => $testNotDefined,
samlServicePrivateKey => $testNotDefined,
securedCookie => {
securedCookie => {
test => qr/^(?:0|1|2)$/,
msgFail => 'securedCookie must be 0, 1 or 2',
},
@ -703,20 +705,20 @@ sub testStruct {
keyTest => qr/^[a-zA-Z](?:[\w\-\.]*\w)?$/,
keyMsgFail => 'Bad metadata name',
'*' => {
test => sub { return 1; },
keyTest => sub { return 1; },
test => sub { return 1; },
keyTest => sub { return 1; },
},
},
samlServicePrivateKey => $testNotDefined,
samlEntityID => $testNotDefined,
samlOrganizationDisplayName => $testNotDefined,
samlOrganizationName => $testNotDefined,
samlOrganizationURL => $testNotDefined,
samlSPSSODescriptorAuthnRequestsSigned => $boolean,
samlServicePrivateKey => $testNotDefined,
samlEntityID => $testNotDefined,
samlOrganizationDisplayName => $testNotDefined,
samlOrganizationName => $testNotDefined,
samlOrganizationURL => $testNotDefined,
samlSPSSODescriptorAuthnRequestsSigned => $boolean,
samlSPSSODescriptorProtocolSupportEnumeration => $testNotDefined,
samlSPSSODescriptorKeyDescriptorSigning => $testNotDefined,
samlSPSSODescriptorSingleLogoutServiceHTTP => $testNotDefined,
samlSPSSODescriptorSingleLogoutServiceSOAP => $testNotDefined,
samlSPSSODescriptorKeyDescriptorSigning => $testNotDefined,
samlSPSSODescriptorSingleLogoutServiceHTTP => $testNotDefined,
samlSPSSODescriptorSingleLogoutServiceSOAP => $testNotDefined,
samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact =>
$testNotDefined,
samlSPSSODescriptorAssertionConsumerServiceHTTPPost => $testNotDefined,
@ -725,20 +727,20 @@ sub testStruct {
samlSPSSODescriptorNameIDFormatX509SubjectName => $boolean,
samlSPSSODescriptorNameIDFormatPersistent => $boolean,
samlSPSSODescriptorNameIDFormatTransient => $boolean,
samlIDPSSODescriptorWantAuthnRequestsSigned => $boolean,
samlIDPSSODescriptorWantAuthnRequestsSigned => $boolean,
samlIDPSSODescriptorProtocolSupportEnumeration => $testNotDefined,
samlIDPSSODescriptorKeyDescriptorSigning => $testNotDefined,
samlIDPSSODescriptorSingleSignOnServiceHTTP => $testNotDefined,
samlIDPSSODescriptorSingleSignOnServiceSOAP => $testNotDefined,
samlIDPSSODescriptorSingleLogoutServiceHTTP => $testNotDefined,
samlIDPSSODescriptorSingleLogoutServiceSOAP => $testNotDefined,
samlIDPSSODescriptorKeyDescriptorSigning => $testNotDefined,
samlIDPSSODescriptorSingleSignOnServiceHTTP => $testNotDefined,
samlIDPSSODescriptorSingleSignOnServiceSOAP => $testNotDefined,
samlIDPSSODescriptorSingleLogoutServiceHTTP => $testNotDefined,
samlIDPSSODescriptorSingleLogoutServiceSOAP => $testNotDefined,
samlIDPSSODescriptorArtifactResolutionServiceArtifact =>
$testNotDefined,
samlIDPSSODescriptorNameIDFormatX509SubjectName => $boolean,
samlIDPSSODescriptorNameIDFormatPersistent => $boolean,
samlSPSSODescriptorNameIDFormatTransient => $boolean,
samlIDPSSODescriptorManageNameIDServiceHTTP => $testNotDefined,
samlIDPSSODescriptorManageNameIDServiceSOAP => $testNotDefined,
samlIDPSSODescriptorManageNameIDServiceHTTP => $testNotDefined,
samlIDPSSODescriptorManageNameIDServiceSOAP => $testNotDefined,
};
}
@ -771,8 +773,8 @@ sub defaultConf {
notifyDeleted => '1',
notifyOther => '1',
portal => 'http://auth.example.com/',
portalSkin => 'pastel',
portalUserAttr => '_user',
portalSkin => 'pastel',
portalUserAttr => '_user',
protection => 'none',
securedCookie => '0',
singleSession => '0',
@ -791,12 +793,13 @@ sub defaultConf {
# SAML #
########
samlIDPMetaDataXML => { 'authentic' => {} },
samlIDPMetaDataExportedAttributes => { 'authentic' => { 'uid' => '0;uid;;' } },
samlServicePrivateKey => '',
samlIDPMetaDataExportedAttributes =>
{ 'authentic' => { 'uid' => '0;uid;;' } },
samlServicePrivateKey => '',
samlEntityID => 'http://auth.example.com/saml/metadata',
samlOrganizationDisplayName => 'Example',
samlOrganizationName => 'Example',
samlOrganizationURL => 'http://www.example.com',
samlOrganizationName => 'Example',
samlOrganizationURL => 'http://www.example.com',
samlSPSSODescriptorAuthnRequestsSigned => '0',
samlSPSSODescriptorProtocolSupportEnumeration =>
'urn:oasis:names:tc:SAML:2.0:protocol',
@ -820,7 +823,7 @@ sub defaultConf {
samlSPSSODescriptorNameIDFormatX509SubjectName => '0',
samlSPSSODescriptorNameIDFormatPersistent => '1',
samlSPSSODescriptorNameIDFormatTransient => '0',
samlIDPSSODescriptorWantAuthnRequestsSigned => '0',
samlIDPSSODescriptorWantAuthnRequestsSigned => '0',
samlIDPSSODescriptorProtocolSupportEnumeration =>
'urn:oasis:names:tc:SAML:2.0:protocol',
samlIDPSSODescriptorKeyDescriptorSigning => '',
@ -855,10 +858,10 @@ sub defaultConf {
sub subDefaultConf {
return {
locationRules => { default => 'deny' },
exportedHeaders => { 'Auth-User' => '$uid' },
samlIDPMetaDataXML => { {} },
samlIDPMetaDataExportedAttributes => { 'uid' => ';0;uid;;' },
locationRules => { default => 'deny' },
exportedHeaders => { 'Auth-User' => '$uid' },
samlIDPMetaDataXML => { {} },
samlIDPMetaDataExportedAttributes => { 'uid' => ';0;uid;;' },
};
}

View File

@ -47,49 +47,49 @@ __END__
sub en {
return {
advancedParams => 'Advanced parameters',
authentication => 'Authentication module',
advancedParams => 'Advanced parameters',
authentication => 'Authentication module',
authParams => 'Authentication',
clickHereToForce => 'Click here to force',
Configuration => 'Configuration',
clickHereToForce => 'Click here to force',
Configuration => 'Configuration',
confModuledeprecated =>
'This module has been deprecated, set "forceUpload=1" in lemonldap-ng.ini to use it',
confSaved => 'Configuration saved',
confWasChanged => 'Configuration has been changed',
cookieExpiration => 'Cookie expiration time',
cookieName => 'Cookie Name',
confSaved => 'Configuration saved',
confWasChanged => 'Configuration has been changed',
cookieExpiration => 'Cookie expiration time',
cookieName => 'Cookie Name',
cookieParams => 'Cookies',
databaseLocked => 'Database locked by another process',
domain => 'Domain',
exportedAttr => 'SOAP exported attributes',
exportedVars => 'Exported Variables',
generalParameters => 'General Parameters',
globalStorage => 'Apache::Session module',
globalStorageOptions => 'Apache::Session module parameters',
databaseLocked => 'Database locked by another process',
domain => 'Domain',
exportedAttr => 'SOAP exported attributes',
exportedVars => 'Exported Variables',
generalParameters => 'General Parameters',
globalStorage => 'Apache::Session module',
globalStorageOptions => 'Apache::Session module parameters',
grantSessionRule => 'Opening conditions',
groups => 'Groups',
headers => 'HTTP Headers',
https => 'Default value for https parameter',
ldapBase => 'LDAP Search Base',
ldapParams => 'LDAP parameters',
ldapPort => 'LDAP Server Port',
ldapServer => 'LDAP Server',
groups => 'Groups',
headers => 'HTTP Headers',
https => 'Default value for https parameter',
ldapBase => 'LDAP Search Base',
ldapParams => 'LDAP parameters',
ldapPort => 'LDAP Server Port',
ldapServer => 'LDAP Server',
logParams => 'Logs',
macros => 'Macros',
mailBody => 'Mail content',
mailFrom => 'Mail sender',
mailSubject => 'Mail subject',
managerDn => 'LDAP Account',
managerPassword => 'LDAP Password',
notification => 'Active notifications',
notifications => 'Notifications',
notificationStorage => 'Notifications storage type',
notificationStorageOptions => 'Storage module parameters',
notifyDeleted => 'Display deleted sessions',
macros => 'Macros',
mailBody => 'Mail content',
mailFrom => 'Mail sender',
mailSubject => 'Mail subject',
managerDn => 'LDAP Account',
managerPassword => 'LDAP Password',
notification => 'Active notifications',
notifications => 'Notifications',
notificationStorage => 'Notifications storage type',
notificationStorageOptions => 'Storage module parameters',
notifyDeleted => 'Display deleted sessions',
notifyOther => 'Display other sessions',
passwordDB => 'Password database type',
passwordManagement => 'Password management',
portal => 'Portal',
passwordManagement => 'Password management',
portal => 'Portal',
portalAutocomplete => 'Auto complete',
portalDisplayAppslist => 'Display applications list',
portalDisplayChangePassword => 'Display password change',
@ -101,101 +101,101 @@ sub en {
portalRequireOldPassword => 'Require old password',
portalSkin => 'Skin',
portalUserAttr => 'User attribute',
randomPasswordRegexp => 'Regexp for password generation',
rules => 'Rules',
securedCookie => 'Secured Cookie (SSL)',
randomPasswordRegexp => 'Regexp for password generation',
rules => 'Rules',
securedCookie => 'Secured Cookie (SSL)',
sessionParams => 'Sessions',
sessionStorage => 'Sessions Storage',
singleIP => 'One IP only by user',
singleSession => 'One session only by user',
singleUserByIP => 'One user by IP address',
SMTPServer => 'SMTP server',
Soap => 'Activate portal SOAP functions',
storePassword => 'Store user password in session datas',
syntaxError => 'Syntax Error',
syslog => 'Syslog facility',
timeout => 'Sessions timeout',
trustedDomains => 'Trusted domains',
unknownError => 'Unknown error',
uploadDenied => 'Upload denied',
userDB => 'Users database type',
userControl => 'Username control',
useXForwardedForIP => "Use X-Forwarded-For header address",
variables => "Variables",
virtualHosts => 'Virtual Hosts',
sessionStorage => 'Sessions Storage',
singleIP => 'One IP only by user',
singleSession => 'One session only by user',
singleUserByIP => 'One user by IP address',
SMTPServer => 'SMTP server',
Soap => 'Activate portal SOAP functions',
storePassword => 'Store user password in session datas',
syntaxError => 'Syntax Error',
syslog => 'Syslog facility',
timeout => 'Sessions timeout',
trustedDomains => 'Trusted domains',
unknownError => 'Unknown error',
uploadDenied => 'Upload denied',
userDB => 'Users database type',
userControl => 'Username control',
useXForwardedForIP => "Use X-Forwarded-For header address",
variables => "Variables",
virtualHosts => 'Virtual Hosts',
whatToTrace => "REMOTE_USER environment variable",
saml => 'SAML',
samlServicePrivateKey => 'Private Key',
samlIDPMetaDataNode => 'Identity providers',
samlIDPMetaDataXML => 'Metadata XML',
saml => 'SAML',
samlServicePrivateKey => 'Private Key',
samlIDPMetaDataNode => 'Identity providers',
samlIDPMetaDataXML => 'Metadata XML',
samlIDPMetaDataExportedAttributes => 'Exported attributes',
samlServiceMetaData => 'SAML 2 Service',
samlEntityID => 'Entity Identifier',
samlOrganization => 'Organization',
samlOrganizationDisplayName => 'Display Name',
samlOrganizationName => 'Name',
samlOrganizationURL => 'URL',
samlSPSSODescriptor => 'Service Provider',
samlServiceMetaData => 'SAML 2 Service',
samlEntityID => 'Entity Identifier',
samlOrganization => 'Organization',
samlOrganizationDisplayName => 'Display Name',
samlOrganizationName => 'Name',
samlOrganizationURL => 'URL',
samlSPSSODescriptor => 'Service Provider',
samlSPSSODescriptorAuthnRequestsSigned =>
'Signed Authentication Request',
samlSPSSODescriptorProtocolSupportEnumeration => 'Protocol',
samlSPSSODescriptorKeyDescriptorSigning => 'Signing Key',
samlSPSSODescriptorSingleLogoutService => 'Single Logout',
samlSPSSODescriptorSingleLogoutServiceHTTP => 'HTTP Service',
samlSPSSODescriptorSingleLogoutServiceSOAP => 'SOAP Service',
samlSPSSODescriptorAssertionConsumerService => 'Assertion Consumer',
samlSPSSODescriptorKeyDescriptorSigning => 'Signing Key',
samlSPSSODescriptorSingleLogoutService => 'Single Logout',
samlSPSSODescriptorSingleLogoutServiceHTTP => 'HTTP Service',
samlSPSSODescriptorSingleLogoutServiceSOAP => 'SOAP Service',
samlSPSSODescriptorAssertionConsumerService => 'Assertion Consumer',
samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact =>
'HTTP Artifact',
samlSPSSODescriptorAssertionConsumerServiceHTTPPost => 'HTTP POST',
samlSPSSODescriptorAssertionConsumerServiceHTTPRedirect =>
'HTTP Redirect',
samlSPSSODescriptorNameIDFormat => 'NameID Format',
samlSPSSODescriptorNameIDFormat => 'NameID Format',
samlSPSSODescriptorNameIDFormatX509SubjectName => 'x509',
samlSPSSODescriptorNameIDFormatPersistent => 'Persistent',
samlSPSSODescriptorNameIDFormatTransient => 'Transient',
samlIDPSSODescriptor => 'Identity Provider',
samlIDPSSODescriptor => 'Identity Provider',
samlIDPSSODescriptorWantAuthnRequestsSigned =>
'Signed Authentication Request',
samlIDPSSODescriptorProtocolSupportEnumeration => 'Protocol',
samlIDPSSODescriptorKeyDescriptorSigning => 'Clef de signature',
samlIDPSSODescriptorSingleSignOnService => 'Single Sign on',
samlIDPSSODescriptorSingleSignOnServiceHTTP => 'HTTP Service',
samlIDPSSODescriptorSingleSignOnServiceSOAP => 'SOAP Service',
samlIDPSSODescriptorSingleLogoutService => 'Single Logout',
samlIDPSSODescriptorSingleLogoutServiceHTTP => 'HTTP Service',
samlIDPSSODescriptorSingleLogoutServiceSOAP => 'SOAP Service',
samlIDPSSODescriptorArtifactResolutionService => 'Artifact Resolution',
samlIDPSSODescriptorKeyDescriptorSigning => 'Clef de signature',
samlIDPSSODescriptorSingleSignOnService => 'Single Sign on',
samlIDPSSODescriptorSingleSignOnServiceHTTP => 'HTTP Service',
samlIDPSSODescriptorSingleSignOnServiceSOAP => 'SOAP Service',
samlIDPSSODescriptorSingleLogoutService => 'Single Logout',
samlIDPSSODescriptorSingleLogoutServiceHTTP => 'HTTP Service',
samlIDPSSODescriptorSingleLogoutServiceSOAP => 'SOAP Service',
samlIDPSSODescriptorArtifactResolutionService => 'Artifact Resolution',
samlIDPSSODescriptorArtifactResolutionServiceArtifact =>
'Artifact Service',
samlIDPSSODescriptorNameIDFormat => 'NameID Format',
samlIDPSSODescriptorNameIDFormat => 'NameID Format',
samlIDPSSODescriptorNameIDFormatX509SubjectName => 'x509',
samlIDPSSODescriptorNameIDFormatPersistent => 'Persistent',
samlIDPSSODescriptorNameIDFormatTransient => 'Transient',
samlIDPSSODescriptorManageNameIDService => 'NameID Manager',
samlIDPSSODescriptorManageNameIDServiceHTTP => 'HTTP Service',
samlIDPSSODescriptorManageNameIDServiceSOAP => 'SOAP Service',
samlIDPSSODescriptorManageNameIDService => 'NameID Manager',
samlIDPSSODescriptorManageNameIDServiceHTTP => 'HTTP Service',
samlIDPSSODescriptorManageNameIDServiceSOAP => 'SOAP Service',
};
}
sub fr {
return {
advancedParams => 'Paramètres avancés',
authentication => "Module d'authentification",
advancedParams => 'Paramètres avancés',
authentication => "Module d'authentification",
authParams => "Authentification",
clickHereToForce => 'Cliquer ici pour forcer',
Configuration => 'Configuration',
Configuration => 'Configuration',
confModuledeprecated =>
"Ce module est obsolète, indiquez \"forceUpload=1\" dans le fichier lemonldap-ng.ini pour l'utiliser",
confSaved => 'Configuration sauvegardée',
confWasChanged => 'Configuration modifiée entre-temps',
cookieExpiration => 'Durée de vie du cookie',
cookieName => 'Nom du cookie',
confSaved => 'Configuration sauvegardée',
confWasChanged => 'Configuration modifiée entre-temps',
cookieExpiration => 'Durée de vie du cookie',
cookieName => 'Nom du cookie',
cookieParams => 'Cookies',
databaseLocked => 'Base de donnée verrouillée par un autre processus',
domain => 'Domaine',
databaseLocked => 'Base de donnée verrouillée par un autre processus',
domain => 'Domaine',
exportedAttr => 'Attributs exportés par le portail (SOAP)',
exportedVars => 'Attributs à exporter',
exportedVars => 'Attributs à exporter',
generalParameters => 'Paramètres généraux',
globalStorage => 'Module Apache::Session',
globalStorageOptions => 'Paramètres du module Apache::Session',
@ -220,9 +220,9 @@ sub fr {
notificationStorageOptions => 'Paramètres du module de stockage',
notifyDeleted => 'Affiche les sessions effacées',
notifyOther => 'Affiche les autres sessions',
passwordDB => 'Type de base de données des mots-de-passe',
passwordManagement => 'Gestion des mots-de-passe',
portal => 'Portail',
passwordDB => 'Type de base de données des mots-de-passe',
passwordManagement => 'Gestion des mots-de-passe',
portal => 'Portail',
portalAutocomplete => 'Auto complétion',
portalDisplayAppslist => 'Affichage liste des applications',
portalDisplayChangePassword => 'Affichage changement de mot de passe',
@ -237,57 +237,57 @@ sub fr {
portalUserAttr => "Attribut de l'utilisateur",
randomPasswordRegexp =>
'Expression regulière pour la génération des mots-de-passe',
rules => 'Règles',
securedCookie => 'Cookie sécurisé (SSL)',
rules => 'Règles',
securedCookie => 'Cookie sécurisé (SSL)',
sessionParams => 'Sessions',
sessionStorage => 'Stockage des sessions',
singleIP => 'Une seule IP par utilisateur',
singleSession => 'Une seule session par utilisateur',
singleUserByIP => 'Une seule adresse IP par utilisateur',
SMTPServer => 'Serveur SMTP',
Soap => 'Active les fonctions SOAP du portail',
sessionStorage => 'Stockage des sessions',
singleIP => 'Une seule IP par utilisateur',
singleSession => 'Une seule session par utilisateur',
singleUserByIP => 'Une seule adresse IP par utilisateur',
SMTPServer => 'Serveur SMTP',
Soap => 'Active les fonctions SOAP du portail',
storePassword =>
"Stocke le mot-de-passe de l'utilisateur dans les données de session",
syntaxError => 'Erreur de syntaxe',
syslog => 'Facilité syslog',
timeout => 'Durée de vie des sessions',
trustedDomains => 'Domaines appouvés',
syntaxError => 'Erreur de syntaxe',
syslog => 'Facilité syslog',
timeout => 'Durée de vie des sessions',
trustedDomains => 'Domaines appouvés',
unknownError => 'Erreur inconnue',
uploadDenied => 'Téléchargement refusé',
userDB => "Type de base de données d'utilisateurs",
userControl => "Contrôle du nom d'utilisateur",
uploadDenied => 'Téléchargement refusé',
userDB => "Type de base de données d'utilisateurs",
userControl => "Contrôle du nom d'utilisateur",
useXForwardedForIP =>
"Utiliser l'adresse IP de l'en-tête X-Forwarded-For",
variables => "Variables",
virtualHosts => 'Hôtes virtuels',
variables => "Variables",
virtualHosts => 'Hôtes virtuels',
whatToTrace => "Variable d'environnement REMOTE_USER",
saml => 'SAML',
samlServicePrivateKey => 'Clé privée',
samlIDPMetaDataNode => 'Fournisseurs d\'identités',
samlIDPMetaDataXML => 'XML Metadata',
saml => 'SAML',
samlServicePrivateKey => 'Clé privée',
samlIDPMetaDataNode => 'Fournisseurs d\'identités',
samlIDPMetaDataXML => 'XML Metadata',
samlIDPMetaDataExportedAttributes => 'Attributs exportés',
samlServiceMetaData => 'Service SAML 2',
samlEntityID => 'Identifiant d\'entité',
samlOrganization => 'Organisation',
samlOrganizationDisplayName => 'Nom affiché',
samlOrganizationName => 'Nom',
samlOrganizationURL => 'URL',
samlSPSSODescriptor => 'Fournisseur de service',
samlServiceMetaData => 'Service SAML 2',
samlEntityID => 'Identifiant d\'entité',
samlOrganization => 'Organisation',
samlOrganizationDisplayName => 'Nom affiché',
samlOrganizationName => 'Nom',
samlOrganizationURL => 'URL',
samlSPSSODescriptor => 'Fournisseur de service',
samlSPSSODescriptorAuthnRequestsSigned =>
'Requête d\'authentification signé',
samlSPSSODescriptorProtocolSupportEnumeration => 'Protocole',
samlSPSSODescriptorKeyDescriptorSigning => 'Clef de signature',
samlSPSSODescriptorSingleLogoutService => 'Single Logout',
samlSPSSODescriptorSingleLogoutServiceHTTP => 'Service HTTP',
samlSPSSODescriptorSingleLogoutServiceSOAP => 'Service SOAP',
samlSPSSODescriptorAssertionConsumerService => 'Assertions',
samlSPSSODescriptorKeyDescriptorSigning => 'Clef de signature',
samlSPSSODescriptorSingleLogoutService => 'Single Logout',
samlSPSSODescriptorSingleLogoutServiceHTTP => 'Service HTTP',
samlSPSSODescriptorSingleLogoutServiceSOAP => 'Service SOAP',
samlSPSSODescriptorAssertionConsumerService => 'Assertions',
samlSPSSODescriptorAssertionConsumerServiceHTTPArtifact =>
'HTTP Artifact',
samlSPSSODescriptorAssertionConsumerServiceHTTPPost => 'POST HTTP',
samlSPSSODescriptorAssertionConsumerServiceHTTPRedirect =>
'Redirection HTTP',
samlSPSSODescriptorNameIDFormat => 'Format NameID',
samlSPSSODescriptorNameIDFormat => 'Format NameID',
samlSPSSODescriptorNameIDFormatX509SubjectName => 'x509',
samlSPSSODescriptorNameIDFormatPersistent => 'Persistant',
samlSPSSODescriptorNameIDFormatTransient => 'Temporaire',
@ -295,22 +295,22 @@ sub fr {
samlIDPSSODescriptorWantAuthnRequestsSigned =>
'Requête d\'authentification signé',
samlIDPSSODescriptorProtocolSupportEnumeration => 'Protocole',
samlIDPSSODescriptorKeyDescriptorSigning => 'Clef de signature',
samlIDPSSODescriptorSingleSignOnService => 'Single Sign on',
samlIDPSSODescriptorSingleSignOnServiceHTTP => 'Service HTTP',
samlIDPSSODescriptorSingleSignOnServiceSOAP => 'Service SOAP',
samlIDPSSODescriptorSingleLogoutService => 'Single Logout',
samlIDPSSODescriptorSingleLogoutServiceHTTP => 'Service HTTP',
samlIDPSSODescriptorSingleLogoutServiceSOAP => 'Service SOAP',
samlIDPSSODescriptorKeyDescriptorSigning => 'Clef de signature',
samlIDPSSODescriptorSingleSignOnService => 'Single Sign on',
samlIDPSSODescriptorSingleSignOnServiceHTTP => 'Service HTTP',
samlIDPSSODescriptorSingleSignOnServiceSOAP => 'Service SOAP',
samlIDPSSODescriptorSingleLogoutService => 'Single Logout',
samlIDPSSODescriptorSingleLogoutServiceHTTP => 'Service HTTP',
samlIDPSSODescriptorSingleLogoutServiceSOAP => 'Service SOAP',
samlIDPSSODescriptorArtifactResolutionService =>
'Résolution d\'Artifact',
samlIDPSSODescriptorArtifactResolutionServiceArtifact =>
'Service Artifact',
samlIDPSSODescriptorNameIDFormat => 'Format NameID',
samlIDPSSODescriptorNameIDFormat => 'Format NameID',
samlIDPSSODescriptorNameIDFormatX509SubjectName => 'x509',
samlIDPSSODescriptorNameIDFormatPersistent => 'Persistant',
samlIDPSSODescriptorNameIDFormatTransient => 'Temporaire',
samlIDPSSODescriptorManageNameIDService => 'Gestionnaire de NameID',
samlIDPSSODescriptorManageNameIDService => 'Gestionnaire de NameID',
samlIDPSSODescriptorManageNameIDServiceHTTP => 'Service HTTP',
samlIDPSSODescriptorManageNameIDServiceSOAP => 'Service SOAP',
};

View File

@ -249,7 +249,7 @@ sub process {
elsif ( $urldir eq $self->PC_LA_URLFTR ) {
$self->{error} = $self->_subProcess(
qw( libertyFederationTerminationReturn autoRedirect ) );
qw( libertyFederationTerminationReturn autoRedirect ));
# singleLogout : called when IDP request Logout.
}

View File

@ -101,7 +101,7 @@ sub new {
# Password modification functions (TODO merge Menu.pm in Simple.pm to inherits those functions)
# Default to LDAP
$self->{portalObject}->{passwordDB} ||= 'LDAP';
if ( $self->{portalObject}->{passwordDB} =~ /DBI/i ) {
if ( $self->{portalObject}->{passwordDB} =~ /DBI/i ) {
use Lemonldap::NG::Portal::PasswordDBDBI; #inherits
use Lemonldap::NG::Portal::_DBI
; #link protected dbi Object used to change passwords only
@ -110,13 +110,13 @@ sub new {
*_passwordDBInit =
*Lemonldap::NG::Portal::PasswordDBDBI::passwordDBInit;
}
if ( $self->{portalObject}->{passwordDB} =~ /Null/i ) {
use Lemonldap::NG::Portal::PasswordDBNull; #inherits
*_modifyPassword =
*Lemonldap::NG::Portal::PasswordDBNull::modifyPassword;
*_passwordDBInit =
*Lemonldap::NG::Portal::PasswordDBNull::passwordDBInit;
}
if ( $self->{portalObject}->{passwordDB} =~ /Null/i ) {
use Lemonldap::NG::Portal::PasswordDBNull; #inherits
*_modifyPassword =
*Lemonldap::NG::Portal::PasswordDBNull::modifyPassword;
*_passwordDBInit =
*Lemonldap::NG::Portal::PasswordDBNull::passwordDBInit;
}
if ( $self->{portalObject}->{passwordDB} =~ /LDAP/i ) {
use Lemonldap::NG::Portal::PasswordDBLDAP; #inherits
use Lemonldap::NG::Portal::_LDAP
@ -482,7 +482,7 @@ sub _isCategoryEmpty {
# Return false
return 0;
}
}
else {
# Return true

View File

@ -113,7 +113,7 @@ sub getNotification {
# Prepare HTML code
@notifs = map { $n->{$_} } sort keys %$n;
my $i = 0; # Notification count
my $i = 0; # Notification count
foreach my $notif (@notifs) {
$i++;
eval {

View File

@ -51,7 +51,7 @@ sub modifyPassword {
$self->{dbiAuthPassword} );
return PE_ERROR unless $dbh;
my $user = $self->{sessionInfo}->{_user};
my $user = $self->{sessionInfo}->{_user};
# Check old passord
if ( $self->{oldpassword} ) {
@ -99,7 +99,7 @@ sub resetPassword {
return PE_OK unless ( $self->{mail} && $self->{mail_token} );
$self->lmLog( "Reset password request for " . $self->{mail}, 'debug' );
# Generate a complex password
my $password = $self->gen_password( $self->{randomPasswordRegexp} );

View File

@ -104,7 +104,7 @@ use constant {
PM_PP_EXP_WARNING => 7,
PM_SAML_IDPSELECT => 8,
PM_SAML_IDPCHOOSEN => 9,
PM_REMEMBERCHOICE => 10,
PM_REMEMBERCHOICE => 10,
};
# EXPORTER PARAMETERS
@ -333,7 +333,7 @@ sub setDefaultValues {
"[LemonLDAP::NG] Password reset confirmation";
$self->{mailSessionKey} ||= 'mail';
$self->{mailUrl} ||= $self->{portal} . "/mail.pl";
$self->{issuerDB} ||= 'Null';
$self->{issuerDB} ||= 'Null';
# Set default userDB and passwordDB to DBI if authentication is DBI
if ( $self->{authentication} =~ /DBI/i ) {
@ -668,13 +668,13 @@ sub _deleteSession {
# @param $variable
# @return void
sub _dump {
my $self = shift;
my $variable = shift;
my $self = shift;
my $variable = shift;
use Data::Dumper;
use Data::Dumper;
$self->lmLog( "Dump: " . Dumper($variable), 'debug' );
return;
return;
}
##@method protected string info(string t)
@ -852,7 +852,7 @@ sub controlExistingSession {
# Redirect or Post if asked by authLogout
$self->_subProcess(qw(autoRedirect))
if ( $self->{urldc} and $self->{urldc} ne $self->{portal} );
$self->_subProcess(qw(autoPost)) if ( $self->{postUrl} );
$self->_subProcess(qw(autoPost)) if ( $self->{postUrl} );
# Display logout message
return PE_LOGOUT_OK;
@ -954,7 +954,7 @@ sub issuerDBInit {
my $issuerDB;
# Get the current issuer module
$issuerDB = $self->{issuerDB};
$issuerDB = $self->{issuerDB};
$self->{sessionInfo}->{_issuerDB} = $issuerDB;
@ -1001,7 +1001,7 @@ sub passwordDBInit {
my $passwordDB;
# Get the current password module
$passwordDB = $self->{passwordDB};
$passwordDB = $self->{passwordDB};
$self->{sessionInfo}->{_passwordDB} = $passwordDB;
@ -1056,15 +1056,15 @@ sub setSessionInfo {
);
}
else {
$self->{sessionInfo}->{_utime} = time();
$self->{sessionInfo}->{startTime} =
&POSIX::strftime( "%Y%m%d%H%M%S", localtime() );
$self->lmLog(
$self->{sessionInfo}->{_utime} = time();
$self->{sessionInfo}->{startTime} =
&POSIX::strftime( "%Y%m%d%H%M%S", localtime() );
$self->lmLog(
"Store startTime: "
. $self->{sessionInfo}->{startTime}
. " in session",
'debug'
);
'debug'
);
}
return $self->SUPER::setSessionInfo();
}

View File

@ -121,7 +121,7 @@ sub setSessionInfo {
# Load all groups in $groups.
# @return Lemonldap::NG::Portal constant
sub setGroups {
my $self = shift;
my $self = shift;
my $groups = $self->{sessionInfo}->{groups};
if ( $self->{ldapGroupBase} ) {
@ -135,7 +135,9 @@ sub setGroups {
and $self->{ldapGroupAttributeNameGroup} ne "dn" );
# Get value for group search
my $group_value = $self->{ldap}->getLdapValue( $self->{entry}, $self->{ldapGroupAttributeNameUser} );
my $group_value =
$self->{ldap}
->getLdapValue( $self->{entry}, $self->{ldapGroupAttributeNameUser} );
$self->lmLog(
"Searching LDAP groups in "
@ -148,8 +150,8 @@ sub setGroups {
$groups .= $self->{ldap}->searchGroups(
$self->{ldapGroupBase}, $self->{ldapGroupAttributeName},
$group_value, $self->{ldapGroupAttributeNameSearch}
);
}
);
}
$self->{sessionInfo}->{groups} = $groups;
PE_OK;

View File

@ -29,7 +29,7 @@ sub getUser {
# @return Lemonldap::NG::Portal constant
sub setSessionInfo {
my $self = shift;
$self->{sessionInfo}->{$self->{whatToTrace}} = $self->{user};
$self->{sessionInfo}->{ $self->{whatToTrace} } = $self->{user};
PE_OK;
}

View File

@ -49,9 +49,9 @@ sub dbh {
# @param hash hash mechanism
# @return hashed password
sub hash_password {
my $self = shift;
my $self = shift;
my $password = shift;
my $hash = shift;
my $hash = shift;
if ( $hash =~ /^(md5|sha|sha1)$/i ) {
$self->lmLog( "Using " . uc($hash) . " to hash password", 'debug' );
@ -71,7 +71,7 @@ sub hash_password {
# @param password password
# @return boolean result
sub check_password {
my $self = shift;
my $self = shift;
my $dbh = shift;
my $user = $self->{user};
my $password = $self->{password};
@ -118,12 +118,12 @@ sub check_password {
# @param passwordCol optional password column
# @return boolean result
sub modify_password {
my $self = shift;
my $user = shift;
my $password = shift;
my $userCol = shift || $self->{dbiAuthLoginCol};
my $self = shift;
my $user = shift;
my $password = shift;
my $userCol = shift || $self->{dbiAuthLoginCol};
my $passwordCol = shift || $self->{dbiAuthPasswordCol};
my $table = $self->{dbiAuthTable};
eval {

View File

@ -393,9 +393,11 @@ sub searchGroups {
if ( $portal->{ldapGroupRecursive} ) {
# Get searched value
my $group_value = $self->getLdapValue( $entry, $portal->{ldapGroupAttributeNameGroup} );
my $group_value =
$self->getLdapValue( $entry,
$portal->{ldapGroupAttributeNameGroup} );
# Launch group search
# Launch group search
if ($group_value) {
$portal->lmLog( "Recursive search for $group_value",
@ -438,22 +440,22 @@ sub searchGroups {
# @param string attribute name
# @return string value
sub getLdapValue {
my $self = shift;
my $entry = shift;
my $attribute = shift;
my $self = shift;
my $entry = shift;
my $attribute = shift;
return $entry->dn() if ( $attribute eq "dn" );
return $entry->dn() if ( $attribute eq "dn" );
my $value;
my $value;
foreach ( $entry->get_value( $attribute ) ) {
$value .= $_;
$value .= ";";
}
foreach ( $entry->get_value($attribute) ) {
$value .= $_;
$value .= ";";
}
$value =~ s/;$//g;
$value =~ s/;$//g;
return $value;
return $value;
}
1;

View File

@ -16,7 +16,7 @@ our $VERSION = '0.2';
# @param regexp regular expression
# @return complex password
sub gen_password {
my $self = shift;
my $self = shift;
my $regexp = shift;
my $random = new String::Random;
@ -31,17 +31,17 @@ sub gen_password {
# @param html optional set content type to HTML
# @return boolean result
sub send_mail {
my $self = shift;
my $mail = shift;
my $self = shift;
my $mail = shift;
my $subject = shift;
my $body = shift;
my $html = shift;
my $body = shift;
my $html = shift;
$self->lmLog( "SMTP From " . $self->{mailFrom}, 'debug' );
$self->lmLog( "SMTP To " . $mail, 'debug' );
$self->lmLog( "SMTP Subject " . $subject, 'debug' );
$self->lmLog( "SMTP Body " . $body, 'debug' );
$self->lmLog( "SMTP HTML flag " . ($html?"on":"off"), 'debug' );
$self->lmLog( "SMTP From " . $self->{mailFrom}, 'debug' );
$self->lmLog( "SMTP To " . $mail, 'debug' );
$self->lmLog( "SMTP Subject " . $subject, 'debug' );
$self->lmLog( "SMTP Body " . $body, 'debug' );
$self->lmLog( "SMTP HTML flag " . ( $html ? "on" : "off" ), 'debug' );
eval {
my $message = MIME::Lite->new(
From => $self->{mailFrom},
@ -50,7 +50,7 @@ sub send_mail {
Type => "TEXT",
Data => $body,
);
$message->attr("content-type" => "text/html; charset=utf-8") if $html;
$message->attr( "content-type" => "text/html; charset=utf-8" ) if $html;
$self->{SMTPServer}
? $message->send( "smtp", $self->{SMTPServer} )
: $message->send();

View File

@ -238,7 +238,7 @@ _RETURN $isAuthorizedURIResponse Response
sub isAuthorizedURI {
my $self = shift;
my ( $id, $uri ) = @_;
die 'id is required' unless ($id);
die 'id is required' unless ($id);
die 'uri is required' unless ($uri);
# Get user session.

View File

@ -26,9 +26,9 @@ sub extractFormInfo {
unless ( $self->param('user') );
return PE_FORMEMPTY
unless (
( $self->{user} = $self->param('user') )
&& ( ( $self->{password} = $self->param('password') )
|| ( $self->{newpassword} = $self->param('newpassword') ) )
( $self->{user} = $self->param('user') )
&& ( ( $self->{password} = $self->param('password') )
|| ( $self->{newpassword} = $self->param('newpassword') ) )
);
$self->{oldpassword} = $self->param('oldpassword');
$self->{confirmpassword} = $self->param('confirmpassword');

View File

@ -220,7 +220,7 @@ sub error_en {
'Confirmation key is invalid or too old',
'An error occurs when sending mail',
'A mail has been sent',
'You have been disconnected',
'You have been disconnected',
];
}
@ -277,7 +277,7 @@ sub error_ro {
'Cheie de confirmare este invalid sau prea veche',
'Trimiterea mail nu a reuşit',
'Un e-mail a fost trimis',
'Aţi fost deconectat',
'Aţi fost deconectat',
];
}