Merge pull request #379 from jokob-sk/revert-366-Pi.Alert-New-Functions-in-Tools-tab

Revert "Pi.alert new features in deviceDetails.php (tools tab) and new translations"
This commit is contained in:
jokob-sk
2023-08-24 20:55:56 +00:00
committed by GitHub
11 changed files with 67 additions and 603 deletions

View File

@@ -8,7 +8,7 @@ ENV USER=pi USER_ID=1000 USER_GID=1000 PORT=20211
# Todo, do we still need all these packages? I can already see sudo which isn't needed
RUN apt-get update \
&& apt-get install --no-install-recommends tini snmp ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo nginx-light php php-cgi php-fpm php-sqlite3 php-curl sqlite3 dnsutils net-tools python3 iproute2 nmap python3-pip zip systemctl usbutils iputils-ping traceroute -y \
&& apt-get install --no-install-recommends tini snmp ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo nginx-light php php-cgi php-fpm php-sqlite3 php-curl sqlite3 dnsutils net-tools python3 iproute2 nmap python3-pip zip systemctl usbutils -y \
&& pip3 install requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
&& apt-get clean autoclean \

View File

@@ -99,22 +99,20 @@
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12">
<!-- <div class="box-transparent"> -->
<div id="navDevice" class="nav-tabs-custom">
<ul class="nav nav-tabs" style="fon t-size:16px;">
<li> <a id="tabDetails" href="#panDetails" data-toggle="tab"> <?= lang('DevDetail_Tab_Details');?> </a></li>
<?php
if ($_REQUEST['mac'] != 'Internet') {
?>
<li> <a id="tabNmap" href="#panNmap" data-toggle="tab"> <?= lang('DevDetail_Tab_Nmap');?> </a></li>
<?php
}
?>
<li> <a id="tabTools" href="#panTools" data-toggle="tab"> <?= lang('DevDetail_Tab_Tools');?> </a></li>
<?php
if ($_REQUEST['mac'] == 'Internet') { $DevDetail_Tap_temp = lang('DevDetail_Tab_Tools'); } else { $DevDetail_Tap_temp = lang('DevDetail_Tab_Nmap');}
?>
<li> <a id="tabNmap" href="#panNmap" data-toggle="tab"> <?php echo $DevDetail_Tap_temp;?> </a></li>
<li> <a id="tabSessions" href="#panSessions" data-toggle="tab"> <?= lang('DevDetail_Tab_Sessions');?> </a></li>
<li> <a id="tabPresence" href="#panPresence" data-toggle="tab"> <?= lang('DevDetail_Tab_Presence');?> </a></li>
<li> <a id="tabEvents" href="#panEvents" data-toggle="tab"> <?= lang('DevDetail_Tab_Events');?> </a></li>
<li> <a id="tabPholus" href="#panPholus" data-toggle="tab"> <?= lang('DevDetail_Tab_Pholus');?> </a></li>
<li> <a id="tabPlugins" href="#panPlugins" data-toggle="tab"> <?= lang('DevDetail_Tab_Plugins');?> </a></li>
<li> <a id="tabPlugins" href="#panPlugins" data-toggle="tab"> <?= lang('DevDetail_Tab_Plugins');?> </a></li>
<div class="btn-group pull-right">
<button type="button" class="btn btn-default" style="padding: 10px; min-width: 30px;"
@@ -127,7 +125,9 @@
id="btnNext" onclick="recordSwitch('next')"> <i class="fa fa-chevron-right"></i> </button>
</div>
</ul>
<div class="tab-content" style="min-height: 430px;">
<!-- tab page 1 ------------------------------------------------------------ -->
@@ -536,11 +536,37 @@
</div>
<!-- tab page "Nmap" ------------------------------------------------------------ -->
<!-- tab page 5 ------------------------------------------------------------ -->
<div class="tab-pane fade" id="panNmap">
<h4 class=""><i class="fa-solid fa-ethernet"></i> <?= lang('DevDetail_Nmap_Scans');?></h4>
<?php
if ($_REQUEST['mac'] == 'Internet') {
?>
<h4 class=""><?= lang('DevDetail_Internet_Speedtest');?></h4>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="speedtestcli" class="btn btn-primary pa-btn" style="margin: auto;" onclick="speedtestcli()"><?= lang('DevDetail_Internet_Speedtest_Start');?></button>
</div>
<script>
function speedtestcli() {
$( "#scanoutput" ).empty();
$.ajax({
method: "POST",
url: "./php/server/speedtestcli.php",
beforeSend: function() { $('#scanoutput').addClass("ajax_scripts_loading"); },
complete: function() { $('#scanoutput').removeClass("ajax_scripts_loading"); },
success: function(data, textStatus) {
$("#scanoutput").html(data);
}
})
}
</script>
<?php
}
?>
<h4 class=""><?= lang('DevDetail_Nmap_Scans');?></h4>
<div style="width:100%; text-align: center;">
<script>
setTimeout(function(){
@@ -551,10 +577,10 @@
}, 2000);
</script>
<button type="button" id="piamanualnmap_fast" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'fast')"><?= lang("DevDetail_Loading");?></button>
<button type="button" id="piamanualnmap_normal" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'normal')"><?= lang("DevDetail_Loading");?></button>
<button type="button" id="piamanualnmap_detail" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'detail')"><?= lang("DevDetail_Loading");?></button>
<button type="button" id="piamanualnmap_skipdiscovery" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'skipdiscovery')"><?= lang("DevDetail_Loading");?></button>
<button type="button" id="piamanualnmap_fast" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'fast')">Loading...</button>
<button type="button" id="piamanualnmap_normal" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'normal')">Loading...</button>
<button type="button" id="piamanualnmap_detail" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'detail')">Loading...</button>
<button type="button" id="piamanualnmap_skipdiscovery" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(document.getElementById('txtLastIP').value, 'skipdiscovery')">Loading...</button>
<div style="text-align: left;">
<ul style="padding:20px;">
@@ -608,208 +634,17 @@
<tr id="tableNmapPlc" class="text-center"><td colspan='7'><span><?= lang("DevDetail_Tab_NmapEmpty"); ?></span></td></tr>
</tbody>
</table>
</div>
<!-- tab page "Tools" ------------------------------------------------------------ -->
<div class="tab-pane fade" id="panTools">
<?php
if ($_REQUEST['mac'] == 'Internet') {
?>
<h4 class=""><i class="fa-solid fa-globe"></i> <?= lang('DevDetail_Tab_Internet_Info_Title');?></h4>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="internetinfo" class="btn btn-primary pa-btn" style="margin: auto;" onclick="internetinfo()"><?= lang('DevDetail_Tab_Internet_Info_Start');?></button>
<br><div id="internetinfooutput" style="margin-top: 10px;"></div>
</div>
<script>
function internetinfo() {
$( "#internetinfooutput" ).empty();
$.ajax({
method: "POST",
url: "./php/server/internetinfo.php",
beforeSend: function() { $('#internetinfooutput').addClass("ajax_scripts_loading"); },
complete: function() { $('#internetinfooutput').removeClass("ajax_scripts_loading"); },
success: function(data, textStatus) {
$("#internetinfooutput").html(data);
}
})
}
</script>
<?php
}
?>
<?php
if ($_REQUEST['mac'] == 'Internet') {
?>
<h4 class=""><i class="fa-solid fa-rocket"></i> <?= lang('DevDetail_Tab_Internet_Speedtest_Title');?></h4>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="speedtestcli" class="btn btn-primary pa-btn" style="margin: auto;" onclick="speedtestcli()"><?= lang('DevDetail_Tab_Internet_Speedtest_Start');?></button>
<br><div id="speedtestoutput" style="margin-top: 10px;"></div>
</div>
<script>
function speedtestcli() {
$( "#speedtestoutput" ).empty();
$.ajax({
method: "POST",
url: "./php/server/speedtestcli.php",
beforeSend: function() { $('#speedtestoutput').addClass("ajax_scripts_loading"); },
complete: function() { $('#speedtestoutput').removeClass("ajax_scripts_loading"); },
success: function(data, textStatus) {
$("#speedtestoutput").html(data);
}
})
}
</script>
<?php
}
?>
<?php
if ($_REQUEST['mac'] != 'Internet') {
?>
<h4 class=""><i class="fa-solid fa-arrows-spin"></i> <?= lang('DevDetail_Tab_Tools_Ping_Title');?></h4>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="ping" class="btn btn-primary pa-btn" style="margin: auto;" onclick="ping()"><?= lang('DevDetail_Tab_Tools_Ping_Start');?></button>
<br><div id="pingoutput" style="margin-top: 10px;"></div>
</div>
<script>
function ping() {
$( "#pingoutput" ).empty();
$.ajax({
method: "GET",
url: "./php/server/ping.php?action=get&ip=" + document.getElementById('txtLastIP').value + "",
beforeSend: function() { $('#pingoutput').addClass("ajax_scripts_loading"); },
complete: function() { $('#pingoutput').removeClass("ajax_scripts_loading"); },
success: function(data, textStatus) {
$("#pingoutput").html(data);
}
})
}
</script>
<?php
}
?>
<?php
if ($_REQUEST['mac'] != 'Internet') {
?>
<h4 class=""><i class="fa-solid fa-route"></i> <?= lang('DevDetail_Tab_Tools_Traceroute_Title');?></h4>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="traceroute" class="btn btn-primary pa-btn" style="margin: auto;" onclick="traceroute()"><?= lang('DevDetail_Tab_Tools_Traceroute_Start');?></button>
<br><div id="tracerouteoutput" style="margin-top: 10px;"></div>
</div>
<script>
function traceroute() {
$( "#tracerouteoutput" ).empty();
$.ajax({
method: "GET",
url: "./php/server/traceroute.php?action=get&ip=" + document.getElementById('txtLastIP').value + "",
beforeSend: function() { $('#tracerouteoutput').addClass("ajax_scripts_loading"); },
complete: function() { $('#tracerouteoutput').removeClass("ajax_scripts_loading"); },
success: function(data, textStatus) {
$("#tracerouteoutput").html(data);
}
})
}
</script>
<?php
}
?>
<?php
if ($_REQUEST['mac'] != 'Internet') {
?>
<h4 class=""><i class="fa-solid fa-magnifying-glass"></i> <?= lang('DevDetail_Tab_Tools_Nslookup_Title');?></h4>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="nslookup" class="btn btn-primary pa-btn" style="margin: auto;" onclick="nslookup()"><?= lang('DevDetail_Tab_Tools_Nslookup_Start');?></button>
<br><div id="nslookupoutput" style="margin-top: 10px;"></div>
</div>
<script>
function nslookup() {
$( "#nslookupoutput" ).empty();
$.ajax({
method: "GET",
url: "./php/server/nslookup.php?action=get&ip=" + document.getElementById('txtLastIP').value + "",
beforeSend: function() { $('#nslookupoutput').addClass("ajax_scripts_loading"); },
complete: function() { $('#nslookupoutput').removeClass("ajax_scripts_loading"); },
success: function(data, textStatus) {
$("#nslookupoutput").html(data);
}
})
}
</script>
<?php
}
?>
<?php
if ($_REQUEST['mac'] != 'Internet') {
?>
<h4 class=""><i class="fa-solid fa-binoculars"></i> <?= lang('DevDetail_Tab_Tools_Mtr_Title');?></h4>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="mtr" class="btn btn-primary pa-btn" style="margin: auto;" onclick="mtr()"><?= lang('DevDetail_Tab_Tools_Mtr_Start');?></button>
<br><div id="mtroutput" style="margin-top: 10px;"></div>
</div>
<script>
function mtr() {
$( "#mtroutput" ).empty();
$.ajax({
method: "GET",
url: "./php/server/mtr.php?action=get&ip=" + document.getElementById('txtLastIP').value + "",
beforeSend: function() { $('#mtroutput').addClass("ajax_scripts_loading"); },
complete: function() { $('#mtroutput').removeClass("ajax_scripts_loading"); },
success: function(data, textStatus) {
$("#mtroutput").html(data);
}
})
}
</script>
<?php
}
?>
<?php
if ($_REQUEST['mac'] != 'Internet') {
?>
<h4 class=""><i class="fa-solid fa-power-off"></i> <?= lang('DevDetail_Tab_Tools_WOL_Title');?></h4>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="wol" class="btn btn-primary pa-btn" style="margin: auto;" onclick="wol()"><?= lang('DevDetail_Tab_Tools_WOL_Start');?></button>
<br><div id="woloutput" style="margin-top: 10px;"></div>
</div>
<script>
function wol() {
$( "#woloutput" ).empty();
$.ajax({
method: "GET",
url: "./php/server/wol.php?action=get&mac=" + document.getElementById('txtMAC').value + "",
beforeSend: function() { $('#woloutput').addClass("ajax_scripts_loading"); },
complete: function() { $('#woloutput').removeClass("ajax_scripts_loading"); },
success: function(data, textStatus) {
$("#woloutput").html(data);
}
})
}
</script>
<?php
}
?>
</div>
<!-- ----------------------------------------------------------------------- -->
<!-- tab page 3 ------------------------------------------------------------ -->
<div class="tab-pane fade table-responsive" id="panPresence">
@@ -817,7 +652,7 @@
<div id="loading" style="display: none">
<div class="pa_semitransparent-panel"></div>
<div class="panel panel-default pa_spinner">
<table><td width="130px" align="middle"><?= lang("DevDetail_Loading");?></td><td><i class="ion ion-ios-loop-strong fa-spin fa-2x fa-fw"></td></table>
<table><td width="130px" align="middle">Loading...</td><td><i class="ion ion-ios-loop-strong fa-spin fa-2x fa-fw"></td></table>
</div>
</div>
@@ -1294,7 +1129,7 @@ function initializeDatatables () {
// Processing
'processing' : true,
'language' : {
processing: '<table><td width="130px" align="middle"><?= lang('DevDetail_Loading');?></td>'+
processing: '<table><td width="130px" align="middle">Loading...</td>'+
'<td><i class="ion ion-ios-loop-strong fa-spin fa-2x fa-fw">'+
'</td></table>',
emptyTable: 'No data',
@@ -1333,7 +1168,7 @@ function initializeDatatables () {
// Processing
'processing' : true,
'language' : {
processing: '<table><td width="130px" align="middle"><?= lang('DevDetail_Loading');?></td>'+
processing: '<table><td width="130px" align="middle">Loading...</td>'+
'<td><i class="ion ion-ios-loop-strong fa-spin fa-2x fa-fw">'+
'</td></table>',
emptyTable: 'No data',
@@ -2191,7 +2026,7 @@ function initTable(tableId, mac){
// Processing
'processing' : true,
'language' : {
processing: '<table><td width="130px" align="middle"><?= lang('DevDetail_Loading');?></td>'+
processing: '<table><td width="130px" align="middle">Loading...</td>'+
'<td><i class="ion ion-ios-loop-strong fa-spin fa-2x fa-fw">'+
'</td></table>',
emptyTable: 'No data',

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>";
?>

View File

@@ -116,32 +116,7 @@
"DevDetail_Shortcut_Presence" : "Anwesenheit",
"DevDetail_Shortcut_DownAlerts" : "Down Meldungen",
"DevDetail_Tab_Details" : "Details",
"DevDetail_Tab_Internet_Info_Title": "Internetinformationen",
"DevDetail_Tab_Internet_Info_Start": "Internet-Info starten",
"DevDetail_Tab_Internet_Info_Error": "Es ist ein Fehler aufgetreten",
"DevDetail_Tab_Internet_Speedtest_Title": "Online Speedtest",
"DevDetail_Tab_Internet_Speedtest_Start": "Speedtest starten",
"DevDetail_Tab_Internet_Speedtest_Error": "Ein Fehler ist aufgetreten",
"DevDetail_Tab_Tools": "<i class=\"fa fa-screwdriver-wrench\"></i> Tools",
"DevDetail_Tab_Tools_Mtr_Title": "Mtr",
"DevDetail_Tab_Tools_Mtr_Start": "Mtr starten",
"DevDetail_Tab_Tools_Mtr_Error": "Fehler: IP-Adresse ist ungültig",
"DevDetail_Tab_Tools_Nslookup_Title": "Nslookup",
"DevDetail_Tab_Tools_Nslookup_Start": "Nslookup starten",
"DevDetail_Tab_Tools_Nslookup_Error": "Fehler: IP-Adresse ist ungültig",
"DevDetail_Tab_Tools_Ping_Title": "Ping",
"DevDetail_Tab_Tools_Ping_Start": "Ping starten",
"DevDetail_Tab_Tools_Ping_Error": "Fehler: IP-Adresse ist ungültig",
"DevDetail_Tab_Tools_Traceroute_Title": "Traceroute",
"DevDetail_Tab_Tools_Traceroute_Start": "Traceroute starten",
"DevDetail_Tab_Tools_Traceroute_Error": "Fehler: IP-Adresse ist ungültig",
"DevDetail_Tab_Tools_WOL_Title": "Wake-on-LAN",
"DevDetail_Tab_Tools_WOL_Start": "Wake-on-LAN starten",
"DevDetail_Tab_Tools_WOL_Error": "Es ist ein Fehler aufgetreten",
"DevDetail_Tab_Tools_WOL_Error_MAC": "Fehler: MAC-Adresse ist ungültig",
"DevDetail_Tab_Tools_WOL_Error_Port": "Fehler: Port ist ungültig",
"DevDetail_Tab_Tools_WOL_Error_Password": "Fehler: Passwort ist ungültig",
"DevDetail_Tab_Tools_WOL_Message": "WOL-Paket gesendet",
"DevDetail_Tab_Nmap" : "Nmap",
"DevDetail_Tab_NmapTableIndex": "Index",
"DevDetail_Tab_NmapTableTime": "Zeit",
@@ -162,9 +137,10 @@
"DevDetail_Tab_PholusTableIP" : "IP",
"DevDetail_Tab_PholusTableEntry" : "Eintragstyp",
"DevDetail_Tab_PholusTableValue" : "Wert",
"DevDetail_Tab_PholusTableExtra" : "Extra",
"DevDetail_Loading" : "Laden ...",
"DevDetail_MainInfo_Title" : "Haupt Infos",
"DevDetail_Tab_PholusTableExtra" : "Extra",
"DevDetail_Internet_Speedtest" : "Online Speedtest",
"DevDetail_Internet_Speedtest_Start" : "Speedtest starten",
"DevDetail_MainInfo_Title" : "Haupt Infos",
"DevDetail_MainInfo_mac" : "MAC",
"DevDetail_MainInfo_Name" : "Name",
"DevDetail_MainInfo_Owner" : "Eigen-&shy;tümer",

View File

@@ -139,32 +139,7 @@
"DevDetail_Shortcut_Presence" : "Presence",
"DevDetail_Shortcut_DownAlerts" : "Down Alerts",
"DevDetail_Tab_Details" : "<i class=\"fa fa-info-circle\"></i> Details",
"DevDetail_Tab_Internet_Info_Title": "Internet Info",
"DevDetail_Tab_Internet_Info_Start": "Start Internet Info",
"DevDetail_Tab_Internet_Info_Error": "An error has occurred",
"DevDetail_Tab_Internet_Speedtest_Title" : "Online Speedtest",
"DevDetail_Tab_Internet_Speedtest_Start" : "Start Speedtest",
"DevDetail_Tab_Internet_Speedtest_Error" : "An error has occurred",
"DevDetail_Tab_Tools": "<i class=\"fa fa-screwdriver-wrench\"></i> Tools",
"DevDetail_Tab_Tools_Mtr_Title" : "Mtr",
"DevDetail_Tab_Tools_Mtr_Start" : "Start Mtr",
"DevDetail_Tab_Tools_Mtr_Error" : "Error: IP address is not valid",
"DevDetail_Tab_Tools_Nslookup_Title": "Nslookup",
"DevDetail_Tab_Tools_Nslookup_Start": "Start Nslookup",
"DevDetail_Tab_Tools_Nslookup_Error": "Error: IP address is not valid",
"DevDetail_Tab_Tools_Ping_Title": "Ping",
"DevDetail_Tab_Tools_Ping_Start": "Start Ping",
"DevDetail_Tab_Tools_Ping_Error": "Error: IP address is not valid",
"DevDetail_Tab_Tools_Traceroute_Title": "Traceroute",
"DevDetail_Tab_Tools_Traceroute_Start": "Start Traceroute",
"DevDetail_Tab_Tools_Traceroute_Error": "Error: IP address is not valid",
"DevDetail_Tab_Tools_WOL_Title" : "Wake-on-LAN",
"DevDetail_Tab_Tools_WOL_Start" : "Start Wake-on-LAN",
"DevDetail_Tab_Tools_WOL_Error" : "An error has occurred",
"DevDetail_Tab_Tools_WOL_Error_MAC" : "Error: MAC address is invalid",
"DevDetail_Tab_Tools_WOL_Error_Port" : "Error: Port is invalid",
"DevDetail_Tab_Tools_WOL_Error_Password" : "Error: Password is invalid",
"DevDetail_Tab_Tools_WOL_Message" : "WOL package sent",
"DevDetail_Tab_Tools": "<i class=\"fa fa-screwdriver-wrench\"></i> Tools",
"DevDetail_Tab_Nmap" : "<i class=\"fa fa-ethernet\"></i> Nmap",
"DevDetail_Tab_Sessions" : "<i class=\"fa fa-list-ol\"></i> Sessions",
"DevDetail_Tab_Presence" : "<i class=\"fa fa-calendar\"></i> Presence",
@@ -191,8 +166,7 @@
"DevDetail_Tab_NmapTablePort" : "Port",
"DevDetail_Tab_NmapTableState" : "State",
"DevDetail_Tab_NmapTableService" : "Service",
"DevDetail_Tab_NmapTableExtra" : "Extra",
"DevDetail_Loading" : "Loading...",
"DevDetail_Tab_NmapTableExtra" : "Extra",
"DevDetail_MainInfo_Title" : "<i class=\"fa fa-pencil\"></i> Main Info",
"DevDetail_MainInfo_mac" : "MAC",
"DevDetail_MainInfo_Name" : "Name",
@@ -201,7 +175,9 @@
"DevDetail_MainInfo_Type" : "Type",
"DevDetail_Type_hover" : "The Type of the device. If you select any of the pre-defined network devices (e.g.: AP, Firewall, Router, Switch...) they will show up in the Network tree configuration as possible parent network nodes.",
"DevDetail_Icon" : "Icon",
"DevDetail_Icon_Descr" : "Enter a font awesome icon name without the fa- prefix or with complete class, e.g.: fa fa-brands fa-apple.",
"DevDetail_Icon_Descr" : "Enter a font awesome icon name without the fa- prefix or with complete class, e.g.: fa fa-brands fa-apple.",
"DevDetail_Internet_Speedtest" : "Online Speedtest",
"DevDetail_Internet_Speedtest_Start" : "Start Speedtest",
"DevDetail_MainInfo_Vendor" : "Vendor",
"DevDetail_Vendor_hover" : "Vendor should be auto-detected. You can overwrite or add your custom value.",
"DevDetail_MainInfo_Favorite" : "Favorite",
@@ -260,7 +236,7 @@
"BackDevDetail_Actions_Not_Registered" : "Action not registered: ",
"BackDevDetail_Actions_Ask_Run" : "Do you want to execute the action?",
"BackDevDetail_Tools_WOL_okay" : "The command was executed.",
"BackDevDetail_Tools_WOL_error" : "The command was NOT executed.",
"BackDevDetail_Tools_WOL_error" : "The command was NOT executed.",
"DevDetail_Tools_WOL_noti" : "Wake-on-LAN",
"DevDetail_Tools_WOL_noti_text" : "The Wake-on-LAN command is sent to the broadcast address. If the target is not in the subnet/vlan of Pi.Alert, the target device will not respond.",
"DevDetail_Tools_WOL" : "Send Wol command to ",

View File

@@ -139,32 +139,7 @@
"DevDetail_Shortcut_Presence" : "Historial",
"DevDetail_Shortcut_DownAlerts" : "Alerta(s) de caída(s)",
"DevDetail_Tab_Details" : "<i class=\"fa fa-info-circle\"></i> Detalles",
"DevDetail_Tab_Internet_Info_Title": "Internet Info",
"DevDetail_Tab_Internet_Info_Start": "Iniciar Internet Info",
"DevDetail_Tab_Internet_Info_Error": "Se ha producido un error",
"DevDetail_Tab_Internet_Speedtest_Title": "Prueba de velocidad en línea",
"DevDetail_Tab_Internet_Speedtest_Start": "Iniciar prueba de velocidad",
"DevDetail_Tab_Internet_Speedtest_Error": "Se ha producido un error",
"DevDetail_Tab_Tools": "<i class=\"fa fa-screwdriver-wrench\"></i> Herramientas",
"DevDetail_Tab_Tools_Mtr_Title": "Mtr",
"DevDetail_Tab_Tools_Mtr_Start": "Iniciar Mtr",
"DevDetail_Tab_Tools_Mtr_Error": "Error: la dirección IP no es válida",
"DevDetail_Tab_Tools_Nslookup_Title": "Nslookup",
"DevDetail_Tab_Tools_Nslookup_Start": "Iniciar Nslookup",
"DevDetail_Tab_Tools_Nslookup_Error": "Error: la dirección IP no es válida",
"DevDetail_Tab_Tools_Ping_Title": "Ping",
"DevDetail_Tab_Tools_Ping_Start": "Iniciar Ping",
"DevDetail_Tab_Tools_Ping_Error": "Error: la dirección IP no es válida",
"DevDetail_Tab_Tools_Traceroute_Title": "Traceroute",
"DevDetail_Tab_Tools_Traceroute_Start": "Iniciar Traceroute",
"DevDetail_Tab_Tools_Traceroute_Error": "Error: la dirección IP no es válida",
"DevDetail_Tab_Tools_WOL_Title" : "Wake-on-LAN",
"DevDetail_Tab_Tools_WOL_Start" : "Iniciar Wake-on-LAN",
"DevDetail_Tab_Tools_WOL_Error" : "Se ha producido un error",
"DevDetail_Tab_Tools_WOL_Error_MAC" : "Error: la dirección MAC no es válida",
"DevDetail_Tab_Tools_WOL_Error_Port" : "Error: el puerto no es válido",
"DevDetail_Tab_Tools_WOL_Error_Password" : "Error: la contraseña no es válida",
"DevDetail_Tab_Tools_WOL_Message" : "Paquete WOL enviado",
"DevDetail_Tab_Tools": "<i class=\"fa fa-screwdriver-wrench\"></i> Herramientas",
"DevDetail_Tab_Nmap" : "<i class=\"fa fa-ethernet\"></i> Nmap",
"DevDetail_Tab_Sessions" : "<i class=\"fa fa-list-ol\"></i> Sesiones",
"DevDetail_Tab_Presence" : "<i class=\"fa fa-calendar\"></i> Historial",
@@ -191,14 +166,15 @@
"DevDetail_Tab_NmapTablePort": "Puerto",
"DevDetail_Tab_NmapTableState": "Estado",
"DevDetail_Tab_NmapTableService": "Servicio",
"DevDetail_Tab_NmapTableExtra": "Extra",
"DevDetail_Loading" : "Cargando ...",
"DevDetail_Tab_NmapTableExtra": "Extra",
"DevDetail_MainInfo_Title" : "<i class=\"fa fa-pencil\"></i> Información principal",
"DevDetail_MainInfo_mac" : "MAC",
"DevDetail_MainInfo_Name" : "Nombre",
"DevDetail_MainInfo_Owner" : "Propietario",
"DevDetail_MainInfo_Type" : "Tipo",
"DevDetail_Icon" : "Icono",
"DevDetail_Icon" : "Icono",
"DevDetail_Internet_Speedtest": "Prueba de velocidad en línea",
"DevDetail_Internet_Speedtest_Start": "Iniciar prueba de velocidad",
"DevDetail_Icon_Descr" : "Ingrese un nombre de icono de fuente awesome sin el prefijo fa- o con clase completa, por ejemplo: fa fa-skin fa-apple.",
"DevDetail_MainInfo_Vendor" : "Proveedor",
"DevDetail_MainInfo_Favorite" : "Favorito",
@@ -238,7 +214,7 @@
"DevDetail_SessionTable_Disconnection" : "Desconexión",
"DevDetail_SessionTable_Duration" : "Duración",
"DevDetail_SessionTable_IP" : "Dirección IP",
"DevDetail_SessionTable_Additionalinfo" : "Información adicional",
"DevDetail_SessionTable_Additionalinfo" : "Información adicional",
"DevDetail_Events_CheckBox" : "Ocultar eventos de conexión",
"DevDetail_Nmap_buttonFast" : "Exploración rápida",
"DevDetail_Nmap_buttonDefault" : "Escaneado predeterminado",