From 70d117cb6db049f6bbf925439638cba80e7a7f5d Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Wed, 3 Jul 2024 09:07:33 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=8BCopy=20from=20device=20#721?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/js/db_methods.js | 2 +- front/php/components/logs_defaults.json | 7 +++++++ front/php/server/devices.php | 9 +-------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/front/js/db_methods.js b/front/js/db_methods.js index 9938e55a..98885527 100755 --- a/front/js/db_methods.js +++ b/front/js/db_methods.js @@ -27,7 +27,7 @@ function checkDbLock() { type: 'GET', success: function(response) { - // console.log(response); + console.log(response); if (response == 0) { // console.log('Database is not locked'); $(".header-status-locked-db").hide() diff --git a/front/php/components/logs_defaults.json b/front/php/components/logs_defaults.json index 882ce209..825c5fe6 100755 --- a/front/php/components/logs_defaults.json +++ b/front/php/components/logs_defaults.json @@ -66,6 +66,13 @@ "filePath": "/app/front/log/app_front.log", "textAreaCssClass": "logs logs-small" }, + { + "buttons": [ + ], + "fileName": "db_is_locked.log", + "filePath": "/app/front/log/db_is_locked.log", + "textAreaCssClass": "logs logs-small" + }, { "buttons": [ { diff --git a/front/php/server/devices.php b/front/php/server/devices.php index 2bdcfd92..82022a48 100755 --- a/front/php/server/devices.php +++ b/front/php/server/devices.php @@ -901,18 +901,11 @@ function copyFromDevice() { $MAC_FROM = $_REQUEST['macFrom']; $MAC_TO = $_REQUEST['macTo']; - - if ((false === filter_var($MAC_FROM , FILTER_VALIDATE_MAC) && $MAC_FROM != "Internet" && $MAC_FROM != "") ) { - throw new Exception('Invalid mac address'); - } - if ((false === filter_var($MAC_TO , FILTER_VALIDATE_MAC) && $MAC_TO != "Internet" && $MAC_TO != "") ) { - throw new Exception('Invalid mac address'); - } global $db; // clean-up temporary table - $sql = "DROP TABLE temp_devices "; + $sql = "DROP TABLE IF EXISTS temp_devices "; $result = $db->query($sql); // create temporary table with the source data