diff --git a/check_login.php b/check_login.php index feea9eab..a0fd1573 100644 --- a/check_login.php +++ b/check_login.php @@ -22,6 +22,9 @@ if (!isset($_SESSION['logged']) || !$_SESSION['logged']) { exit; } +// Set Timezone +require_once "inc_set_timezone.php"; + // User IP & UA $session_ip = sanitizeInput(getIP()); $session_user_agent = sanitizeInput($_SERVER['HTTP_USER_AGENT']); @@ -52,14 +55,6 @@ $session_company_name = $row['company_name']; $session_company_country = $row['company_country']; $session_company_locale = $row['company_locale']; $session_company_currency = $row['company_currency']; -$session_timezone = $row['config_timezone']; - -// Set Timezone to the companies timezone -// 2024-02-08 JQ - The option to set the timezone in PHP was disabled to prevent inconsistencies with MariaDB/MySQL, which utilize the system's timezone, It is now consdered best practice to set the timezone on system itself -//date_default_timezone_set($session_timezone); - -// 2024-03-21 JQ - Re-Enabled Timezone setting as new PHP update does not respect System Time but defaulted to UTC -date_default_timezone_set($session_timezone); //Set Currency Format $currency_format = numfmt_create($session_company_locale, NumberFormatter::CURRENCY); diff --git a/cron.php b/cron.php index da0546c5..8ea474b9 100644 --- a/cron.php +++ b/cron.php @@ -5,6 +5,9 @@ chdir(dirname(__FILE__)); require_once "config.php"; +// Set Timezone +require_once "inc_set_timezone.php"; + require_once "functions.php"; @@ -32,7 +35,6 @@ $config_invoice_from_email = sanitizeInput($row['config_invoice_from_email']); $config_invoice_from_name = sanitizeInput($row['config_invoice_from_name']); $config_invoice_late_fee_enable = intval($row['config_invoice_late_fee_enable']); $config_invoice_late_fee_percent = floatval($row['config_invoice_late_fee_percent']); -$config_timezone = sanitizeInput($row['config_timezone']); // Mail Settings $config_smtp_host = $row['config_smtp_host']; @@ -71,9 +73,6 @@ $config_login_remember_me_expire = intval($row['config_login_remember_me_expire' // Set Currency Format $currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY); -// Set Timezone -date_default_timezone_set($config_timezone); - $argv = $_SERVER['argv']; // Check cron is enabled diff --git a/cron_certificate_refresher.php b/cron_certificate_refresher.php index 2b1cdc76..3d0e76e5 100644 --- a/cron_certificate_refresher.php +++ b/cron_certificate_refresher.php @@ -2,6 +2,9 @@ require_once "config.php"; +// Set Timezone +require_once "inc_set_timezone.php"; + require_once "functions.php"; @@ -12,10 +15,6 @@ $row = mysqli_fetch_array($sql_settings); // Company Settings $config_enable_cron = intval($row['config_enable_cron']); $config_cron_key = $row['config_cron_key']; -$config_timezone = sanitizeInput($row['config_timezone']); - -// Set Timezone -date_default_timezone_set($config_timezone); $argv = $_SERVER['argv']; diff --git a/cron_domain_refresher.php b/cron_domain_refresher.php index d76fc919..5a312bb6 100644 --- a/cron_domain_refresher.php +++ b/cron_domain_refresher.php @@ -2,6 +2,9 @@ require_once "config.php"; +// Set Timezone +require_once "inc_set_timezone.php"; + require_once "functions.php"; @@ -12,10 +15,6 @@ $row = mysqli_fetch_array($sql_settings); // Company Settings $config_enable_cron = intval($row['config_enable_cron']); $config_cron_key = $row['config_cron_key']; -$config_timezone = sanitizeInput($row['config_timezone']); - -// Set Timezone -date_default_timezone_set($config_timezone); $argv = $_SERVER['argv']; diff --git a/cron_mail_queue.php b/cron_mail_queue.php index 9ec952e8..f6fb6088 100644 --- a/cron_mail_queue.php +++ b/cron_mail_queue.php @@ -1,6 +1,10 @@