From f840586aaa9ebe388e5a1f428dd7955aaace61fa Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Mon, 10 Jan 2011 11:22:42 +0100 Subject: [PATCH] bacula-web: Internal PHP code fix - Replaced 86400 values by LAST_DAY constant in bweb.inc.php, bgraph.inc.php and index.php --- gui/bacula-web/bgraph.inc.php | 2 +- gui/bacula-web/bweb.inc.php | 2 +- gui/bacula-web/index.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/bacula-web/bgraph.inc.php b/gui/bacula-web/bgraph.inc.php index 6b61bc21ea..6c8d98039c 100644 --- a/gui/bacula-web/bgraph.inc.php +++ b/gui/bacula-web/bgraph.inc.php @@ -241,7 +241,7 @@ class BCreateGraph extends BGraph { $this->StartDate = "1900-01-01"; $this->EndDate = "4000-01-01"; - $this->elapsed = "86400"; // 24 hours in seconds. + $this->elapsed = LAST_DAY; // 24 hours in seconds. } diff --git a/gui/bacula-web/bweb.inc.php b/gui/bacula-web/bweb.inc.php index 8087e35983..528d1e1420 100644 --- a/gui/bacula-web/bweb.inc.php +++ b/gui/bacula-web/bweb.inc.php @@ -457,7 +457,7 @@ class Bweb extends DB { $total_elapsed += $time['elapsed']; } // Verify if elapsed time is more than 1 day - if ( $total_elapsed > 86400 ) { + if ( $total_elapsed > LAST_DAY ) { return date("%d days H:i:s", $total_elapsed ); }else { return date("H:i:s", $total_elapsed ); diff --git a/gui/bacula-web/index.php b/gui/bacula-web/index.php index c4736bacd2..6bb0026984 100644 --- a/gui/bacula-web/index.php +++ b/gui/bacula-web/index.php @@ -147,7 +147,7 @@ $days = array(); // Get the last 7 days interval (start and end) for( $c = 6 ; $c >= 0 ; $c-- ) { - $today = ( mktime() - ($c * 86400) ); + $today = ( mktime() - ($c * LAST_DAY) ); array_push( $days, array( 'start' => date( "Y-m-d 00:00:00", $today ), 'end' => date( "Y-m-d 23:59:00", $today ) ) ); } -- 2.39.2