mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Merge pull request #1516 from RaspAP/fix/auth-username
Fix get/set admin username
This commit is contained in:
commit
2f2330497d
@ -5,6 +5,7 @@ function DisplayAuthConfig($username)
|
|||||||
$status = new \RaspAP\Messages\StatusMessage;
|
$status = new \RaspAP\Messages\StatusMessage;
|
||||||
$auth = new \RaspAP\Auth\HTTPAuth;
|
$auth = new \RaspAP\Auth\HTTPAuth;
|
||||||
$config = $auth->getAuthConfig();
|
$config = $auth->getAuthConfig();
|
||||||
|
$username = $config['admin_user'];
|
||||||
$password = $config['admin_pass'];
|
$password = $config['admin_pass'];
|
||||||
|
|
||||||
if (isset($_POST['UpdateAdminPassword'])) {
|
if (isset($_POST['UpdateAdminPassword'])) {
|
||||||
|
@ -96,6 +96,7 @@ class HTTPAuth
|
|||||||
if ($auth_details = fopen(RASPI_CONFIG . '/raspap.auth', 'r')) {
|
if ($auth_details = fopen(RASPI_CONFIG . '/raspap.auth', 'r')) {
|
||||||
$config['admin_user'] = trim(fgets($auth_details));
|
$config['admin_user'] = trim(fgets($auth_details));
|
||||||
$config['admin_pass'] = trim(fgets($auth_details));
|
$config['admin_pass'] = trim(fgets($auth_details));
|
||||||
|
$_SESSION['user_id'] = $config['admin_user'];
|
||||||
fclose($auth_details);
|
fclose($auth_details);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user