environments/ppa-mbqj77/deployments/1
Xavier Guimard 15 years ago
parent 7c0e37d6fd
commit bcc84f0ceb
  1. 6
      modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/_DBI.pm
  2. 4
      modules/lemonldap-ng-handler/t/01-Lemonldap-NG-Handler-Simple.t
  3. 3
      modules/lemonldap-ng-handler/t/30-Lemonldap-NG-Handler-CGI.t
  4. 2
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Downloader.pm
  5. 6
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Sessions.pm
  6. 10
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Uploader.pm
  7. 72
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_Struct.pm
  8. 40
      modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm
  9. 10
      modules/lemonldap-ng-portal/example/index_skin.pl
  10. 2
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBCAS.pm
  11. 2
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBOpenID.pm
  12. 6
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Menu.pm
  13. 24
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Simple.pm
  14. 8
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_Choice.pm
  15. 1
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_LibAccess.pm
  16. 2
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_Remote.pm
  17. 2
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_SOAP.pm
  18. 19
      modules/lemonldap-ng-portal/t/50-Lemonldap-NG-Portal-Menu.t

@ -54,10 +54,8 @@ sub _dbh {
my $self = shift;
$self->{dbiTable} ||= "lmConfig";
return $self->{_dbh} if ( $self->{_dbh} and $self->{_dbh}->ping );
return DBI->connect_cached(
$self->{dbiChain}, $self->{dbiUser},
$self->{dbiPassword}, { RaiseError => 1, AutoCommit => 1, }
);
return DBI->connect_cached( $self->{dbiChain}, $self->{dbiUser},
$self->{dbiPassword}, { RaiseError => 1, AutoCommit => 1, } );
}
sub lock {

@ -53,5 +53,5 @@ ok( $h->forgeHeadersInit, 'forgeHeadersInit' );
ok( $h->forgeHeadersInit( { exportedHeaders => { Auth => '$uid', } } ),
'forgeHeadersInit 2' );
ok( $h->grant('/s'), 'grant OK' );
ok( !$h->grant('/no'), 'grant NOK' );
ok( $h->grant('/s'), 'grant OK' );
ok( !$h->grant('/no'), 'grant NOK' );

@ -9,7 +9,8 @@ use Test::More tests => 1;
BEGIN {
use_ok('Lemonldap::NG::Handler::CGI');
# sub Lemonldap::NG::Handler::CGI::lmLog { }
# sub Lemonldap::NG::Handler::CGI::lmLog { }
}
#########################

@ -289,7 +289,7 @@ sub confNode {
js => "applicationListApplication",
help => $help,
noT => 1
) . "</li>";
) . "</li>";
}

@ -488,8 +488,8 @@ sub session {
'saml' => [
qw(_idp _idpConfKey _samlToken _lassoSessionDump _lassoIdentityDump)
],
'groups' => [qw(groups)],
'ldap' => [qw(dn)],
'groups' => [qw(groups)],
'ldap' => [qw(dn)],
};
# Display categories
@ -514,7 +514,7 @@ sub session {
next unless exists $session{$attribute};
# Display attribute
$res .=
$res .=
'<li><strong>'
. $self->translate($attribute)
. '</strong> (<tt>$'

@ -112,10 +112,10 @@ sub confUpload {
$appflag = 1;
}
else {
$self->lmLog( "Entering category $name", 'debug' );
$self->lmLog( "Entering category $name", 'debug' );
$catid = $name; # Remeber category for applications coming next
$catflag = 1;
}
}
}
# Manage new keys
@ -155,7 +155,7 @@ s/^generalParameters\/authParams\/choiceParams\/([^\/]*)?.*/authChoiceModules\/$
}
# Do nothing for applicationList (managed at stage 1.3.2)
# Do nothing for applicationList (managed at stage 1.3.2)
elsif ( $id =~ /applicationList/ ) { $id = "applicationList"; }
# Normal case
@ -282,8 +282,8 @@ s/^(samlSPMetaDataXML|samlSPMetaDataExportedAttributes|samlSPMetaDataOptions)\/(
else {
$self->setKeyToH(
$newConf, $confKey,
$test->{keyTest}
? ( ( $id !~ /\// or $test->{'*'} ) ? {} : ( $name => $value ) )
$test->{keyTest}
? ( ( $id !~ /\// or $test->{'*'} ) ? {} : ( $name => $value ) )
: $value
);
}

@ -240,15 +240,15 @@ sub struct {
portalMenu => {
_nodes => [qw(portalModules applicationList)],
portalModules => {
_nodes => [
portalModules => {
_nodes => [
qw(portalDisplayLogout portalDisplayChangePassword portalDisplayAppslist)
],
portalDisplayLogout => 'text:/portalDisplayLogout',
portalDisplayChangePassword =>
'text:/portalDisplayChangePassword',
portalDisplayAppslist => 'text:/portalDisplayAppslist',
},
],
portalDisplayLogout => 'text:/portalDisplayLogout',
portalDisplayChangePassword =>
'text:/portalDisplayChangePassword',
portalDisplayAppslist => 'text:/portalDisplayAppslist',
},
applicationList => {
_nodes => [
'applicationlist:/applicationList:default:applicationListCategory'
@ -288,8 +288,8 @@ sub struct {
|| $self->defaultConf()->{passwordDB};
$auth = lc($auth);
$auth =~ s/\s.*$//; # For Multi
$udb = lc($udb);
$pdb = lc($pdb);
$udb = lc($udb);
$pdb = lc($pdb);
my %res;
foreach my $mod (
@ -565,7 +565,7 @@ sub struct {
# Choice
choiceParams => {
_nodes => [qw(authChoiceParam n:authChoiceModules)],
authChoiceParam => 'text:/authChoiceParam',
authChoiceParam => 'text:/authChoiceParam',
authChoiceModules => {
_nodes =>
['hash:/authChoiceModules:default:authChoice'],
@ -682,7 +682,7 @@ sub struct {
userControl => 'text:/userControl:userControl:text',
portalForceAuthn =>
'bool:/portalForceAuthn:portalForceAuthn:bool',
key => 'text:/key:key:text',
key => 'text:/key:key:text',
},
redirection => {
@ -1443,7 +1443,7 @@ sub testStruct {
SSLRequire => $boolean,
# CAS
CAS_authnLevel => $integer,
CAS_authnLevel => $integer,
CAS_url => {
test => Lemonldap::NG::Common::Regexp::HTTP_URI,
msgFail => 'Bad CAS url',
@ -1552,26 +1552,26 @@ sub defaultConf {
issuerDBOpenIDPath => '^/openidserver/',
issuerDBOpenIDRule => '1',
key => join( '', map { chr( int( rand(94) ) + 33 ) } ( 1 .. 16 ) ),
ldapBase => 'dc=example,dc=com',
ldapPort => '389',
ldapPwdEnc => 'utf-8',
ldapServer => 'localhost',
ldapTimeout => '120',
ldapVersion => '3',
managerDn => '',
managerPassword => '',
notification => '0',
notificationStorage => 'File',
notifyDeleted => '1',
notifyOther => '1',
portal => 'http://auth.example.com',
portalSkin => 'pastel',
portalUserAttr => '_user',
ldapBase => 'dc=example,dc=com',
ldapPort => '389',
ldapPwdEnc => 'utf-8',
ldapServer => 'localhost',
ldapTimeout => '120',
ldapVersion => '3',
managerDn => '',
managerPassword => '',
notification => '0',
notificationStorage => 'File',
notifyDeleted => '1',
notifyOther => '1',
portal => 'http://auth.example.com',
portalSkin => 'pastel',
portalUserAttr => '_user',
portalDisplayAppslist => '1',
portalDisplayChangePassword => '$_auth eq LDAP or $_auth eq DBI',
portalDisplayLogout => '1',
portalDisplayResetPassword => '1',
protection => 'none',
protection => 'none',
remoteGlobalStorage => 'Lemonldap::NG::Common::Apache::Session::SOAP',
securedCookie => '0',
singleSession => '0',
@ -1694,13 +1694,13 @@ sub defaultConf {
'urn:oasis:names:tc:SAML:2.0:bindings:SOAP;'
. '#PORTAL#'
. '/saml/AA/SOAP;',
samlServicePrivateKeySig => '',
samlServicePrivateKeySigPwd => '',
samlServicePublicKeySig => '',
samlServicePrivateKeyEnc => '',
samlServicePrivateKeyEncPwd => '',
samlServicePublicKeyEnc => '',
samlMetadataForceUTF8 => 1,
samlServicePrivateKeySig => '',
samlServicePrivateKeySigPwd => '',
samlServicePublicKeySig => '',
samlServicePrivateKeyEnc => '',
samlServicePrivateKeyEncPwd => '',
samlServicePublicKeyEnc => '',
samlMetadataForceUTF8 => 1,
samlAuthnContextMapPassword => 2,
samlAuthnContextMapPasswordProtectedTransport => 3,
samlAuthnContextMapTLSClient => 5,

@ -227,7 +227,7 @@ sub en {
security => 'Security',
session => 'session',
sessions => 'sessions',
sessionDeleted => 'The session was deleted',
sessionDeleted => 'The session was deleted',
sessionParams => 'Sessions',
sessionStartedAt => 'Session started on',
sessionStorage => 'Sessions Storage',
@ -580,7 +580,7 @@ sub fr {
security => 'Sécurité',
session => 'session',
sessions => 'sessions',
sessionDeleted => 'La session a été supprimée',
sessionDeleted => 'La session a été supprimée',
sessionParams => 'Sessions',
sessionStartedAt => 'Session démarrée le ',
sessionStorage => 'Stockage des sessions',
@ -601,15 +601,15 @@ sub fr {
SSLVar => 'Champ extrait du certificat',
startTime => 'Date de création',
storePassword => "Stocke le mot de passe de l'utilisateur en session",
sympaHandler => 'Sympa',
sympaMailKey => 'Clé de session pour le mail',
sympaSecret => 'Secret partagé',
syntaxError => 'Erreur de syntaxe',
syslog => 'Facilité syslog',
timeout => 'Durée de vie maximale des sessions',
timeoutActivity => 'Délai d\'expiration des sessions',
trustedDomains => 'Domaines appouvés',
twitterAppName => 'Nom de l\'application',
sympaHandler => 'Sympa',
sympaMailKey => 'Clé de session pour le mail',
sympaSecret => 'Secret partagé',
syntaxError => 'Erreur de syntaxe',
syslog => 'Facilité syslog',
timeout => 'Durée de vie maximale des sessions',
timeoutActivity => 'Délai d\'expiration des sessions',
trustedDomains => 'Domaines appouvés',
twitterAppName => 'Nom de l\'application',
twitterAuthnLevel => 'Niveau d\'authentification',
twitterKey => 'Clé de l\'API',
twitterParams => 'Paramètres Twitter',
@ -624,16 +624,16 @@ sub fr {
userPivot => 'Champ identifiant dans la table des utilisateurs',
useXForwardedForIP =>
"Utiliser l'adresse IP de l'en-tête X-Forwarded-For",
variables => "Variables",
virtualHosts => 'Hôtes virtuels',
whatToTrace => "Variable d'environnement REMOTE_USER",
variables => "Variables",
virtualHosts => 'Hôtes virtuels',
whatToTrace => "Variable d'environnement 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',
zimbraSsoUrl => 'Motif pour l\' URL de SSO locale ',
zimbraUrl => 'URL de préauthentification',
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',
saml => 'SAML',
samlNameIDFormatMap => 'Formats de NameID',

@ -83,12 +83,12 @@ if ( $portal->process() ) {
%templateParams = (
AUTH_USER => $portal->{sessionInfo}->{ $portal->{portalUserAttr} },
AUTOCOMPLETE => $portal->{portalAutocomplete},
SKIN => $skin,
AUTOCOMPLETE => $portal->{portalAutocomplete},
SKIN => $skin,
AUTH_ERROR => $portal->error( undef, $portal->{menuError} ),
AUTH_ERROR_TYPE => $portal->error_type( $portal->{menuError} ),
DISPLAY_TAB => $portal->{menuDisplayTab},
LOGOUT_URL => "$ENV{SCRIPT_NAME}?logout=1",
LOGOUT_URL => "$ENV{SCRIPT_NAME}?logout=1",
REQUIRE_OLDPASSWORD => $portal->{portalRequireOldPassword},
DISPLAY_MODULES => $portal->{menuDisplayModules},
APPSLIST_MENU => $portal->{menuAppslistMenu}, # For old templates
@ -187,8 +187,8 @@ else {
if ( $portal->{authLoop} ) {
%templateParams = (
%templateParams,
AUTH_LOOP => $portal->{authLoop},
CHOICE_PARAM => $portal->{authChoiceParam},
AUTH_LOOP => $portal->{authLoop},
CHOICE_PARAM => $portal->{authChoiceParam},
CHOICE_VALUE => $portal->{_authChoice},
DISPLAY_FORM => 0,
DISPLAY_OPENID_FORM => 0,

@ -585,7 +585,7 @@ sub issuerForAuthUser {
# Redirect to service
my $service_url = $service;
$service_url .= (
$service =~ /\?/
$service =~ /\?/
? '&ticket=' . $casServiceTicket
: '?ticket=' . $casServiceTicket
);

@ -200,7 +200,7 @@ sub openIDServer {
},
is_trusted => sub {
# TODO: manage extensions here
# TODO: manage extensions here
my ( $u, $trust_root, $is_identity ) = @_;
return 0 unless ( $u and $is_identity );
if ( $self->{sessionInfo}->{"_openidTrust$trust_root"} ) {

@ -10,8 +10,8 @@ use warnings;
use Lemonldap::NG::Portal::Simple;
use Lemonldap::NG::Portal::_LibAccess;
our $VERSION = '0.4';
our @ISA = qw(Lemonldap::NG::Portal::_LibAccess);
our $VERSION = '0.4';
our @ISA = qw(Lemonldap::NG::Portal::_LibAccess);
our $catlevel = 0;
## @method void menuInit()
@ -165,7 +165,7 @@ sub _buildCategoryHash {
catlevel => $catlevel
};
$categoryHash->{applications} = $applications if $applications;
$categoryHash->{categories} = $categories if $categories;
$categoryHash->{categories} = $categories if $categories;
return $categoryHash;
}

@ -512,15 +512,15 @@ sub setDefaultValues {
$self->{casStorageOptions} ||= $self->{globalStorageOptions};
# Authentication levels
$self->{ldapAuthnLevel} = 2 unless defined $self->{ldapAuthnLevel};
$self->{dbiAuthnLevel} = 2 unless defined $self->{dbiAuthnLevel};
$self->{SSLAuthnLevel} = 5 unless defined $self->{SSLAuthnLevel};
$self->{CAS_authnLevel} = 1 unless defined $self->{CAS_authnLevel};
$self->{openIdAuthnLevel} = 1 unless defined $self->{openIdAuthnLevel};
$self->{ldapAuthnLevel} = 2 unless defined $self->{ldapAuthnLevel};
$self->{dbiAuthnLevel} = 2 unless defined $self->{dbiAuthnLevel};
$self->{SSLAuthnLevel} = 5 unless defined $self->{SSLAuthnLevel};
$self->{CAS_authnLevel} = 1 unless defined $self->{CAS_authnLevel};
$self->{openIdAuthnLevel} = 1 unless defined $self->{openIdAuthnLevel};
$self->{twitterAuthnLevel} = 1
unless defined $self->{twitterAuthnLevel};
$self->{apacheAuthnLevel} = 4 unless defined $self->{apacheAuthnLevel};
$self->{nullAuthnLevel} = 2 unless defined $self->{nullAuthnLevel};
$self->{apacheAuthnLevel} = 4 unless defined $self->{apacheAuthnLevel};
$self->{nullAuthnLevel} = 2 unless defined $self->{nullAuthnLevel};
# Other
$self->{logoutServices} ||= {};
@ -933,8 +933,8 @@ sub get_module {
return $self->{_choice}->{modules}->[2]->{n};
}
else {
return $self->{passwordDB};
}
return $self->{passwordDB};
}
}
if ( $type =~ /issuer/i ) {
@ -1197,9 +1197,9 @@ sub controlUrlOrigin {
# Non protected hosts
if ( $tmp
and $tmp !~
and $tmp !~
/^https?:\/\/(?:$self->{reVHosts}$self->{trustedDomains})(?::\d+)?(?:\/.*)?$/o
)
)
{
$self->lmLog(
"URL contains a non protected host (param: "
@ -1319,7 +1319,7 @@ sub controlExistingSession {
};
}
else {
eval { $self->{error} = $self->_sub('authLogout'); };
eval { $self->{error} = $self->_sub('authLogout'); };
}
if ($@) {
$self->lmLog( "Error when calling authLogout: $@",

@ -46,9 +46,9 @@ sub new {
$samlForce = $portal->$authForce;
};
if ($@) {
if ($@) {
$portal->lmLog( "SAML choice force not tested: $@", 'debug' );
}
}
# Force SAML choice if needed
if ($samlForce) {
@ -78,8 +78,8 @@ sub new {
}
$self->{modules} = [
{ m => $authModule, n => $auth },
{ m => $userDBModule, n => $userDB },
{ m => $authModule, n => $auth },
{ m => $userDBModule, n => $userDB },
{ m => $passwordDBModule, n => $passwordDB }
];

@ -24,7 +24,6 @@ sub _grant {
my ( $protocol, $vhost, $port, $path );
( $protocol, $vhost, $port, $path ) = ( $1, $2, $3, $4 );
$path ||= '/';
print STDERR "$cfgNum : $self->{cfgNum}\n";
$self->_compileRules()
if ( $cfgNum != $self->{cfgNum} );
return -1 unless ( defined( $defaultCondition->{$vhost} ) );

@ -16,7 +16,7 @@ our $initDone;
# Checks if remote portal parameters are set.
# @return Lemonldap::NG::Portal constant
sub init {
my $self = shift;
my $self = shift;
return PE_OK if ($initDone);
my @missing = ();

@ -13,7 +13,7 @@ use Safe;
use constant SAFEWRAP => ( Safe->can("wrap_code_ref") ? 1 : 0 );
our $VERSION = '0.2';
our @ISA = qw(Lemonldap::NG::Portal::_LibAccess);
our @ISA = qw(Lemonldap::NG::Portal::_LibAccess);
## @method void startSoapServices()
# Check the URI requested (PATH_INFO environment variable) and launch the

@ -13,19 +13,20 @@ BEGIN { use_ok('Lemonldap::NG::Portal::Menu') }
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
$ENV{REQUEST_METHOD} = 'GET';
$ENV{REQUEST_METHOD} = 'GET';
# Build portal
my $p = Lemonldap::NG::Portal::Simple->new({
globalStorage => 'Apache::Session::File',
domain => 'example.com',
error => 0,
applicationList => {},
});
my $p = Lemonldap::NG::Portal::Simple->new(
{
globalStorage => 'Apache::Session::File',
domain => 'example.com',
error => 0,
applicationList => {},
}
);
# Init menu
$p->menuInit();
ok( ref $p->{menuDisplayModules} eq 'ARRAY' ,
'Modules displayed' );
ok( ref $p->{menuDisplayModules} eq 'ARRAY', 'Modules displayed' );

Loading…
Cancel
Save