From 2a6621959c3f6ce5d78cd3687eaa46a4187e93e4 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 13 Mar 2021 12:47:05 -0500 Subject: [PATCH] We CANNOT specify nextId for the next mid to use. If we do that then we can overwrite existing db entries --- web/skins/classic/views/monitor.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index 1806a1745..a2402b8bc 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -33,13 +33,14 @@ if ( defined('ZM_SERVER_ID') ) { if ( !$Server ) { $Server = array('Id' => ''); } - +$mid = null; $monitor = null; if ( !empty($_REQUEST['mid']) ) { - $nextId = validInt($_REQUEST['mid']); - $monitor = new ZM\Monitor($_REQUEST['mid']); + $mid = validInt($_REQUEST['mid']); + + $monitor = new ZM\Monitor($mid); if ( $monitor and ZM_OPT_X10 ) - $x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['mid'])); + $x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($mid)); } if ( !$monitor ) { @@ -56,7 +57,7 @@ if ( isset($_REQUEST['dupId']) ) { $x10Monitor = dbFetchOne('SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['dupId'])); $clonedName = $monitor->Name(); $monitor->Name('Clone of '.$monitor->Name()); - $monitor->Id(!empty($_REQUEST['mid'])?validInt($_REQUEST['mid']) : 0); + $monitor->Id($mid); } if ( ZM_OPT_X10 && empty($x10Monitor) ) { @@ -467,7 +468,7 @@ if ( canEdit('Monitors') ) {
- +