Revert "Pi.alert new features in deviceDetails.php (tools tab) and new translations"

This commit is contained in:
jokob-sk
2023-08-25 06:55:40 +10:00
committed by GitHub
parent b82246595f
commit 033dacf8be
11 changed files with 67 additions and 603 deletions

View File

@@ -1,49 +0,0 @@
<?php
###################################################################################
# Pi.Alert #
# Open Source Network Guard / WIFI & LAN intrusion detector #
# #
# internetinfo.php # Front module. Server side. System Information #
###################################################################################
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 #
# jokob#sk 2022 jokob.sk@gmail.com GNU GPLv3 #
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
###################################################################################
// Get init.php
require dirname(__FILE__).'/../server/init.php';
// Perform a test with the PING command
$output = shell_exec("curl ipinfo.io");
// Check if there is error
if (!isset($output) || empty($output)) {
// Error message
$output = lang('DevDetail_Tab_Internet_Info_Error');
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
exit;
}
// Replace "{" with ""
$output = str_replace("{", "", $output);
// Replace "}" with ""
$output = str_replace("}", "", $output);
// Replace "," with ""
$output = str_replace(",", "", $output);
// Replace '"' with ""
$output = str_replace('"', "", $output);
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
?>

View File

@@ -1,40 +0,0 @@
<?php
###################################################################################
# Pi.Alert #
# Open Source Network Guard / WIFI & LAN intrusion detector #
# #
# mtr.php # Front module. Server side. System Information #
###################################################################################
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 #
# jokob#sk 2022 jokob.sk@gmail.com GNU GPLv3 #
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
###################################################################################
// Get init.php
require dirname(__FILE__).'/../server/init.php';
// Get IP
$ip = $_GET['ip'];
// Check if IP is valid
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
// Error message
$output = lang('DevDetail_Tab_Tools_Mtr_Error');
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
exit;
}
// Test with the "Mtr" command
$output = shell_exec("mtr --report -c 4 $ip");
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
?>

View File

@@ -1,40 +0,0 @@
<?php
###################################################################################
# Pi.Alert #
# Open Source Network Guard / WIFI & LAN intrusion detector #
# #
# nslookup.php # Front module. Server side. System Information #
###################################################################################
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 #
# jokob#sk 2022 jokob.sk@gmail.com GNU GPLv3 #
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
###################################################################################
// Get init.php
require dirname(__FILE__).'/../server/init.php';
// Get IP
$ip = $_GET['ip'];
// Check if IP is valid
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
// Error message
$output = lang('DevDetail_Tab_Tools_Nslookup_Error');
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
exit;
}
// Test with the "nslookup" command
$output = shell_exec("nslookup $ip");
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
?>

View File

@@ -1,40 +0,0 @@
<?php
###################################################################################
# Pi.Alert #
# Open Source Network Guard / WIFI & LAN intrusion detector #
# #
# ping.php # Front module. Server side. System Information #
###################################################################################
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 #
# jokob#sk 2022 jokob.sk@gmail.com GNU GPLv3 #
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
###################################################################################
// Get init.php
require dirname(__FILE__).'/../server/init.php';
// Get IP
$ip = $_GET['ip'];
// Check if IP is valid
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
// Error message
$output = lang('DevDetail_Tab_Tools_Ping_Error');
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
exit;
}
// Perform a test with the PING command
$output = shell_exec("ping -c4 $ip");
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
?>

View File

@@ -1,40 +0,0 @@
<?php
###################################################################################
# Pi.Alert #
# Open Source Network Guard / WIFI & LAN intrusion detector #
# #
# traceroute.php # Front module. Server side. System Information #
###################################################################################
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 #
# jokob#sk 2022 jokob.sk@gmail.com GNU GPLv3 #
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
###################################################################################
// Get init.php
require dirname(__FILE__).'/../server/init.php';
// Get IP
$ip = $_GET['ip'];
// Check if IP is valid
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
// Error message
$output = lang('DevDetail_Tab_Tools_Traceroute_Error');
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
exit;
}
// Test with the "Traceroute" command
$output = shell_exec("traceroute $ip");
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
?>

View File

@@ -1,90 +0,0 @@
<?php
#---------------------------------------------------------------------------------#
# Pi.Alert #
# Open Source Network Guard / WIFI & LAN intrusion detector #
# #
# wol.php - Front module. Server side. System Information #
#---------------------------------------------------------------------------------#
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 #
# jokob-sk 2022 jokob.sk@gmail.com GNU GPLv3 #
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
#---------------------------------------------------------------------------------#
/*
* This code will send a Wake-on-LAN packet to the specified MAC address.
*
* The MAC address must be in the format AA:BB:CC:DD:EE:FF.
*
* The port and password are optional. If no port is specified, the default port of 9 is used.
* If no password is specified, no password is used.
*/
// Get init.php
require dirname(__FILE__).'/../server/init.php';
// Get the MAC address of the device to wake up
$mac = $_GET['mac'];
// Validate the MAC address
if (!filter_var($mac, FILTER_VALIDATE_MAC)) {
// Error message
$output = lang('DevDetail_Tab_Tools_WOL_Error_MAC');
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
exit;
}
// Get the port
$port = isset($_GET['port']) ? $_GET['port'] : 9;
// Validate the port
if (!filter_var($port, FILTER_VALIDATE_INT, array('options' => array('min_range' => 1, 'max_range' => 65535)))) {
// Error message
$output = lang('DevDetail_Tab_Tools_WOL_Error_Port');
// Show the result
echo "<pre>";
echo $output;
echo "</pre>";
exit;
}
// Get password
$password = isset($_GET['password']) ? $_GET['password'] : '';
// Validate the password (regular expression requires that the password has at least 8 characters, a lowercase letter, an uppercase letter and a number)
//if (!filter_var($password, FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => '/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/')))) {
// Error message
// $output = lang('DevDetail_Tab_Tools_WOL_Error_Password');
// Show the result
// echo "<pre>";
// echo $output;
// echo "</pre>";
// exit;
//}
// Create the magic packet
$magicPacket = pack('H*', 'FF FF FF FF FF FF FF ' . $mac);
// Create a UDP socket
$socket = socket_create(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
// Set the socket options
socket_set_option($socket, SOL_SOCKET, SO_BROADCAST, true);
// Send the WoL packet
socket_sendto($socket, $magicPacket, strlen($magicPacket), 0, '255.255.255.255', $port);
// Close the socket
socket_close($socket);
// Print a message to indicate that the device has been woken up
echo "<pre>";
$output = lang('DevDetail_Tab_Tools_WOL_Message');
echo $output;
echo "</pre>";
?>