Do not check to see if session is set before setting timezone always set timezone, Fixes MFA when switching timezones
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
// Check if timezone and offset are set in session
|
||||
if (!isset($_SESSION['session_timezone']) || !isset($_SESSION['session_utc_offset'])) {
|
||||
$result = mysqli_query($mysqli, "SELECT config_timezone FROM settings WHERE company_id = 1");
|
||||
$row = mysqli_fetch_array($result);
|
||||
$_SESSION['session_timezone'] = $row['config_timezone'];
|
||||
@@ -12,7 +10,6 @@ if (!isset($_SESSION['session_timezone']) || !isset($_SESSION['session_utc_offse
|
||||
// Calculate UTC offset and store it in session
|
||||
$session_datetime = new DateTime('now', new DateTimeZone($_SESSION['session_timezone']));
|
||||
$_SESSION['session_utc_offset'] = $session_datetime->format('P');
|
||||
}
|
||||
|
||||
// Use the stored timezone and offset
|
||||
$session_timezone = $_SESSION['session_timezone'];
|
||||
|
||||
Reference in New Issue
Block a user