Get the timezone of the user and correct checkLogonHours function

environments/ppa-mbqj77/deployments/1
Clément Oudot 16 years ago
parent 36552192f3
commit 198bcf70bc
  1. 2
      modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Safelib.pm
  2. 1
      modules/lemonldap-ng-portal/example/skins/pastel/header.tpl
  3. 1
      modules/lemonldap-ng-portal/example/skins/pastel/login.tpl
  4. 5
      modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/_WebForm.pm

@ -51,8 +51,6 @@ sub checkLogonHours {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
# Get the hour position
# First day in logonHours is sunday but is monday in gmtime
$wday == "6" ? $wday = 0 : $wday++;
my $hourpos = $wday*24 + $hour;
# Use time_correction

@ -14,6 +14,7 @@
<script type="text/javascript">
$(document).ready(function(){
$("div.message").fadeIn('slow');
$("input[name=timezone]").val( -(new Date().getTimezoneOffset()/60) );
$("#menu > ul").tabs({ fx: { opacity: 'toggle' } });
$("#menu > ul").tabs("select","#<TMPL_VAR NAME="DISPLAY_TAB">");
$("input[type!=hidden]:first").focus();

@ -10,6 +10,7 @@
<h3><lang en="Please enter your credentials" fr="Merci de vous authentifier"/></h3>
<p><input type="hidden" name="url" value="<TMPL_VAR NAME="AUTH_URL">" /></p>
<p><input type="hidden" name="timezone" /></p>
<table>
<tr><th><lang en="Login" fr="Identifiant"/></th>

@ -48,6 +48,7 @@ sub extractFormInfo {
);
$self->{'oldpassword'} = $self->param('oldpassword');
$self->{'confirmpassword'} = $self->param('confirmpassword');
$self->{'timezone'} = $self->param('timezone');
PE_OK;
}
@ -69,6 +70,10 @@ sub setAuthSessionInfo {
$self->{sessionInfo}->{'_password'} = $self->{'newpassword'}
|| $self->{'password'};
}
# Store user timezone
$self->{sessionInfo}->{'_timezone'} = $self->{'timezone'};
PE_OK;
}

Loading…
Cancel
Save