Commit 198bcf70 authored by Clément OUDOT's avatar Clément OUDOT

Get the timezone of the user and correct checkLogonHours function

parent 36552192
......@@ -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;
}
......
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