Merge pull request #1516 from RaspAP/fix/auth-username

Fix get/set admin username
This commit is contained in:
Bill Zimmerman 2024-02-08 09:53:52 +01:00 committed by GitHub
commit 2f2330497d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -5,6 +5,7 @@ function DisplayAuthConfig($username)
$status = new \RaspAP\Messages\StatusMessage;
$auth = new \RaspAP\Auth\HTTPAuth;
$config = $auth->getAuthConfig();
$username = $config['admin_user'];
$password = $config['admin_pass'];
if (isset($_POST['UpdateAdminPassword'])) {

View file

@ -96,6 +96,7 @@ 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);
}
}