Commit 690f09b6 authored by Clément OUDOT's avatar Clément OUDOT
parent f2ff80ac
......@@ -265,7 +265,7 @@ sub _LDAPGKFAS {
my ( $k, $v ) =
( $entry->get_value('cn'), $entry->get_value('description') );
eval { $v = decodeThaw64($v); };
next if($@);
next if ($@);
if ( ref($data) eq 'CODE' ) {
$res{$k} = &$data( $v, $k );
}
......
......@@ -21,7 +21,7 @@ use constant PORTALSECTION => "portal";
use constant HANDLERSECTION => "handler";
use constant MANAGERSECTION => "manager";
use constant SESSIONSEXPLORERSECTION => "sessionsExplorer";
use constant APPLYSECTION => "apply";
use constant APPLYSECTION => "apply";
our %EXPORT_TAGS = (
'all' => [
......
......@@ -15,7 +15,7 @@ sub store {
while ( my ( $k, $v ) = each %$fields ) {
my $tmp =
$self->_dbh->prepare( "insert into "
. $self->{dbiTable}
. $self->{dbiTable}
. " (cfgNum,field,value) values (?,?,?)" );
unless ( $tmp and $tmp->execute( $fields->{cfgNum}, $k, $v ) ) {
$self->logError;
......
......@@ -27,7 +27,7 @@ use base qw(Lemonldap::NG::Handler::Vhost Lemonldap::NG::Handler::Simple);
#parameter reloadTime Time in second between 2 configuration check (600)
our $VERSION = '1.0.0';
our $VERSION = '1.0.0';
our $cfgNum = 0;
our $lastReload = 0;
our $reloadTime;
......@@ -122,7 +122,7 @@ sub localInit {
sub run($$) {
my ( $class, $r ) = splice @_;
if ( time() - $lastReload > $reloadTime ) {
die( "$class: No configuration found" )
die("$class: No configuration found")
unless ( $class->testConf(1) == OK );
}
return $class->SUPER::run($r);
......
......@@ -246,10 +246,10 @@ sub regRemoteIp {
sub lmSetHeaderIn {
my ( $r, %hdr ) = splice @_;
while ( my ( $h, $v ) = each %hdr ) {
if ( MP() == 2 ) {
if ( MP() == 2 ) {
$r->headers_in->set( $h => $v );
}
elsif ( MP() == 1 ) {
}
elsif ( MP() == 1 ) {
$r->header_in( $h => $v );
}
}
......@@ -495,43 +495,43 @@ sub conditionSub {
return ( sub { 1 }, 1 );
}
# logout_app
if ( $cond =~ /^logout_app(?:\s+(.*))?$/i ) {
my $u = $1 || $class->portal();
eval 'use Apache2::Filter' unless ( $INC{"Apache2/Filter.pm"} );
return (
sub {
$apacheRequest->add_output_filter(
sub {
return $class->redirectFilter( $u, @_ );
}
);
1;
},
1
);
}
elsif ( $cond =~ /^logout_app_sso(?:\s+(.*))?$/i ) {
eval 'use Apache2::Filter' unless ( $INC{"Apache2/Filter.pm"} );
my $u = $1 || $class->portal();
return (
sub {
$class->localUnlog;
$apacheRequest->add_output_filter(
sub {
return $class->redirectFilter(
$class->portal() . "?url="
. $class->encodeUrl($u)
. "&logout=1",
@_
);
}
);
1;
},
1
);
}
# logout_app
if ( $cond =~ /^logout_app(?:\s+(.*))?$/i ) {
my $u = $1 || $class->portal();
eval 'use Apache2::Filter' unless ( $INC{"Apache2/Filter.pm"} );
return (
sub {
$apacheRequest->add_output_filter(
sub {
return $class->redirectFilter( $u, @_ );
}
);
1;
},
1
);
}
elsif ( $cond =~ /^logout_app_sso(?:\s+(.*))?$/i ) {
eval 'use Apache2::Filter' unless ( $INC{"Apache2/Filter.pm"} );
my $u = $1 || $class->portal();
return (
sub {
$class->localUnlog;
$apacheRequest->add_output_filter(
sub {
return $class->redirectFilter(
$class->portal() . "?url="
. $class->encodeUrl($u)
. "&logout=1",
@_
);
}
);
1;
},
1
);
}
# Replace some strings in condition
$cond =~ s/\$date/&POSIX::strftime("%Y%m%d%H%M%S",localtime())/e;
......
......@@ -48,6 +48,7 @@ ok(
);
ok( $h->defaultValuesInit(), 'defaultValuesInit' );
# Test simple portal subroutine
# See t/02-* for complex portal subroutine
ok( ( $h->portalInit( { portal => 'http://auth.example.com' } ) or 1 ),
......
......@@ -5,11 +5,11 @@
# change 'tests => 1' to 'tests => last_test_to_print';
no warnings;
use Test::More; #qw(no_plan)
use Test::More; #qw(no_plan)
eval { require Test::MockObject }
or plan skip_all => 'Test::MockObject required to test portal subroutine';
plan tests => 2;
or plan skip_all => 'Test::MockObject required to test portal subroutine';
plan tests => 2;
#########################
......@@ -24,9 +24,10 @@ $h = bless {}, 'Lemonldap::NG::Handler::Simple';
# Create a fake Apache2::RequestRec
my $mock = Test::MockObject->new();
$mock->fake_module('Apache2::RequestRec' =>
new => sub { return bless {}, 'Apache2::RequestRec' },
hostname => sub { 'test.example.com' },
$mock->fake_module(
'Apache2::RequestRec' => new =>
sub { return bless {}, 'Apache2::RequestRec' },
hostname => sub { 'test.example.com' },
);
our $apacheRequest = Apache2::RequestRec->new();
......
......@@ -27,11 +27,11 @@ my $cgi = Lemonldap::NG::Manager::Sessions->new(
}
) or Lemonldap::NG::Common::CGI->abort('Unable to start sessions explorer');
my $skin = $cgi->{managerSkin} or $cgi->abort('managerSkin is not defined');
my $css = 'tree.css';
my $skin = $cgi->{managerSkin} or $cgi->abort('managerSkin is not defined');
my $css = 'tree.css';
my $css_theme = 'ui-lightness';
my $skin_dir = 'skins';
my $main_dir = $ENV{DOCUMENT_ROOT};
my $skin_dir = 'skins';
my $main_dir = $ENV{DOCUMENT_ROOT};
my $template = HTML::Template->new(
filename => "$main_dir/$skin_dir/$skin/sessions.tpl",
......@@ -39,10 +39,10 @@ my $template = HTML::Template->new(
cache => 0,
filter => sub { $cgi->translate_template(@_) },
);
$template->param( SCRIPT_NAME => $ENV{SCRIPT_NAME} );
$template->param( TREE => $cgi->tree() );
$template->param( DIR => "$skin_dir/$skin" );
$template->param( CSS => $css );
$template->param( SCRIPT_NAME => $ENV{SCRIPT_NAME} );
$template->param( TREE => $cgi->tree() );
$template->param( DIR => "$skin_dir/$skin" );
$template->param( CSS => $css );
$template->param( CSS_THEME => $css_theme );
print $cgi->header('text/html; charset=utf-8');
print $template->output;
......
......@@ -280,7 +280,7 @@ sub struct {
_nodes => [
'applicationlist:/applicationList:menuCatAndApp:applicationListCategory'
],
_js => 'applicationListCategoryRoot',
_js => 'applicationListCategoryRoot',
_help => 'menuCatAndApp',
},
},
......@@ -610,14 +610,14 @@ sub struct {
issuerDBCASPath => 'text:/issuerDBCASPath',
issuerDBCASRule =>
'text:/issuerDBCASRule:issuerdbCAS:boolOrPerlExpr',
issuerDBCASOptions => {
issuerDBCASOptions => {
_nodes => [qw(casAttr casStorage cn:casStorageOptions)],
casAttr => 'text:/casAttr',
casStorage => 'text:/casStorage',
casStorageOptions => {
_nodes =>
['hash:/casStorageOptions:issuerDBCAS:btext'],
_js => 'hashRoot',
_js => 'hashRoot',
_help => 'issuerdbCAS',
},
},
......@@ -629,7 +629,7 @@ sub struct {
_help => 'issuerdbOpenID',
issuerDBOpenIDActivation =>
'bool:/issuerDBOpenIDActivation',
issuerDBOpenIDPath => 'text:/issuerDBOpenIDPath',
issuerDBOpenIDPath => 'text:/issuerDBOpenIDPath',
issuerDBOpenIDRule =>
'text:/issuerDBOpenIDRule:issuerdbOpenID:boolOrPerlExpr',
issuerDBOpenIDOptions => {
......@@ -700,7 +700,7 @@ sub struct {
globalStorageOptions => {
_nodes =>
['hash:/globalStorageOptions:sessionsdb:btext'],
_js => 'hashRoot',
_js => 'hashRoot',
_help => 'sessionsdb',
},
},
......@@ -770,7 +770,7 @@ sub struct {
userControl => 'text:/userControl',
portalForceAuthn => 'bool:/portalForceAuthn',
key => 'text:/key',
trustedDomains => 'text:/trustedDomains',
trustedDomains => 'text:/trustedDomains',
},
redirection => {
......@@ -1107,7 +1107,7 @@ sub struct {
samlStorageOptions => {
_nodes =>
['hash:/samlStorageOptions:samlServiceAdvanced:btext'],
_js => 'hashRoot',
_js => 'hashRoot',
_help => 'samlServiceAdvanced',
},
samlCommonDomainCookie => {
......
......@@ -510,39 +510,39 @@ sub fr {
error => 'Erreur',
exportedAttr => 'Attributs exportés par le portail (SOAP)',
exportedVars => 'Attributs à exporter',
generalParameters => 'Paramètres généraux',
globalStorage => 'Module Apache::Session',
globalStorageOptions => 'Paramètres du module Apache::Session',
grantSessionRule => "Conditions d'ouverture",
groups => 'Groupes',
headers => 'En-têtes HTTP',
generalParameters => 'Paramètres généraux',
globalStorage => 'Module Apache::Session',
globalStorageOptions => 'Paramètres du module Apache::Session',
grantSessionRule => "Conditions d'ouverture",
groups => 'Groupes',
headers => 'En-têtes HTTP',
https => 'HTTPS',
ipAddr => 'Adresse IP',
issuerParams => 'Modules fournisseur',
issuerDBSAML => 'SAML',
issuerDBSAMLActivation => 'Activation',
issuerDBSAMLPath => 'Chemin',
issuerDBSAMLRule => 'Règle d\'utilisation',
issuerDBCAS => 'CAS',
issuerDBCASActivation => 'Activation',
issuerDBCASPath => 'Chemin',
issuerDBCASRule => 'Règle d\'utilisation',
issuerDBCASOptions => 'Options',
issuerDBOpenID => 'OpenID',
issuerDBOpenIDActivation => 'Activation',
issuerDBOpenIDPath => 'Chemin',
issuerDBOpenIDRule => 'Règle d\'utilisation',
issuerDBOpenIDOptions => 'Options',
key => 'Clef de chiffrement',
ldap => 'LDAP',
ldapAuthnLevel => 'Niveau d\'authentification',
ldapBase => 'Base de recherche des utilisateurs',
ldapChangePasswordAsUser => 'Changement en tant qu\'utilisateur',
ldapConnection => 'Connexion',
ldapFilters => 'Filtres',
LDAPFilter => 'Filtre par défaut',
ldapGroupAttributeName => 'Attribut cible',
ldapGroupAttributeNameGroup => 'Attribut source groupe',
ipAddr => 'Adresse IP',
issuerParams => 'Modules fournisseur',
issuerDBSAML => 'SAML',
issuerDBSAMLActivation => 'Activation',
issuerDBSAMLPath => 'Chemin',
issuerDBSAMLRule => 'Règle d\'utilisation',
issuerDBCAS => 'CAS',
issuerDBCASActivation => 'Activation',
issuerDBCASPath => 'Chemin',
issuerDBCASRule => 'Règle d\'utilisation',
issuerDBCASOptions => 'Options',
issuerDBOpenID => 'OpenID',
issuerDBOpenIDActivation => 'Activation',
issuerDBOpenIDPath => 'Chemin',
issuerDBOpenIDRule => 'Règle d\'utilisation',
issuerDBOpenIDOptions => 'Options',
key => 'Clef de chiffrement',
ldap => 'LDAP',
ldapAuthnLevel => 'Niveau d\'authentification',
ldapBase => 'Base de recherche des utilisateurs',
ldapChangePasswordAsUser => 'Changement en tant qu\'utilisateur',
ldapConnection => 'Connexion',
ldapFilters => 'Filtres',
LDAPFilter => 'Filtre par défaut',
ldapGroupAttributeName => 'Attribut cible',
ldapGroupAttributeNameGroup => 'Attribut source groupe',
ldapGroupAttributeNameSearch => 'Attributs recherchés',
ldapGroupAttributeNameUser => 'Attribut source utilisateur',
ldapGroupBase => 'Base de recherche',
......@@ -678,20 +678,20 @@ sub fr {
useRedirectOnError => 'Redirection pour les erreurs',
useRedirectOnForbidden => 'Redirection pour les accès interdits',
useXForwardedForIP => "Utiliser X-Forwarded-For",
variables => "Variables",
vhostHttps => 'HTTPS',
vhostOptions => 'Options',
vhostPort => 'Port',
virtualHosts => 'Hôtes virtuels',
variables => "Variables",
vhostHttps => 'HTTPS',
vhostOptions => 'Options',
vhostPort => 'Port',
virtualHosts => 'Hôtes virtuels',
warning => 'Attention',
whatToTrace => "REMOTE_USER",
xForwardedForAddr => 'Adresse IP transférée',
zimbraAccountKey => 'Clé de session pour le compte',
zimbraBy => 'Type de compte',
zimbraHandler => 'Zimbra',
zimbraPreAuthKey => 'Clé de préauthentication',
xForwardedForAddr => 'Adresse IP transférée',
zimbraAccountKey => 'Clé de session pour le compte',
zimbraBy => 'Type de compte',
zimbraHandler => 'Zimbra',
zimbraPreAuthKey => 'Clé de préauthentication',
zimbraSsoUrl => 'Motif pour l\'URL de SSO locale ',
zimbraUrl => 'URL de préauthentification',
zimbraUrl => 'URL de préauthentification',
saml => 'SAML',
samlNameIDFormatMap => 'Formats de NameID',
......
......@@ -16,10 +16,10 @@ my $soap =
$soap->default_ns('urn:Lemonldap/NG/Common/CGI/SOAPService');
# Call SOAP methods
my $lastCfg = $soap->call( 'lastCfg' )->result();
print "Last configuration:\n". Dumper $lastCfg;
my $lastCfg = $soap->call('lastCfg')->result();
print "Last configuration:\n" . Dumper $lastCfg;
my $config = $soap->call( 'getConfig' )->result();
print "Configuration data:\n". Dumper $config;
my $config = $soap->call('getConfig')->result();
print "Configuration data:\n" . Dumper $config;
exit;
......@@ -231,8 +231,8 @@ sub display {
DISPLAY_RESETPASSWORD => 0,
DISPLAY_FORM => 0,
AUTH_LOOP => [],
CHOICE_PARAM => $self->{authChoiceParam},
CHOICE_VALUE => $self->{_authChoice},
CHOICE_PARAM => $self->{authChoiceParam},
CHOICE_VALUE => $self->{_authChoice},
);
}
......
......@@ -11,7 +11,7 @@ use Lemonldap::NG::Portal::Simple;
use Lemonldap::NG::Portal::_LibAccess;
use base qw(Lemonldap::NG::Portal::_LibAccess);
our $VERSION = '1.0.0';
our $VERSION = '1.0.0';
our $catlevel = 0;
## @method void menuInit()
......
......@@ -7,7 +7,7 @@ package Lemonldap::NG::Portal::UserDBDBI;
use strict;
use Lemonldap::NG::Portal::Simple;
use Lemonldap::NG::Portal::_DBI; #inherits
use Lemonldap::NG::Portal::_DBI; #inherits
our $VERSION = '1.0.0';
......
......@@ -12,8 +12,8 @@ use Lemonldap::NG::Portal::Simple;
use Encode;
use strict;
our @EXPORT = qw(ldap);
our $VERSION = '1.0.0';
our @EXPORT = qw(ldap);
our $VERSION = '1.0.0';
our $ppLoaded = 0;
BEGIN {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment