From 3b635e0245acccfa8455e3fe100f77a08aee912d Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 10 Nov 2018 13:51:14 -0500 Subject: [PATCH 1/9] Move script tags inside html tag Fixes #863 Signed-off-by: Mcat12 --- auditlog.php | 5 +++-- db_graph.php | 8 ++++---- db_lists.php | 8 ++++---- db_queries.php | 7 +++---- debug.php | 5 ++--- gravity.php | 5 ++--- index.php | 5 +++-- list.php | 4 ++-- queries.php | 6 +++--- queryads.php | 5 ++--- settings.php | 8 ++++---- taillog-FTL.php | 5 ++--- taillog.php | 5 ++--- 13 files changed, 36 insertions(+), 40 deletions(-) diff --git a/auditlog.php b/auditlog.php index cb3db9af..86ebb685 100644 --- a/auditlog.php +++ b/auditlog.php @@ -82,8 +82,9 @@ + + + - - diff --git a/db_graph.php b/db_graph.php index 2642bf14..6bc207eb 100644 --- a/db_graph.php +++ b/db_graph.php @@ -62,10 +62,10 @@ $token = $_SESSION['token']; - - + + diff --git a/db_lists.php b/db_lists.php index c0e39408..64517548 100644 --- a/db_lists.php +++ b/db_lists.php @@ -138,10 +138,10 @@ else - - + + diff --git a/db_queries.php b/db_queries.php index ddb633f2..635d87ae 100644 --- a/db_queries.php +++ b/db_queries.php @@ -176,11 +176,10 @@ $token = $_SESSION['token']; + + + - - - - diff --git a/debug.php b/debug.php index 20ffa7c8..9840331f 100644 --- a/debug.php +++ b/debug.php @@ -17,9 +17,8 @@ + + - - - diff --git a/gravity.php b/gravity.php index 1b1bd3bb..d86be424 100644 --- a/gravity.php +++ b/gravity.php @@ -25,9 +25,8 @@ + + - - - diff --git a/index.php b/index.php index b2a66a4b..e090a445 100644 --- a/index.php +++ b/index.php @@ -348,8 +348,9 @@ else + + + - - diff --git a/list.php b/list.php index cc566e92..12eb5a86 100644 --- a/list.php +++ b/list.php @@ -71,8 +71,8 @@ function getFullName() { + + - - diff --git a/queries.php b/queries.php index 8e7133d0..51c543e6 100644 --- a/queries.php +++ b/queries.php @@ -165,9 +165,9 @@ if(strlen($showing) > 0) + + + - - - diff --git a/queryads.php b/queryads.php index 0fe5850c..3c14765b 100644 --- a/queryads.php +++ b/queryads.php @@ -23,9 +23,8 @@ + + - - - diff --git a/settings.php b/settings.php index 0b877114..749eafc7 100644 --- a/settings.php +++ b/settings.php @@ -1369,11 +1369,11 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists" - - + + diff --git a/taillog-FTL.php b/taillog-FTL.php index 53b454ad..fd40f223 100644 --- a/taillog-FTL.php +++ b/taillog-FTL.php @@ -16,9 +16,8 @@

 
+ + - - - diff --git a/taillog.php b/taillog.php index 895cba56..a03c45dc 100644 --- a/taillog.php +++ b/taillog.php @@ -16,9 +16,8 @@

 
+ + - - - From 500b3b774c399380771b66ed70a41f4e3fe3840e Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 10 Nov 2018 13:54:33 -0500 Subject: [PATCH 2/9] Move dependency scripts to header Signed-off-by: Mcat12 --- scripts/pi-hole/php/footer.php | 11 ----------- scripts/pi-hole/php/header.php | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/pi-hole/php/footer.php b/scripts/pi-hole/php/footer.php index 43cc2041..49af3c1e 100644 --- a/scripts/pi-hole/php/footer.php +++ b/scripts/pi-hole/php/footer.php @@ -66,16 +66,5 @@ - - - - - - - - - - - diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index ed5bf0ba..cec6a125 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -220,6 +220,18 @@ if($auth) { } ?> + + + + + + + + + + + + From 79c7c893acfbf0e35308d116655503b6780fe2c1 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 10 Nov 2018 13:55:37 -0500 Subject: [PATCH 3/9] Move footer script back to footer Signed-off-by: Mcat12 --- scripts/pi-hole/php/footer.php | 1 + scripts/pi-hole/php/header.php | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/pi-hole/php/footer.php b/scripts/pi-hole/php/footer.php index 49af3c1e..06687e99 100644 --- a/scripts/pi-hole/php/footer.php +++ b/scripts/pi-hole/php/footer.php @@ -66,5 +66,6 @@ + diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index cec6a125..c4c99e71 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -230,8 +230,6 @@ if($auth) { - - From 7cb989761bdc13dc1a76b4dab1ddaa3994a10d0b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 25 Nov 2018 08:58:27 +0100 Subject: [PATCH 4/9] Frontend changes for DHCPv4 rapid commit support Signed-off-by: DL6ER --- settings.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/settings.php b/settings.php index 0b877114..956eaf2f 100644 --- a/settings.php +++ b/settings.php @@ -340,6 +340,11 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists" } else { $DHCPIPv6 = false; } + if (isset($setupVars["DHCP_rapid_commit"])) { + $DHCP_rapid_commit = $setupVars["DHCP_rapid_commit"]; + } else { + $DHCP_rapid_commit = false; + } } else { $DHCP = false; @@ -356,6 +361,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists" } $DHCPleasetime = 24; $DHCPIPv6 = false; + $DHCP_rapid_commit = false; } if (isset($setupVars["PIHOLE_DOMAIN"])) { $piHoleDomain = $setupVars["PIHOLE_DOMAIN"]; @@ -475,6 +481,14 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists" ?>>Enable IPv6 support (SLAAC + RA) +
+
+ +
+
From 18f9ed4532b8c8b3427aa7249cd3b976ca1e8102 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 26 Nov 2018 19:12:08 +0100 Subject: [PATCH 5/9] Update savesettings.php Signed-off-by: DL6ER --- scripts/pi-hole/php/savesettings.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/savesettings.php b/scripts/pi-hole/php/savesettings.php index 6dc4587f..1940edef 100644 --- a/scripts/pi-hole/php/savesettings.php +++ b/scripts/pi-hole/php/savesettings.php @@ -635,9 +635,18 @@ function readAdlists() $type = "(IPv4)"; } + if(isset($_POST["DHCP_rapid_commit"])) + { + $rapidcommit = "true"; + } + else + { + $rapidcommit = "false"; + } + if(!strlen($error)) { - exec("sudo pihole -a enabledhcp ".$from." ".$to." ".$router." ".$leasetime." ".$domain." ".$ipv6); + exec("sudo pihole -a enabledhcp ".$from." ".$to." ".$router." ".$leasetime." ".$domain." ".$ipv6." ".$rapidcommit); $success .= "The DHCP server has been activated ".htmlspecialchars($type); } } From a10f23b79a5665f2d28445c50fc5157ed669b062 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 15 Jan 2019 17:17:34 +0100 Subject: [PATCH 6/9] Prevent multiple static DHCP entries for the same IP address to get added. Fixes #889 Signed-off-by: DL6ER --- scripts/pi-hole/php/savesettings.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/pi-hole/php/savesettings.php b/scripts/pi-hole/php/savesettings.php index a684038e..721c9430 100644 --- a/scripts/pi-hole/php/savesettings.php +++ b/scripts/pi-hole/php/savesettings.php @@ -558,6 +558,11 @@ function readAdlists() $error .= "Static release for MAC address (".htmlspecialchars($mac).") already defined!
"; break; } + if($ip !== "noip" && $lease["IP"] === $ip) + { + $error .= "Static release for IP address (".htmlspecialchars($ip).") already defined!
"; + break; + } } if(!strlen($error)) From 991be959d32c66291eb992e4c068d5001bfb84d2 Mon Sep 17 00:00:00 2001 From: Mark Drobnak Date: Sat, 19 Jan 2019 22:32:25 +0100 Subject: [PATCH 7/9] Update scripts/pi-hole/php/savesettings.php Co-Authored-By: DL6ER Signed-off-by: DL6ER --- scripts/pi-hole/php/savesettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/savesettings.php b/scripts/pi-hole/php/savesettings.php index 721c9430..9a0f5d11 100644 --- a/scripts/pi-hole/php/savesettings.php +++ b/scripts/pi-hole/php/savesettings.php @@ -560,7 +560,7 @@ function readAdlists() } if($ip !== "noip" && $lease["IP"] === $ip) { - $error .= "Static release for IP address (".htmlspecialchars($ip).") already defined!
"; + $error .= "Static lease for IP address (".htmlspecialchars($ip).") already defined!
"; break; } } From 8ae36a0dcb266e05f9b5240e905c7b1dd9e66b70 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 20 Jan 2019 11:36:39 +0100 Subject: [PATCH 8/9] Fill daterange field with initialization (now-6d -> now) Signed-off-by: DL6ER --- scripts/pi-hole/js/db_graph.js | 1 + scripts/pi-hole/js/db_lists.js | 1 + scripts/pi-hole/js/db_queries.js | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/pi-hole/js/db_graph.js b/scripts/pi-hole/js/db_graph.js index 8da24ad6..99436b7f 100644 --- a/scripts/pi-hole/js/db_graph.js +++ b/scripts/pi-hole/js/db_graph.js @@ -21,6 +21,7 @@ $(function () { { timePicker: true, timePickerIncrement: 15, locale: { format: "MMMM Do YYYY, HH:mm" }, + startDate: start__, endDate: end__, ranges: { "Today": [moment().startOf("day"), moment()], "Yesterday": [moment().subtract(1, "days").startOf("day"), moment().subtract(1, "days").endOf("day")], diff --git a/scripts/pi-hole/js/db_lists.js b/scripts/pi-hole/js/db_lists.js index e867b6bc..735d4384 100644 --- a/scripts/pi-hole/js/db_lists.js +++ b/scripts/pi-hole/js/db_lists.js @@ -22,6 +22,7 @@ $(function () { { timePicker: true, timePickerIncrement: 15, locale: { format: "MMMM Do YYYY, HH:mm" }, + startDate: start__, endDate: end__, ranges: { "Today": [moment().startOf("day"), moment()], "Yesterday": [moment().subtract(1, "days").startOf("day"), moment().subtract(1, "days").endOf("day")], diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js index f50d9802..b38356ae 100644 --- a/scripts/pi-hole/js/db_queries.js +++ b/scripts/pi-hole/js/db_queries.js @@ -36,6 +36,7 @@ $(function () { { timePicker: true, timePickerIncrement: 15, locale: { format: "MMMM Do YYYY, HH:mm" }, + startDate: start__, endDate: end__, ranges: { "Today": [moment().startOf("day"), moment()], "Yesterday": [moment().subtract(1, "days").startOf("day"), moment().subtract(1, "days").endOf("day")], From f19a538e7fc79fbd212ef1f4663332033d04f248 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 26 Jan 2019 13:11:08 -0800 Subject: [PATCH 9/9] Clarify wording of DNSSEC Unknown status Previously, unknown DNSSEC status was marked with a question mark. FTL loads queries from the database and sets the DNSSEC status to unknown, because that information is not stored in the database: https://github.com/pi-hole/FTL/pull/461 Signed-off-by: Mcat12 --- scripts/pi-hole/js/queries.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index dafa4ac3..f36e76e1 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -170,7 +170,7 @@ $(document).ready(function() { dnssec_status = "
ABANDONED"; break; case "5": - dnssec_status = "
?"; + dnssec_status = "
UNKNOWN"; break; default: // No DNSSEC dnssec_status = "";