Possibility to set ping interval in portal (#658)

This commit is contained in:
Clément Oudot 2014-02-07 10:17:45 +00:00
parent 1143ceb805
commit c4b207b73a
7 changed files with 19 additions and 8 deletions

View File

@ -198,9 +198,11 @@
</div>
<TMPL_IF NAME="PING">
<!-- Keep session alive -->
<script type="text/javascript">
setTimeout('ping();',60000);
setTimeout('ping();',pingInterval);
</script>
</TMPL_IF>
<TMPL_INCLUDE NAME="footer.tpl">

View File

@ -223,7 +223,7 @@ function ping() {
location.reload(true);
}
else {
setTimeout('ping();', 60000);
setTimeout('ping();', pingInterval);
}
}
});

View File

@ -30,5 +30,6 @@
var appslistorder="<TMPL_VAR NAME="APPSLIST_ORDER">";
var scriptname="<TMPL_VAR NAME="SCRIPT_NAME">";
var activeTimer="<TMPL_VAR NAME="ACTIVE_TIMER">";
var pingInterval=parseInt("<TMPL_VAR NAME="PING">");
//]]></script>

View File

@ -192,10 +192,12 @@
</div>
</div>
<TMPL_IF NAME="PING">
<!-- Keep session alive -->
<script type="text/javascript">
setTimeout('ping();',60000);
setTimeout('ping();',pingInterval);
</script>
</TMPL_IF>
<TMPL_INCLUDE NAME="footer.tpl">

View File

@ -193,9 +193,11 @@
</div>
<TMPL_IF NAME="PING">
<!-- Keep session alive -->
<script type="text/javascript">
setTimeout('ping();',60000);
setTimeout('ping();',pingInterval);
</script>
</TMPL_IF>
<TMPL_INCLUDE NAME="footer.tpl">

View File

@ -9,7 +9,7 @@ use strict;
use Lemonldap::NG::Portal::Simple;
use utf8;
our $VERSION = '1.3.0';
our $VERSION = '1.4.0';
## @method array display()
# Call portal process and set template parameters
@ -112,6 +112,7 @@ sub display {
APPSLIST_DESC => $self->{menuAppslistDesc}, # For old templates
SCRIPT_NAME => $ENV{SCRIPT_NAME},
APPSLIST_ORDER => $self->{sessionInfo}->{'appsListOrder'},
PING => $self->{portalPingInterval},
);
}

View File

@ -69,7 +69,7 @@ use Digest::MD5;
#inherits Apache::Session
#link Lemonldap::NG::Common::Apache::Session::SOAP protected globalStorage
our $VERSION = '1.3.2';
our $VERSION = '1.4.0';
use base qw(Lemonldap::NG::Common::CGI Exporter);
our @ISA;
@ -569,6 +569,8 @@ sub setDefaultValues {
$self->{authChoiceParam} ||= "lmAuth";
$self->{hiddenAttributes} = "_password"
unless defined $self->{hiddenAttributes};
$self->{portalPingInterval} = 60000
unless defined $self->{portalPingInterval};
# Set default userDB and passwordDB to DBI if authentication is DBI
if ( $self->{authentication} =~ /DBI/i ) {
@ -2456,6 +2458,7 @@ sub store {
# Main session
my $h = $self->getApacheSession( $self->{id} )
or return PE_APACHESESSIONERROR;
# Compute unsecure cookie value if needed
if ( $self->{securedCookie} == 3 ) {
$self->{sessionInfo}->{_httpSession} =
@ -2512,8 +2515,8 @@ sub buildCookie {
if ( $self->{securedCookie} >= 2 ) {
push @{ $self->{cookie} },
$self->cookie(
-name => $self->{cookieName} . "http",
-value => $self->{sessionInfo}->{_httpSession},
-name => $self->{cookieName} . "http",
-value => $self->{sessionInfo}->{_httpSession},
-domain => $self->{domain},
-path => "/",
-secure => 0,