Commit 8ef3a6e0 authored by Clément OUDOT's avatar Clément OUDOT

Port timeoutActivityInterval to 1.4 branch (#LEMONLDAP-1001)

git-svn-id: svn://svn.forge.objectweb.org/svnroot/lemonldap/branches/lemonldap-ng_version_1_4-bugfixes@5393 1dbb9719-a921-0410-b57f-c3a383c2c641
parent f702783e
......@@ -8,7 +8,7 @@ package Lemonldap::NG::Common::Conf::Attributes;
use Mouse;
our $VERSION = 1.4.6;
our $VERSION = 1.4.11;
## A
......@@ -1443,6 +1443,13 @@ has 'timeoutActivity' => (
documentation => 'Session activity timeout on server side',
);
has 'timeoutActivityInterval' => (
is => 'rw',
isa => 'Int',
default => '60',
documentation => 'Update session timeout interval on server side',
);
has 'trustedProxies' => (
is => 'rw',
isa => 'Str',
......
......@@ -47,12 +47,16 @@ BEGIN {
sub defaultValuesInit {
my (
$self, $cookieName, $securedCookie,
$whatToTrace, $https, $port,
$customFunctions, $timeoutActivity, $useRedirectOnError,
$useRedirectOnForbidden, $useSafeJail, $key,
$maintenance, $cda, $httpOnly,
$cookieExpiration, $cipher, $args,
$self, $cookieName,
$securedCookie, $whatToTrace,
$https, $port,
$customFunctions, $timeoutActivity,
$timeoutActivityInterval, $useRedirectOnError,
$useRedirectOnForbidden, $useSafeJail,
$key, $maintenance,
$cda, $httpOnly,
$cookieExpiration, $cipher,
$args,
) = splice @_;
foreach my $t (qw(https port maintenance)) {
......@@ -95,6 +99,8 @@ sub defaultValuesInit {
$httpOnly = defined($httpOnly) ? $httpOnly : $args->{httpOnly};
$cookieExpiration = $args->{cookieExpiration} || $cookieExpiration;
$timeoutActivity = $args->{timeoutActivity} || $timeoutActivity;
$timeoutActivityInterval =
$args->{timeoutActivityInterval} || $timeoutActivityInterval;
$useRedirectOnError =
defined($useRedirectOnError)
? $useRedirectOnError
......@@ -119,11 +125,14 @@ sub defaultValuesInit {
$maintenance = defined($maintenance) ? $maintenance : $args->{maintenance};
return (
$cookieName, $securedCookie, $whatToTrace,
$https, $port, $customFunctions,
$timeoutActivity, $useRedirectOnError, $useRedirectOnForbidden,
$useSafeJail, $key, $maintenance,
$cda, $httpOnly, $cookieExpiration,
$cookieName, $securedCookie,
$whatToTrace, $https,
$port, $customFunctions,
$timeoutActivity, $timeoutActivityInterval,
$useRedirectOnError, $useRedirectOnForbidden,
$useSafeJail, $key,
$maintenance, $cda,
$httpOnly, $cookieExpiration,
$cipher
);
1;
......
......@@ -31,7 +31,7 @@ use constant MAINTENANCE_CODE => 503;
#inherits Apache::Session
#link Lemonldap::NG::Common::Apache::Session::SOAP protected globalStorage
our $VERSION = '1.4.9';
our $VERSION = '1.4.11';
our %EXPORT_TAGS;
......@@ -48,8 +48,8 @@ our @EXPORT;
# locationProtection locationRegexp maintenance
# port refLocalStorage securedCookie
# statusOut statusPipe timeoutActivity
# useRedirectOnError useRedirectOnForbidden useSafeJail
# whatToTrace
# timeoutActivityInterval useRedirectOnError useRedirectOnForbidden
# useSafeJail whatToTrace
# );
#
# my @nontSharedVar = qw(
......@@ -380,7 +380,10 @@ sub retrieveSession {
'debug' );
# Update the session to notify activity, if necessary
if ( $tsv->{timeoutActivity} and ( $now - $datas->{_lastSeen} > 60 ) ) {
if ( $tsv->{timeoutActivity}
and
( $now - $datas->{_lastSeen} > $tsv->{timeoutActivityInterval} ) )
{
$apacheSession->update( { '_lastSeen' => $now } );
if ( $apacheSession->error ) {
......@@ -684,7 +687,7 @@ sub globalInit {
@$tsv{
qw( cookieName securedCookie whatToTrace
https port customFunctions
timeoutActivity useRedirectOnError useRedirectOnForbidden
timeoutActivity timeoutActivityInterval useRedirectOnError useRedirectOnForbidden
useSafeJail key maintenance )
},
@$ntsv{
......@@ -697,7 +700,7 @@ sub globalInit {
@$tsv{
qw( cookieName securedCookie whatToTrace
https port customFunctions
timeoutActivity useRedirectOnError useRedirectOnForbidden
timeoutActivity timeoutActivityInterval useRedirectOnError useRedirectOnForbidden
useSafeJail key maintenance )
},
@$ntsv{
......
......@@ -34,7 +34,7 @@ extends qw(Lemonldap::NG::Handler::Main); # Lemonldap::NG::Handler::Vhost
#parameter reloadTime Time in second between 2 configuration check (600)
our $VERSION = '1.4.0';
our $VERSION = '1.4.11';
our $cfgNum = 0;
our $lastReload = 0;
our $reloadTime;
......@@ -97,7 +97,7 @@ sub defaultValuesInit {
@$tsv{
qw( cookieName securedCookie whatToTrace
https port customFunctions
timeoutActivity useRedirectOnError useRedirectOnForbidden
timeoutActivity timeoutActivityInterval useRedirectOnError useRedirectOnForbidden
useSafeJail key maintenance )
},
@$ntsv{
......@@ -110,7 +110,7 @@ sub defaultValuesInit {
@$tsv{
qw( cookieName securedCookie whatToTrace
https port customFunctions
timeoutActivity useRedirectOnError useRedirectOnForbidden
timeoutActivity timeoutActivityInterval useRedirectOnError useRedirectOnForbidden
useSafeJail key maintenance )
},
@$ntsv{
......
......@@ -11,7 +11,7 @@ use Lemonldap::NG::Common::Conf::Attributes;
use Lemonldap::NG::Common::Conf::SubAttributes;
use Lemonldap::NG::Common::Regexp;
our $VERSION = '1.4.6';
our $VERSION = '1.4.11';
## @method protected hashref cstruct(hashref h,string k)
# Merge $h with the structure produced with $k and return it.
......@@ -897,7 +897,7 @@ sub struct {
# SESSIONS PARAMETERS
sessionParams => {
_nodes => [
qw(storePassword timeout timeoutActivity cn:grantSessionRules n:sessionStorage n:multipleSessions n:persistentSessions)
qw(storePassword timeout timeoutActivity timeoutActivityInterval cn:grantSessionRules n:sessionStorage n:multipleSessions n:persistentSessions)
],
_help => 'sessions',
......@@ -905,6 +905,7 @@ sub struct {
timeout => 'int:/timeout',
timeoutActivity =>
'text:/timeoutActivity:sessions:timeoutActivityParams',
timeoutActivityInterval => 'int:/timeoutActivityInterval',
grantSessionRules => {
_nodes => [
......@@ -1865,6 +1866,10 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
test => qr/^\d*$/,
msgFail => 'Bad number',
},
timeoutActivityInterval => {
test => qr/^\d*$/,
msgFail => 'Bad number',
},
trustedProxies => $testNotDefined,
userControl => {
test => $pcre,
......
......@@ -384,6 +384,7 @@ sub en {
syslog => 'Syslog facility',
timeout => 'Sessions timeout',
timeoutActivity => 'Sessions activity timeout',
timeoutActivityInterval => 'Sessions update interval',
trustedDomains => 'Trusted domains',
trustedProxies => 'Trusted proxies IP',
twitterAppName => 'Application name',
......@@ -894,28 +895,29 @@ sub fr {
SSLVar => 'Champ extrait du certificat',
startTime => 'Date de création',
storePassword => "Stocke le mot de passe de l'utilisateur en session",
successLoginNumber => 'Nombre de connexions mémorisées',
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 approuvés',
trustedProxies => 'IP des proxys de confiance',
twitterAppName => 'Nom de l\'application',
twitterAuthnLevel => 'Niveau d\'authentification',
twitterKey => 'Clé de l\'API',
twitterParams => 'Paramètres Twitter',
twitterSecret => 'Secret de l\'API',
unknownError => 'Erreur inconnue',
updateTime => 'Date de mise à jour',
uploadDenied => 'Téléchargement refusé',
user => 'utilisateur',
users => 'utilisateurs',
userDB => "Module d'utilisateurs",
userControl => "Contrôle du nom d'utilisateur",
successLoginNumber => 'Nombre de connexions mémorisées',
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',
timeoutActivityInterval => 'Intervalle de mise à jour des sessions',
trustedDomains => 'Domaines approuvés',
trustedProxies => 'IP des proxys de confiance',
twitterAppName => 'Nom de l\'application',
twitterAuthnLevel => 'Niveau d\'authentification',
twitterKey => 'Clé de l\'API',
twitterParams => 'Paramètres Twitter',
twitterSecret => 'Secret de l\'API',
unknownError => 'Erreur inconnue',
updateTime => 'Date de mise à jour',
uploadDenied => 'Téléchargement refusé',
user => 'utilisateur',
users => 'utilisateurs',
userDB => "Module d'utilisateurs",
userControl => "Contrôle du nom d'utilisateur",
userPivot => 'Champ identifiant dans la table des utilisateurs',
useRedirectOnError => 'Redirection pour les erreurs',
useRedirectOnForbidden => 'Redirection pour les accès interdits',
......
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