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/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/login.php b/templates/login.php index 57207245..ab8cfbd0 100755 --- a/templates/login.php +++ b/templates/login.php @@ -32,6 +32,7 @@
+ RaspAP docs