From 401172eb368220acfcf7503b0ea535191f765bb8 Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 22 Mar 2025 03:11:03 -0700 Subject: [PATCH 01/11] Initial commit --- app/img/uri-qr-code.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 app/img/uri-qr-code.php diff --git a/app/img/uri-qr-code.php b/app/img/uri-qr-code.php new file mode 100755 index 00000000..41124dfb --- /dev/null +++ b/app/img/uri-qr-code.php @@ -0,0 +1,29 @@ + Date: Sat, 22 Mar 2025 03:11:47 -0700 Subject: [PATCH 02/11] Update w/ logout() method --- src/RaspAP/Auth/HTTPAuth.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/RaspAP/Auth/HTTPAuth.php b/src/RaspAP/Auth/HTTPAuth.php index d32a36ad..a28f9212 100755 --- a/src/RaspAP/Auth/HTTPAuth.php +++ b/src/RaspAP/Auth/HTTPAuth.php @@ -74,6 +74,20 @@ class HTTPAuth return false; } + /* + * Logs out the administrative user + */ + public function logout(): void + { + session_unset(); // unset all session variables + session_destroy(); // destroy the session + $redirectUrl = $_SERVER['REQUEST_URI']; + if (strpos($redirectUrl, '/login') === false) { + header('Location: /login?action=' . urlencode($redirectUrl)); + exit(); + } + } + /* * Gets the current authentication config * return array $config From 05e20e3bab8e92dd6b19d8a72f31cf5249ce5ced Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 22 Mar 2025 03:12:09 -0700 Subject: [PATCH 03/11] Handle logout action --- includes/admin.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/admin.php b/includes/admin.php index 95f2b26c..61dd21ed 100755 --- a/includes/admin.php +++ b/includes/admin.php @@ -35,6 +35,8 @@ function DisplayAuthConfig($username) } else { $status->addMessage('Old password does not match', 'danger'); } + } elseif (isset($_POST['logout'])) { + $auth->logout(); } echo renderTemplate( From 51a0ce220cf4f6a864c1d11c7ed83a0f820f5c2f Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 22 Mar 2025 03:12:46 -0700 Subject: [PATCH 04/11] Update w/ disableValidation() to support logout btn --- app/js/custom.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/js/custom.js b/app/js/custom.js index 7d9e92e9..7b036913 100644 --- a/app/js/custom.js +++ b/app/js/custom.js @@ -1019,6 +1019,14 @@ document.addEventListener("DOMContentLoaded", function () { } }); +function disableValidation(form) { + form.removeAttribute("novalidate"); + form.classList.remove("needs-validation"); + form.querySelectorAll("[required]").forEach(function (field) { + field.removeAttribute("required"); + }); +} + $(document).ready(function() { const $htmlElement = $('html'); const $modeswitch = $('#night-mode'); From 3e54b1d7bb952e1d86d4d8d2eef87926fc4caa52 Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 22 Mar 2025 03:14:11 -0700 Subject: [PATCH 05/11] Remove authentication sidebar item (redundant) --- src/RaspAP/UI/Sidebar.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/RaspAP/UI/Sidebar.php b/src/RaspAP/UI/Sidebar.php index 8d79f9de..fe819987 100644 --- a/src/RaspAP/UI/Sidebar.php +++ b/src/RaspAP/UI/Sidebar.php @@ -39,9 +39,6 @@ class Sidebar { ); $this->addItem(_(getProviderValue($_SESSION["providerID"], "name")), 'fas fa-shield-alt', 'provider_conf', 90, fn() => RASPI_VPN_PROVIDER_ENABLED - ); - $this->addItem(_('Authentication'), 'fas fa-user-lock', 'auth_conf', 100, - fn() => RASPI_CONFAUTH_ENABLED ); $this->addItem(_('Data usage'), 'fas fa-chart-area', 'data_use', 110, fn() => RASPI_VNSTAT_ENABLED From af2927f05b8a2f0007f534d7f2d45c5dae09cad2 Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 22 Mar 2025 03:16:53 -0700 Subject: [PATCH 06/11] Update w/ qr code doc link --- templates/login.php | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/login.php b/templates/login.php index 57207245..ab8cfbd0 100755 --- a/templates/login.php +++ b/templates/login.php @@ -32,6 +32,7 @@
+ RaspAP docs From 734043dee68709da6c242ecc48df4d5592e8da52 Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 22 Mar 2025 03:17:23 -0700 Subject: [PATCH 07/11] Define button object, add logout btn --- templates/admin.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/templates/admin.php b/templates/admin.php index e8a34cd7..c528e781 100755 --- a/templates/admin.php +++ b/templates/admin.php @@ -1,10 +1,17 @@ + + + " /> + " onclick="disableValidation(this.form)"/> + + +
-
- +
+
@@ -58,7 +65,7 @@
- " /> +
From 85663341ebb7cba0039a3bb8fc666726d19f6341 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 23 Mar 2025 00:26:48 -0700 Subject: [PATCH 08/11] Initial commit --- templates/dashboard/data.php | 19 +++++ templates/dashboard/status.php | 123 +++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 templates/dashboard/data.php create mode 100644 templates/dashboard/status.php diff --git a/templates/dashboard/data.php b/templates/dashboard/data.php new file mode 100644 index 00000000..bac508e6 --- /dev/null +++ b/templates/dashboard/data.php @@ -0,0 +1,19 @@ +
+

+ +

+ +
+
+ +
+
+ +
+ + diff --git a/templates/dashboard/status.php b/templates/dashboard/status.php new file mode 100644 index 00000000..5fc77913 --- /dev/null +++ b/templates/dashboard/status.php @@ -0,0 +1,123 @@ +
+

+ +

+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + Network connection +
+
+
+ <?php echo htmlspecialchars($revision, ENT_QUOTES); ?> +
+
:
+
:
+
:
+
:
+
+ +
+ + +
+ + +
+
+ +
+ + +
+
+ +
+
+ + +
+ + +
+
+
+ From 4d0de82986d725fadb511c80b08fd46328d11eb8 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 23 Mar 2025 00:27:39 -0700 Subject: [PATCH 09/11] Add &$extraFooterScripts to support data usage graph --- includes/dashboard.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/dashboard.php b/includes/dashboard.php index 3e1b3e14..c6857b21 100755 --- a/includes/dashboard.php +++ b/includes/dashboard.php @@ -7,7 +7,7 @@ require_once 'includes/functions.php'; /** * Displays the dashboard */ -function DisplayDashboard(): void +function DisplayDashboard(&$extraFooterScripts): void { // instantiate RaspAP objects $system = new \RaspAP\System\Sysinfo; @@ -123,6 +123,7 @@ function DisplayDashboard(): void "status" ) ); + $extraFooterScripts[] = array('src'=>'app/js/dashboardchart.js', 'defer'=>false); } /** From 483b1fc27d505e19f0c890dedebe8de1adf628aa Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 23 Mar 2025 00:28:31 -0700 Subject: [PATCH 10/11] Split single template into tabs --- templates/dashboard.php | 167 +++++++--------------------------------- 1 file changed, 26 insertions(+), 141 deletions(-) diff --git a/templates/dashboard.php b/templates/dashboard.php index b4c34cda..394dcbf6 100755 --- a/templates/dashboard.php +++ b/templates/dashboard.php @@ -1,12 +1,12 @@ - - - " name="ifup_wlan0" /> - - " name="ifdown_wlan0" /> - + + + " name="ifup_wlan0" /> + + " name="ifdown_wlan0" /> - -
-
-
- showMessages(); ?> -

- -

-
-
-
- - -
-
- - -
-
- - -
-
- - -
- - Network connection -
-
-
- <?php echo htmlspecialchars($revision, ENT_QUOTES); ?> -
-
:
-
:
-
:
-
:
-
+
+ showMessages(); ?> +
+ -
- + + -
- - -
-
+ +
+ + +
-
- - -
-
+ + +
-
-
- - -
- - -
-
-
-
-
-
-
-
- - -
-
-
+ From a24516a4d5f75ff6dfff88cabc79f5205fce567a Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 23 Mar 2025 00:33:27 -0700 Subject: [PATCH 11/11] Tweak divDBChartBandwidthhourly --- app/css/all.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/css/all.css b/app/css/all.css index d95c8390..b42a34e2 100644 --- a/app/css/all.css +++ b/app/css/all.css @@ -169,7 +169,7 @@ th { } canvas#divDBChartBandwidthhourly { - height: 350px!important; + height: 509px!important; } .dbChart {