Create maintenance option (#342)
This commit is contained in:
parent
bb653b4e2a
commit
dee414b43f
|
@ -53,6 +53,7 @@ our (
|
|||
$timeoutActivity, $datasUpdate, $useRedirectOnForbidden,
|
||||
$useRedirectOnError, $useSafeJail, $securedCookie,
|
||||
$key, $cipher, $headerList,
|
||||
$maintenance,
|
||||
);
|
||||
|
||||
##########################################
|
||||
|
@ -83,7 +84,7 @@ BEGIN {
|
|||
traces => [qw( $whatToTrace $statusPipe $statusOut)],
|
||||
apache => [
|
||||
qw( MP OK REDIRECT FORBIDDEN DONE DECLINED SERVER_ERROR
|
||||
$useRedirectOnForbidden $useRedirectOnError )
|
||||
$useRedirectOnForbidden $useRedirectOnError $maintenance )
|
||||
],
|
||||
post => [qw($transform postFilter)],
|
||||
cda => ['$cda'],
|
||||
|
@ -162,6 +163,7 @@ BEGIN {
|
|||
threads::shared::share($securedCookie);
|
||||
threads::shared::share($key);
|
||||
threads::shared::share($headerList);
|
||||
threads::shared::share($maintenance);
|
||||
};
|
||||
print "eval error: $@" if ($@);
|
||||
}
|
||||
|
@ -689,6 +691,9 @@ sub defaultValuesInit {
|
|||
$key = $args->{key};
|
||||
$cipher = Lemonldap::NG::Common::Crypto->new($key);
|
||||
}
|
||||
|
||||
$maintenance = defined($maintenance) ? $maintenance : $args->{maintenance};
|
||||
|
||||
1;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ our $VERSION = '1.1.2';
|
|||
# @param $args reference to the configuration hash
|
||||
sub defaultValuesInit {
|
||||
my ( $class, $args ) = splice @_;
|
||||
foreach my $t (qw(https port)) {
|
||||
foreach my $t (qw(https port maintenance)) {
|
||||
|
||||
# Skip Handler initialization (values not defined)
|
||||
next unless defined $args->{$t};
|
||||
|
|
|
@ -48,10 +48,12 @@ sub cstruct {
|
|||
_help => 'post',
|
||||
},
|
||||
vhostOptions => {
|
||||
_nodes => [qw(vhostPort vhostHttps)],
|
||||
_nodes => [qw(vhostPort vhostHttps vhostMaintenance)],
|
||||
vhostPort => "int:/vhostOptions/$k2/vhostPort",
|
||||
vhostHttps => "trool:/vhostOptions/$k2/vhostHttps",
|
||||
_help => 'vhostOptions',
|
||||
vhostMaintenance =>
|
||||
"bool:/vhostOptions/$k2/vhostMaintenance",
|
||||
_help => 'vhostOptions',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -900,13 +902,14 @@ sub struct {
|
|||
|
||||
redirection => {
|
||||
_nodes => [
|
||||
qw(https port useRedirectOnForbidden useRedirectOnError)
|
||||
qw(https port useRedirectOnForbidden useRedirectOnError maintenance)
|
||||
],
|
||||
_help => 'redirections',
|
||||
https => 'bool:/https',
|
||||
port => 'int:/port',
|
||||
useRedirectOnForbidden => 'bool:/useRedirectOnForbidden',
|
||||
useRedirectOnError => 'bool:/useRedirectOnError',
|
||||
maintenance => 'bool:/maintenance',
|
||||
},
|
||||
|
||||
portalRedirection => {
|
||||
|
@ -1504,6 +1507,7 @@ sub testStruct {
|
|||
warnTest => $noAssign,
|
||||
},
|
||||
mailOnPasswordChange => $boolean,
|
||||
maintenance => $boolean,
|
||||
managerDn => {
|
||||
test => qr/^(?:\w+=.*)?$/,
|
||||
msgFail => 'Bad LDAP dn',
|
||||
|
@ -1619,7 +1623,7 @@ sub testStruct {
|
|||
keyTest => Lemonldap::NG::Common::Regexp::HOSTNAME(),
|
||||
keyMsgFail => 'Bad virtual host name',
|
||||
'*' => {
|
||||
keyTest => qr/^vhost(Port|Https)$/,
|
||||
keyTest => qr/^vhost(Port|Https|Maintenance)$/,
|
||||
keyMsgFail => 'Bad option name',
|
||||
},
|
||||
},
|
||||
|
@ -1920,6 +1924,7 @@ sub defaultConf {
|
|||
ldapVersion => '3',
|
||||
mailCharset => 'utf-8',
|
||||
mailOnPasswordChange => '0',
|
||||
maintenance => '0',
|
||||
mailTimeout => '0',
|
||||
mailSessionKey => 'mail',
|
||||
managerDn => '',
|
||||
|
@ -1972,6 +1977,7 @@ sub defaultConf {
|
|||
useXForwardedForIP => '0',
|
||||
vhostPort => '-1',
|
||||
vhostHttps => '-1',
|
||||
vhostMaintenance => '0',
|
||||
whatToTrace => '$_whatToTrace',
|
||||
yubikeyPublicIDSize => '12',
|
||||
########
|
||||
|
|
|
@ -209,6 +209,7 @@ sub en {
|
|||
mailSubject => 'Success mail subject',
|
||||
mailTimeout => 'Validity time of a password reset request',
|
||||
mailUrl => 'Page URL',
|
||||
maintenance => 'Maintenance mode',
|
||||
managerDn => 'Account',
|
||||
managerPassword => 'Password',
|
||||
memberOfSSOGroups => 'Member of SSO groups',
|
||||
|
@ -358,6 +359,7 @@ sub en {
|
|||
useXForwardedForIP => "Use X-Forwarded-For",
|
||||
variables => "Variables",
|
||||
vhostHttps => 'HTTPS',
|
||||
vhostMaintenance => 'Maintenance mode',
|
||||
vhostOptions => 'Options',
|
||||
vhostPort => 'Port',
|
||||
virtualHosts => 'Virtual Hosts',
|
||||
|
@ -661,6 +663,7 @@ sub fr {
|
|||
mailSubject => 'Sujet du message de succès',
|
||||
mailTimeout => "Durée de validité d'une demande de réinitialisation",
|
||||
mailUrl => 'URL de la page',
|
||||
maintenance => 'Mode maintenance',
|
||||
managerDn => 'Compte de connexion LDAP',
|
||||
managerPassword => 'Mot de passe LDAP',
|
||||
memberOfSSOGroups => 'Membre des groupes SSO',
|
||||
|
@ -814,6 +817,7 @@ sub fr {
|
|||
useXForwardedForIP => "Utiliser X-Forwarded-For",
|
||||
variables => "Variables",
|
||||
vhostHttps => 'HTTPS',
|
||||
vhostMaintenance => 'Mode maintenance',
|
||||
vhostOptions => 'Options',
|
||||
vhostPort => 'Port',
|
||||
virtualHosts => 'Hôtes virtuels',
|
||||
|
|
Loading…
Reference in New Issue
Block a user