Skip to content

Commit

Permalink
Merge pull request #1516 from RaspAP/fix/auth-username
Browse files Browse the repository at this point in the history
Fix get/set admin username
  • Loading branch information
billz committed Feb 8, 2024
2 parents 56b9ff5 + cd7820d commit 2f23304
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions includes/admin.php
Expand Up @@ -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'])) {
Expand Down
1 change: 1 addition & 0 deletions src/RaspAP/Auth/HTTPAuth.php
Expand Up @@ -96,6 +96,7 @@ public function getAuthConfig()
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);
}
}
Expand Down

0 comments on commit 2f23304

Please sign in to comment.