mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Wrap auth with getConfig(), thx @mp035
This commit is contained in:
23
raspap.php
23
raspap.php
@@ -1,14 +1,19 @@
|
||||
<?php
|
||||
|
||||
$config = array(
|
||||
'admin_user' => 'admin',
|
||||
'admin_pass' => '$2y$10$YKIyWAmnQLtiJAy6QgHQ.eCpY4m.HCEbiHaTgN6.acNC6bDElzt.i'
|
||||
);
|
||||
function getConfig()
|
||||
{
|
||||
$config = array(
|
||||
'admin_user' => 'admin',
|
||||
'admin_pass' => '$2y$10$YKIyWAmnQLtiJAy6QgHQ.eCpY4m.HCEbiHaTgN6.acNC6bDElzt.i'
|
||||
);
|
||||
|
||||
if (file_exists(RASPI_CONFIG.'/raspap.auth')) {
|
||||
if ($auth_details = fopen(RASPI_CONFIG.'/raspap.auth', 'r')) {
|
||||
$config['admin_user'] = trim(fgets($auth_details));
|
||||
$config['admin_pass'] = trim(fgets($auth_details));
|
||||
fclose($auth_details);
|
||||
if (file_exists(RASPI_CONFIG . '/raspap.auth')) {
|
||||
if ($auth_details = fopen(RASPI_CONFIG . '/raspap.auth', 'r')) {
|
||||
$config['admin_user'] = trim(fgets($auth_details));
|
||||
$config['admin_pass'] = trim(fgets($auth_details));
|
||||
fclose($auth_details);
|
||||
}
|
||||
}
|
||||
return $config;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user