Manager: restore last changes...

This commit is contained in:
Clément Oudot 2010-03-15 20:24:02 +00:00
parent 85054c3638
commit 96519790ab

View File

@ -98,7 +98,7 @@ sub struct {
######################
generalParameters => {
_nodes => [
qw(portalParams n:authParams logParams cookieParams sessionParams n:advancedParams)
qw(n:portalParams n:authParams n:logParams n:cookieParams n:sessionParams n:advancedParams)
],
_help => 'default',
@ -146,14 +146,27 @@ sub struct {
|| $self->defaultConf()->{authentication};
my $udb = $self->conf->{userDB}
|| $self->defaultConf()->{userDB};
my $pdb = $self->conf->{passwordDB}
|| $self->defaultConf()->{passwordDB};
$auth = lc($auth);
$udb = lc($udb);
$pdb = lc($pdb);
my %res;
foreach my $mod ( ( $auth, ( $auth ne $udb ? $udb : () ) ) )
foreach my $mod (
(
$auth,
( $udb ne ( $auth or $pdb ) ? $udb : () ),
( $pdb ne ( $auth or $udb ) ? $pdb : () )
)
)
{
my $tmp = {
ldap => ['ldapParams'],
ssl => [qw(ldapParams SSLRequired)],
ssl => [qw(ldapParams sslParams)],
cas => ['casParams'],
remote => ['remoteParams'],
proxy => ['proxyParams'],
openid => ['openIdParams'],
twitter => ['twitterParams'],
}->{$mod};
@ -163,7 +176,8 @@ sub struct {
}
my @u = keys %res;
# Add authentication and userDB nodes at the beginning
# Add authentication, userDB and passwordDB nodes at the beginning
unshift( @u, "passwordDB" );
unshift( @u, "userDB" );
unshift( @u, "authentication" );
@ -175,6 +189,7 @@ sub struct {
authentication => 'text:/authentication:authParams:authParams',
userDB => 'text:/userDB:authParams:authParams',
passwordDB => 'text:/passwordDB:authParams:authParams',
# LDAP
ldapParams => {
@ -228,7 +243,42 @@ sub struct {
},
# SSL
SSLRequired => 'bool:/SSLRequired',
sslParams => {
_nodes => [qw(SSLVar SSLLDAPField SSLRequire)],
SSLVar => 'text:/SSLVar',
SSLLDAPField => 'text:/SSLLDAPField',
SSLRequire => 'bool:/SSLRequire',
},
# CAS
casParams => {
_nodes =>
[qw(CAS_url CAS_loginUrl CAS_validationUrl CAS_CAFile)],
CAS_url => 'text:/CAS_url',
CAS_loginUrl => 'text:/CAS_loginUrl',
CAS_validationUrl => 'text:/CAS_validationUrl',
CAS_CAFile => 'text:/CAS_CAFile',
},
# Remote
remoteParams => {
_nodes => [
qw(remotePortal remoteGlobalStorage remoteGlobalStorageOptions)
],
remotePortal => 'text:/remotePortal',
remoteGlobalStorage => 'text:/remoteGlobalStorage',
remoteGlobalStorageOptions =>
{ _nodes => ['hash:/remoteGlobalStorageOptions'], },
},
# Proxy
proxyParams => {
_nodes =>
[qw(soapAuthService remoteCookieName soapSessionService)],
soapAuthService => 'text:/soapAuthService',
remoteCookieName => 'text:/remoteCookieName',
soapSessionService => 'text:/soapSessionService',
},
# OpenID
openIdParams => {
@ -269,9 +319,14 @@ sub struct {
# SESSIONS PARAMETERS
sessionParams => {
_nodes => [
qw(sessionStorage grantSessionRule singleSession singleIP singleUserByIP notifyDeleted notifyOther timeout storePassword)
qw(grantSessionRule storePassword timeout n:sessionStorage n:multipleSessions)
],
_help => 'storage',
grantSessionRule => 'textarea:/grantSessionRule',
storePassword => 'bool:/storePassword',
timeout => 'text:/timeout:timeout:text',
sessionStorage => {
_nodes => [qw(globalStorage globalStorageOptions)],
globalStorage => 'text:/globalStorage',
@ -280,14 +335,17 @@ sub struct {
_js => 'hashRoot'
},
},
multipleSessions => {
_nodes => [
qw(singleSession singleIP singleUserByIP notifyDeleted notifyOther)
],
singleSession => 'bool:/singleSession',
singleIP => 'bool:/singleIP',
singleUserByIP => 'bool:/singleUserByIP',
notifyDeleted => 'bool:/notifyDeleted',
notifyOther => 'bool:/notifyOther',
storePassword => 'bool:/storePassword',
timeout => 'text:/timeout:timeout:text',
grantSessionRule => 'text:/grantSessionRule',
},
},
# OTHER PARAMETERS
@ -318,9 +376,8 @@ sub struct {
passwordManagement => {
_nodes => [
qw(passwordDB SMTPServer mailUrl mailFrom mailSubject mailBody mailConfirmSubject mailConfirmBody randomPasswordRegexp)
qw(SMTPServer mailUrl mailFrom mailSubject mailBody mailConfirmSubject mailConfirmBody randomPasswordRegexp)
],
passwordDB => 'text:/passwordDB',
SMTPServer => 'text:/SMTPServer',
mailUrl => 'text:/mailUrl',
mailFrom => 'text:/mailFrom',
@ -788,7 +845,6 @@ sub testStruct {
singleIP => $boolean,
singleUserByIP => $boolean,
Soap => $boolean,
SSLRequired => $boolean,
storePassword => $boolean,
syslog => {
test => qw/^(?:auth|authpriv|daemon|local\d|user)?$/,
@ -874,6 +930,33 @@ sub testStruct {
samlIDPSSODescriptorManageNameIDServiceHTTP => $testNotDefined,
samlIDPSSODescriptorManageNameIDServiceSOAP => $testNotDefined,
# SSL
SSLVar => $testNotDefined,
SSLLDAPField => $testNotDefined,
SSLRequire => $boolean,
# CAS
CAS_url => $testNotDefined,
CAS_loginUrl => $testNotDefined,
CAS_validationUrl => $testNotDefined,
CAS_CAFile => $testNotDefined,
# Remote
remotePortal => $testNotDefined,
remoteGlobalStorage => {
test => qr/^[\w:]+$/,
msgFail => 'Bad module name',
},
remoteGlobalStorageOptions => {
keyTest => qr/^\w+$/,
keyMsgFail => 'Bad parameter',
},
# Proxy
soapAuthService => $testNotDefined,
remoteCookieName => $testNotDefined,
soapSessionService => $testNotDefined,
# OpenID
openIdSecret => $testNotDefined,
@ -916,6 +999,7 @@ sub defaultConf {
portalSkin => 'pastel',
portalUserAttr => '_user',
protection => 'none',
remoteGlobalStorage => 'Lemonldap::NG::Common::Apache::Session::SOAP',
securedCookie => '0',
singleSession => '0',
singleIP => '0',
@ -1010,6 +1094,10 @@ sub subDefaultConf {
return {
locationRules => { default => 'deny' },
exportedHeaders => { 'Auth-User' => '$uid' },
remoteGlobalStorageOptions => {
'proxy' => 'https://remote/index.pl/sessions',
'ns' => 'https://remote/Lemonldap/NG/Common/CGI/SOAPService',
},
samlIDPMetaDataXML => { {} },
samlIDPMetaDataExportedAttributes => { 'uid' => '0;uid;;' },
samlIDPMetaDataOptions => {