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)"/> + + +