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