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/index.pl $(LMPREFIX)/htdocs/manager/index.pl ||true
@$(DIFF) lemonldap-ng-manager/example/sessions.pl $(LMPREFIX)/htdocs/manager/sessions.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; package Lemonldap::NG::Common;
our $VERSION='0.95'; our $VERSION = '0.95';
use strict; 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 $r = $self->_soapCall( "get_key_from_all_sessions", $args );
my $res; my $res;
if ($r) { if ($r) {
foreach my $k ( keys %$r ) { foreach my $k ( keys %$r ) {
my $tmp = &$data( $r->{$k}, $k ); my $tmp = &$data( $r->{$k}, $k );
$res->{$k} = $tmp if ( defined($tmp) ); $res->{$k} = $tmp if ( defined($tmp) );
}
} }
} }
}
else { else {
return $self->_soapCall( "get_key_from_all_sessions", $args, $data ); 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 non form encoded datas are posted, we call SOAP Services
if ( $ENV{HTTP_SOAPACTION} ) { if ( $ENV{HTTP_SOAPACTION} ) {
require Lemonldap::NG::Common::CGI::SOAPServer; #link protected dispatcher require
require Lemonldap::NG::Common::CGI::SOAPService; #link protected soapService Lemonldap::NG::Common::CGI::SOAPServer; #link protected dispatcher
require
Lemonldap::NG::Common::CGI::SOAPService; #link protected soapService
my @func = ( my @func = (
ref($soapFunctions) ? @$soapFunctions : split /\s+/, ref($soapFunctions) ? @$soapFunctions : split /\s+/,
$soapFunctions $soapFunctions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -249,7 +249,7 @@ sub process {
elsif ( $urldir eq $self->PC_LA_URLFTR ) { elsif ( $urldir eq $self->PC_LA_URLFTR ) {
$self->{error} = $self->_subProcess( $self->{error} = $self->_subProcess(
qw( libertyFederationTerminationReturn autoRedirect ) ); qw( libertyFederationTerminationReturn autoRedirect ));
# singleLogout : called when IDP request Logout. # 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) # Password modification functions (TODO merge Menu.pm in Simple.pm to inherits those functions)
# Default to LDAP # Default to LDAP
$self->{portalObject}->{passwordDB} ||= '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::PasswordDBDBI; #inherits
use Lemonldap::NG::Portal::_DBI use Lemonldap::NG::Portal::_DBI
; #link protected dbi Object used to change passwords only ; #link protected dbi Object used to change passwords only
@ -110,13 +110,13 @@ sub new {
*_passwordDBInit = *_passwordDBInit =
*Lemonldap::NG::Portal::PasswordDBDBI::passwordDBInit; *Lemonldap::NG::Portal::PasswordDBDBI::passwordDBInit;
} }
if ( $self->{portalObject}->{passwordDB} =~ /Null/i ) { if ( $self->{portalObject}->{passwordDB} =~ /Null/i ) {
use Lemonldap::NG::Portal::PasswordDBNull; #inherits use Lemonldap::NG::Portal::PasswordDBNull; #inherits
*_modifyPassword = *_modifyPassword =
*Lemonldap::NG::Portal::PasswordDBNull::modifyPassword; *Lemonldap::NG::Portal::PasswordDBNull::modifyPassword;
*_passwordDBInit = *_passwordDBInit =
*Lemonldap::NG::Portal::PasswordDBNull::passwordDBInit; *Lemonldap::NG::Portal::PasswordDBNull::passwordDBInit;
} }
if ( $self->{portalObject}->{passwordDB} =~ /LDAP/i ) { if ( $self->{portalObject}->{passwordDB} =~ /LDAP/i ) {
use Lemonldap::NG::Portal::PasswordDBLDAP; #inherits use Lemonldap::NG::Portal::PasswordDBLDAP; #inherits
use Lemonldap::NG::Portal::_LDAP use Lemonldap::NG::Portal::_LDAP
@ -482,7 +482,7 @@ sub _isCategoryEmpty {
# Return false # Return false
return 0; return 0;
} }
else { else {
# Return true # Return true

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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