Add password login option for some users, and further refinements to artwork management system

This commit is contained in:
Alex Cabal 2024-01-06 19:10:52 -06:00
parent 8a1b11b815
commit 5a1c05d8c5
22 changed files with 234 additions and 150 deletions

View file

@ -38,7 +38,14 @@ if($GLOBALS['User'] === null){
$session = new Session();
try{
$session->Create($httpBasicAuthLogin);
$password = $_SERVER['PHP_AUTH_PW'] ?? null;
if($password == ''){
$password = null;
}
// Most patrons have a null password, meaning they only need to log in using an email and a blank password.
// Some users with admin rights need a password to log in.
$session->Create($httpBasicAuthLogin, $password);
$GLOBALS['User'] = $session->User;
}
catch(Exception){