Skip to content

Commit

Permalink
QA: #4926 - One missed change
Browse files Browse the repository at this point in the history
This missed change will reconcile any issues with client timezone support.
  • Loading branch information
TheWitness committed Nov 23, 2022
1 parent ef85619 commit 0ae3542
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7105,6 +7105,10 @@ function cacti_browser_zone_enabled() {
* @return - null
*/
function cacti_time_zone_set($gmt_offset) {
if (!cacti_browser_zone_enabled()) {
return;
}

$hours = floor($gmt_offset / 60);
$remaining = $gmt_offset % 60;

Expand Down
7 changes: 4 additions & 3 deletions lib/rrd.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,17 @@ function __rrd_execute($command_line, $log_to_stdout, $output_flag, $rrdtool_pip
}

cacti_session_close();

if (is_file(read_config_option('path_rrdtool')) && is_executable(read_config_option('path_rrdtool'))) {
$descriptorspec = array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w')
);

if ( $config['is_web'] ) {
if( isset( $_COOKIE['CactiTimeZone'] ) ) {
if ($config['is_web']) {
if (isset($_COOKIE['CactiTimeZone'])) {
$gmt_offset = $_COOKIE['CactiTimeZone'];
cacti_time_zone_set( $gmt_offset );
cacti_time_zone_set($gmt_offset);
}
}

Expand Down

0 comments on commit 0ae3542

Please sign in to comment.