From ae44f5476d19a8e815f27b2d370da8c1caf9c338 Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 24 Feb 2024 10:23:58 +0100 Subject: [PATCH] Update user_id session var auth context --- includes/admin.php | 1 + src/RaspAP/Auth/HTTPAuth.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin.php b/includes/admin.php index b3be3c36..95f2b26c 100755 --- a/includes/admin.php +++ b/includes/admin.php @@ -26,6 +26,7 @@ function DisplayAuthConfig($username) fwrite($auth_file, password_hash($_POST['newpass'], PASSWORD_BCRYPT).PHP_EOL); fclose($auth_file); $username = $new_username; + $_SESSION['user_id'] = $username; $status->addMessage('Admin password updated'); } else { $status->addMessage('Failed to update admin password', 'danger'); diff --git a/src/RaspAP/Auth/HTTPAuth.php b/src/RaspAP/Auth/HTTPAuth.php index 7c31e0f9..9751075f 100755 --- a/src/RaspAP/Auth/HTTPAuth.php +++ b/src/RaspAP/Auth/HTTPAuth.php @@ -96,7 +96,6 @@ class HTTPAuth if ($auth_details = fopen(RASPI_CONFIG . '/raspap.auth', 'r')) { $config['admin_user'] = trim(fgets($auth_details)); $config['admin_pass'] = trim(fgets($auth_details)); - $_SESSION['user_id'] = $config['admin_user']; fclose($auth_details); } }