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 { 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 @@ +addMessage('Old password does not match', 'danger'); } + } elseif (isset($_POST['logout'])) { + $auth->logout(); } echo renderTemplate( diff --git a/includes/dashboard.php b/includes/dashboard.php index 27595423..099fbb2a 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; @@ -125,6 +125,7 @@ function DisplayDashboard(): void "status" ) ); + $extraFooterScripts[] = array('src'=>'app/js/dashboardchart.js', 'defer'=>false); } /** 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 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 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 @@
- " /> +
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(); ?> +
+ -
- + + -
- - -
-
+ +
+ + +
-
- - -
-
+ + +
-
-
- - -
- - -
-
-
-
-
-
-
-
- - -
-
-
+ 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); ?> +
+
:
+
:
+
:
+
:
+
+ +
+ + +
+ + +
+
+ +
+ + +
+
+ +
+
+ + +
+ + +
+
+
+ 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