deviceDetails change notification overhaul

This commit is contained in:
Jokob-sk
2023-01-06 00:01:24 +11:00
parent 68bc03d6a5
commit 09d9491354
7 changed files with 181 additions and 78 deletions

View File

@@ -12,6 +12,7 @@ require '/home/pi/pialert/front/php/templates/timezone.php';
require '/home/pi/pialert/front/php/templates/skinUI.php';
$FUNCTION = [];
$SETTINGS = [];
@@ -35,6 +36,10 @@ elseif ($FUNCTION == 'cleanLog')
{
cleanLog($SETTINGS);
}
elseif ($FUNCTION == 'saveNmapPort' && array_key_exists('index', $_REQUEST) && array_key_exists('value', $_REQUEST) )
{
saveNmapPort($_REQUEST['index'], $_REQUEST['value']);
}
//------------------------------------------------------------------------------
// Formatting data functions
@@ -281,6 +286,29 @@ function saveSettings()
}
// -------------------------------------------------------------------------------------------
function saveNmapPort($portIndex, $value)
{
if(is_integer($portIndex))
{
$value = escapeString($value);
// sql
$sql = 'UPDATE Nmap_Scan SET Extra = "'. quotes($value) .'" WHERE Index="' . $portIndex .'"';
// update Data
$result = $db->query($sql);
// check result
if ($result == TRUE) {
echo lang('Gen_Upd');
} else {
echo lang('Gen_Upd_Fail')."\n\n$sql \n\n". $db->lastErrorMsg();
}
}
echo "asdasdasasd";
}
// -------------------------------------------------------------------------------------------
function getString ($codeName, $default) {
$result = lang($codeName);