Incorporated changes for release 1.4.5

This commit is contained in:
2026-02-24 21:09:59 -05:00
parent 1d26b8bfed
commit 0bc6d684c1
14 changed files with 350 additions and 474 deletions

View File

@@ -187,3 +187,22 @@ Changelog
trying to insert a null value into the action_reason field of
the writeups table (you left the action reason dropdown blank).
Previous versions just left it as is without complaint.
1.4.5 - 2025-12-16
- Various problems were noted resulting from php's use of UTC as the
default timezone. Now, on installation or upgrade, the installer
gets the correct timezone from the system and sets it as a php
option in a .htaccess file in the install location. This solves
multiple problems and allows today's date and the current time
to be determined from the php date() function as part of the
settings.php once per page load instead of having to query the
database multiple times per page load. Also added the option to
allow apache to read the .htaccess file to the <Directory>
section of the application's conf file in
/etc/apache2/conf-available
- Renamed the installer's opendrs-update.sh script to files_update.sh
to align with the standardized installation process used by
other applications.
- Changed the install.sh script to align with the standardized
installation process used by other applications.

View File

@@ -93,9 +93,6 @@ framework("begin","$appname","New Writeup",$print);
// ******** begin database manipulation ********
// determine today's date and make it the default
$today=date("Y-m-d");
$now=date("H:i:s");
if (!isset($report_date) || $report_date=="automatic") $report_date=$today;
if (!isset($report_time) || $report_time=="automatic") $report_time=$now;
@@ -133,7 +130,7 @@ echo "<br>";
// display the form
if (isset($create)) {
if ($discrepancy_text!=NULL && $reported_by!=NULL) {
format_message(0,"<strong>Writeup created.</strong> You may create another writeup or <a href=\"writeups.php\">return to Open Writeups page.</a>");
format_message(0,"<strong>Writeup created.</strong> You may create another writeup or <a href=\"writeups.php\">return to View Writeups page.</a>");
$preserve=false;
}
if ($device==NULL) {

View File

@@ -113,10 +113,6 @@ framework("begin","$appname","Writeup Groups",$print);
// ******** begin database manipulation ********
// determine today's date and make it the default
$today=date("Y-m-d");
$now=date("H:i:s");
// get max report date from writeups table, validate input dates/times and set defaults
$maxrepdate_qry=mysqli_query($drs_db,"select max(report_date) from writeups");
$maxrepdate=mysqli_fetch_row($maxrepdate_qry)[0];

View File

@@ -38,10 +38,10 @@ if (array_key_exists('exportcsv',$_REQUEST)) {
$exportcsv=true;
$csv_filename="{$appname}_Search_Results_" . date("Y-m-d_His") . ".csv";
// disable caching
$now = gmdate("D, d M Y H:i:s");
$lastmodified = gmdate("D, d M Y H:i:s");
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
header("Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate");
header("Last-Modified: {$now} GMT");
header("Last-Modified: {$lastmodified} GMT");
// force download
header("Content-Type: application/force-download");

View File

@@ -7,6 +7,10 @@
SPDX-License-Identifier: GPL-2.0
*/
// determine today's date and time and assign them to variables
$today = date("Y-m-d");
$now = date("H:i:s");
$sttl=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"session_ttl_days\""))[0];
$ostype=strtoupper(substr(php_uname('s'), 0, 3));
if ($ostype == 'WIN') {

View File

@@ -97,9 +97,6 @@ framework("begin","$appname","Writeup Detail",$print);
// ******** begin database manipulation ********
// determine today's date and make it the default
$today=date("Y-m-d");
$now=date("H:i:s");
if ($usersave) {
// user parameters

View File

@@ -130,7 +130,7 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
}
$writeup=mysqli_query($drs_db,"select * from writeups where report_date between \"$start_date\" and \"$end_date\" order by report_date desc,report_time desc");
if (mysqli_num_rows($writeup)) {
$now=date("H:i l");
$as_of=date("H:i l");
if ($viewtype == "summary") {
if ($role) {
$selcol="<th style=\"width:1%;\">Sel</th>";
@@ -138,7 +138,7 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
$selcol="";
}
echo "
<font color=\"red\">As of $now</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"-1\">Newest at top</font><br>
<font color=\"red\">As of $as_of</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"-1\">Newest at top</font><br>
<table border=\"1\" cellpadding=\"5\" style=\"width:100%;\">
<tr>
$selcol
@@ -231,7 +231,7 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
echo "</table>\n";
} elseif ($viewtype == "detail") {
echo "
<font color=\"red\">As of $now</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"-1\">Newest at top</font><br><br>
<font color=\"red\">As of $as_of</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=\"-1\">Newest at top</font><br><br>
<table border=\"0\"><tr><td>
";
while ($tablerow = mysqli_fetch_assoc($writeup)) {
@@ -272,7 +272,6 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
}
// use default date values if not supplied
$today = date("Y-m-d");
if (!isset($start_date)) $start_date=$today;
if (!isset($end_date)) $end_date=$today;
if (isset($showtoday)) {