Incorporate changes made for old version 5.2.4.4.

This commit is contained in:
2026-02-10 15:17:09 -05:00
parent 4341c87daa
commit 0265918430
9 changed files with 80 additions and 46 deletions

View File

@@ -232,3 +232,11 @@
code from install.sh. This is best done using separate code from install.sh. This is best done using separate
installers. installers.
5.2.4.4 - 2025-12-19
-Fixed bugs that caused crashes on the Scheduled Maintenance page
that were caused by more strict behavior of php regarding mysql
queries.
- Fixed bug where some functions defined in functions.php were not
treating the $today variable as global.
- In install.php, if a previous installation was found, make upgrade
the default choice.

View File

@@ -69,7 +69,7 @@ CREATE TABLE `configs` (
LOCK TABLES `configs` WRITE; LOCK TABLES `configs` WRITE;
/*!40000 ALTER TABLE `configs` DISABLE KEYS */; /*!40000 ALTER TABLE `configs` DISABLE KEYS */;
INSERT INTO `configs` VALUES INSERT INTO `configs` VALUES
(1,'ol_version','5.2.4.3'), (1,'ol_version','5.2.4.4'),
(2,'log_name','OpenLog'), (2,'log_name','OpenLog'),
(3,'banner','1'), (3,'banner','1'),
(4,'background_color','#003333'), (4,'background_color','#003333'),

View File

@@ -29,3 +29,7 @@ margs="--defaults-extra-file=$mysql_opt_file"
# ---------- version 5.2.4.3 ---------- # ---------- version 5.2.4.3 ----------
# Nothing to do # Nothing to do
# ------------------------------------- # -------------------------------------
# ---------- version 5.2.4.4 ----------
# Nothing to do
# -------------------------------------

View File

@@ -45,3 +45,8 @@ UPDATE configs SET confvalue="5.2.4.2" WHERE confname="ol_version";
-- Update version number -- Update version number
UPDATE configs SET confvalue="5.2.4.3" WHERE confname="ol_version"; UPDATE configs SET confvalue="5.2.4.3" WHERE confname="ol_version";
-- -------------------------------------- -- --------------------------------------
-- ---------- version 5.2.4.4 -----------
-- Update version number
UPDATE configs SET confvalue="5.2.4.4" WHERE confname="ol_version";
-- --------------------------------------

View File

@@ -232,3 +232,11 @@
code from install.sh. This is best done using separate code from install.sh. This is best done using separate
installers. installers.
5.2.4.4 - 2025-12-19
-Fixed bugs that caused crashes on the Scheduled Maintenance page
that were caused by more strict behavior of php regarding mysql
queries.
- Fixed bug where some functions defined in functions.php were not
treating the $today variable as global.
- In install.php, if a previous installation was found, make upgrade
the default choice.

View File

@@ -721,7 +721,7 @@ function showlinklist($print) {
function nag($tech_id) { function nag($tech_id) {
// nags the user if something is pending // nags the user if something is pending
global $db; global $db, $today;
// maintenance forms // maintenance forms
$mfpending=mysqli_num_rows(mysqli_query($db,"select maintformid from maintforms where mftech=\"$tech_id\" and pending=1")); $mfpending=mysqli_num_rows(mysqli_query($db,"select maintformid from maintforms where mftech=\"$tech_id\" and pending=1"));
if ($mfpending) { if ($mfpending) {
@@ -819,7 +819,7 @@ function get_upcoming_events() {
// build array of upcoming events // build array of upcoming events
// takes no arguments // takes no arguments
// returns an array containing arrays of upcoming event data // returns an array containing arrays of upcoming event data
global $db; global $db, $today;
$uceventsqry=mysqli_query($db,"select * from events where active_flag=\"1\" and (deferred_flag=\"0\" or (deferred_flag=\"1\" and deferred_date <= \"$today\"))"); $uceventsqry=mysqli_query($db,"select * from events where active_flag=\"1\" and (deferred_flag=\"0\" or (deferred_flag=\"1\" and deferred_date <= \"$today\"))");
$ucevents=array(); $ucevents=array();
while ($uceventrow=mysqli_fetch_assoc($uceventsqry)) { while ($uceventrow=mysqli_fetch_assoc($uceventsqry)) {

View File

@@ -14,50 +14,50 @@ if (isset($_SESSION['login'])) {
} else { } else {
$loggedin=false; $loggedin=false;
} }
$techid=$_SESSION['login']; $techid=$_SESSION['login'] ?? NULL;
$isadmin=dblookup($db,"techs","techid","admin",$techid); $isadmin=dblookup($db,"techs","techid","admin",$techid);
$upcoming=$_REQUEST['upcoming']; $upcoming=$_REQUEST['upcoming'] ?? NULL;
$schedule=$_REQUEST['schedule']; $schedule=$_REQUEST['schedule'] ?? NULL;
$tasks=$_REQUEST['tasks']; $tasks=$_REQUEST['tasks'] ?? NULL;
$devices=$_REQUEST['devices']; $devices=$_REQUEST['devices'] ?? NULL;
$action=$_REQUEST['action']; $action=$_REQUEST['action'] ?? NULL;
$complete=$_REQUEST['complete']; $complete=$_REQUEST['complete'] ?? NULL;
$defer=$_REQUEST['defer']; $defer=$_REQUEST['defer'] ?? NULL;
$add=$_REQUEST['add']; $add=$_REQUEST['add'] ?? NULL;
$edit=$_REQUEST['edit']; $edit=$_REQUEST['edit'] ?? NULL;
$update=$_REQUEST['update']; $update=$_REQUEST['update'] ?? NULL;
$delete=$_REQUEST['delete']; $delete=$_REQUEST['delete'] ?? NULL;
$id=$_REQUEST['id']; $id=$_REQUEST['id'] ?? NULL;
$active_flag=$_REQUEST['active_flag']; $active_flag=$_REQUEST['active_flag'] ?? 0;
$devicename=$_REQUEST['devicename']; $devicename=$_REQUEST['devicename'] ?? NULL;
$devicedesc=$_REQUEST['devicedesc']; $devicedesc=$_REQUEST['devicedesc'] ?? NULL;
$group_flag=$_REQUEST['group_flag']; $group_flag=$_REQUEST['group_flag'] ?? 0;
$members=$_REQUEST['members']; $members=$_REQUEST['members'] ?? [];
$weekdays_only=$_REQUEST['weekdays_only']; $weekdays_only=$_REQUEST['weekdays_only'] ?? NULL;
$nextdue_relative=$_REQUEST['nextdue_relative']; $nextdue_relative=$_REQUEST['nextdue_relative'] ?? NULL;
$taskname=$_REQUEST['taskname']; $taskname=$_REQUEST['taskname'] ?? NULL;
$taskdesc=$_REQUEST['taskdesc']; $taskdesc=$_REQUEST['taskdesc'] ?? NULL;
$frequency=$_REQUEST['frequency']; $frequency=$_REQUEST['frequency'] ?? NULL;
$period=$_REQUEST['period']; $period=$_REQUEST['period'] ?? NULL;
$refdoc_name=$_REQUEST['refdoc_name']; $refdoc_name=$_REQUEST['refdoc_name'] ?? NULL;
$refdoc_url=$_REQUEST['refdoc_url']; $refdoc_url=$_REQUEST['refdoc_url'] ?? NULL;
$deferred_flag=$_REQUEST['deferred_flag']; $deferred_flag=$_REQUEST['deferred_flag'] ?? 0;
$deferred_date=$_REQUEST['deferred_date']; $deferred_date=$_REQUEST['deferred_date'] ?? NULL;
$start_date=$_REQUEST['start_date']; $start_date=$_REQUEST['start_date'] ?? NULL;
$last_date=$_REQUEST['last_date']; $last_date=$_REQUEST['last_date'] ?? NULL;
$task=$_REQUEST['task']; $task=$_REQUEST['task'] ?? NULL;
$device=$_REQUEST['device']; $device=$_REQUEST['device'] ?? NULL;
$deferuntil=$_REQUEST['deferuntil']; $deferuntil=$_REQUEST['deferuntil'] ?? NULL;
$completedate=$_REQUEST['completedate']; $completedate=$_REQUEST['completedate'] ?? NULL;
$addlognote=$_REQUEST['addlognote']; $addlognote=$_REQUEST['addlognote'] ?? NULL;
$logname=LOG_NAME; $logname=LOG_NAME;
$print=$_REQUEST['print']; $print=$_REQUEST['print'] ?? NULL;
if ($print) { if ($print) {
$sbcolor=P_SIDEBAR_COLOR; $sbcolor=P_SIDEBAR_COLOR;
@@ -126,6 +126,9 @@ if ($add) {
} }
// run through the memberlist and modify the table // run through the memberlist and modify the table
foreach ($memberlist as $memberdev) { foreach ($memberlist as $memberdev) {
if ($start_date==NULL) $start_date=$today;
if ($last_date==NULL) $last_date="0000-00-00";
if ($deferred_date==NULL) $deferred_date="0000-00-00";
$addqry=("insert into events(task,device,start_date,last_date,deferred_flag,deferred_date,active_flag) $addqry=("insert into events(task,device,start_date,last_date,deferred_flag,deferred_date,active_flag)
values(\"$task\",\"$memberdev\",\"$start_date\",\"$last_date\",\"$deferred_flag\",\"$deferred_date\",\"$active_flag\")"); values(\"$task\",\"$memberdev\",\"$start_date\",\"$last_date\",\"$deferred_flag\",\"$deferred_date\",\"$active_flag\")");
mysqli_query($db,$addqry); mysqli_query($db,$addqry);
@@ -200,6 +203,9 @@ if ($edit) {
$last_date=mysqli_real_escape_string($db,$last_date); $last_date=mysqli_real_escape_string($db,$last_date);
$deferred_date=mysqli_real_escape_string($db,$deferred_date); $deferred_date=mysqli_real_escape_string($db,$deferred_date);
// update the tasks table // update the tasks table
if ($start_date==NULL) $start_date=$today;
if ($last_date==NULL) $last_date="0000-00-00";
if ($deferred_date==NULL) $deferred_date="0000-00-00";
mysqli_query($db,"update events mysqli_query($db,"update events
set task=\"$task\",device=\"$device\",start_date=\"$start_date\",last_date=\"$last_date\",deferred_flag=\"$deferred_flag\", set task=\"$task\",device=\"$device\",start_date=\"$start_date\",last_date=\"$last_date\",deferred_flag=\"$deferred_flag\",
deferred_date=\"$deferred_date\",active_flag=\"$active_flag\" deferred_date=\"$deferred_date\",active_flag=\"$active_flag\"
@@ -400,7 +406,7 @@ if ($action) {
} }
if ($start_date=="0000-00-00") $start_date=$today; if ($start_date=="0000-00-00") $start_date=$today;
if ($last_date=="0000-00-00") $last_date=""; if ($last_date=="0000-00-00") $last_date="";
if ($deferred_date=="0000-00-00") $deferred_date=""; if ($deferred_date=="0000-00-00") $deferred_date=$tomorrow;
$deferuntiltag="<input type=\"text\" name=\"deferred_date\" id=\"deferdatepicker\" size=\"10\" maxlength=\"10\" value=\"$deferred_date\" title=\"Format: YYYY-MM-DD\">"; $deferuntiltag="<input type=\"text\" name=\"deferred_date\" id=\"deferdatepicker\" size=\"10\" maxlength=\"10\" value=\"$deferred_date\" title=\"Format: YYYY-MM-DD\">";
$startdatetag="<input type=\"text\" name=\"start_date\" id=\"startdatepicker\" size=\"10\" maxlength=\"10\" value=\"$start_date\" title=\"Format: YYYY-MM-DD\">"; $startdatetag="<input type=\"text\" name=\"start_date\" id=\"startdatepicker\" size=\"10\" maxlength=\"10\" value=\"$start_date\" title=\"Format: YYYY-MM-DD\">";
$lastdatetag="<input type=\"text\" name=\"last_date\" id=\"completedatepicker\" size=\"10\" maxlength=\"10\" value=\"$last_date\" title=\"Format: YYYY-MM-DD\">"; $lastdatetag="<input type=\"text\" name=\"last_date\" id=\"completedatepicker\" size=\"10\" maxlength=\"10\" value=\"$last_date\" title=\"Format: YYYY-MM-DD\">";

View File

@@ -38,3 +38,6 @@ then
fi fi
# -------------------------------------- # --------------------------------------
# ---------- version 5.2.4.4 -----------
# No changes
# --------------------------------------

View File

@@ -8,7 +8,7 @@
APP_NAME="OpenLog" APP_NAME="OpenLog"
DEFAULT_DB_NAME="openlog" DEFAULT_DB_NAME="openlog"
APP_VERSION="5.2.4.3" APP_VERSION="5.2.4.4"
DOC_ROOT="/var/www" DOC_ROOT="/var/www"
INSTALL_LOC="openlog" INSTALL_LOC="openlog"
APACHE_CONF_DIR="/etc/apache2/conf-available" APACHE_CONF_DIR="/etc/apache2/conf-available"
@@ -194,10 +194,13 @@ then
# the db.php file is part of a previous installation # the db.php file is part of a previous installation
echo "Would you like to upgrade an existing installation or cancel " echo "Would you like to upgrade an existing installation or cancel "
echo "and restart the install using a new installation location." echo "and restart the install using a new installation location."
echo -n "[U]pgrade or [C]ancel? [C] :" echo -n "[U]pgrade or [C]ancel? [U] :"
read upgrade_choice read upgrade_choice
if [ "$upgrade_choice" = "U" -o "$upgrade_choice" = "u" ] # Upgrade chosen if [[ $upgrade_choice == "C" || $upgrade_choice == "c" ]] # Cancel chosen
then then
echo "Cancelling installation"
abort_exit
else
# proceed with upgrade # proceed with upgrade
mkdir -p backups mkdir -p backups
operation="upgraded" operation="upgraded"
@@ -264,9 +267,6 @@ then
echo "" echo ""
echo "Setting file ownership . . ." echo "Setting file ownership . . ."
chown -R $httpd_user_group $install_path chown -R $httpd_user_group $install_path
else
echo "Cancelling installation"
abort_exit
fi fi
else else
# This was a mistake. Exit now to avoid clobbering another app. # This was a mistake. Exit now to avoid clobbering another app.