Fixed up a whole bunch of undefined variable warnings. Added a check to make sure raspap.auth exists before trying to include it.

This commit is contained in:
Lawrence
2017-10-02 03:10:04 +08:00
parent a6b1d85013
commit 61d450d1c7
5 changed files with 23 additions and 13 deletions

View File

@@ -5,10 +5,11 @@ $config = array(
'admin_pass' => '$2y$10$YKIyWAmnQLtiJAy6QgHQ.eCpY4m.HCEbiHaTgN6.acNC6bDElzt.i'
);
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);
}
}
?>