Closed scyto closed 3 years ago
hmm i see index.php also has this, i am confused which file is doing the logon that said it still looks just a check if the file exists and is readable - right? it doesn't check to see if a username is set?
/**
* load the file containing user accounts, if readable
*/
if (is_file('config/users.php') && is_readable('config/users.php')) {
require_once('config/users.php');
$user_authentication = true;
} else {
$user_authentication = false;
error_log('The file config/users.php does not exist, proceeding without user authentication.');
}
Thanks for spotting this. The intent is for index.php
to determine whether we have enabled user auth or not, this doesn’t require including the users.php
file though. That line can be removed from the file and as you suggest a check should be added to verify whether the $users
array exists and isn’t empty.
I’ll check your PR and merge it or else modify the existing code as needed.
Actually the users.php
file needs to be included to allow checking the $users
array.
I've added the check with the next commit.
fixed
In users php it states:
I have been testing this with the following changes in my docker development environment
When the NOAPIBROWSERAUTH env var is set to 0 everything works ok. When the NOAPIBROWSERAUTH env var is set to 1 the login prompt is shown but one can't logon (because no username or password is set) As such i think this means my code is working.... but i am not a coder so not sure....
I am attempting this to service a request I got https://github.com/scyto/docker-UnifiBrowser/issues/5#issue-651082803
Questions
I don't need you to change any code, just trying to clarify vs bang my head against wall :-)