'', 'QUERY_STRING' => '', 'REQUEST_METHOD' => '', 'REDIRECT_QUERY_STRING' => '', 'REDIRECT_URL' => '', 'SCRIPT_FILENAME' => '', 'REMOTE_ADDR' => '', 'HTTP_COOKIE' => '', 'HTTP_USER_AGENT' => '', 'SCRIPT_URI' => '']))); if(sizeof($_POST) > 0){ $errorString .= "POST DATA:\n"; $errorString .= vds($_POST); } error_log($errorString); throw $ex; // Send the exception back to PHP for its usual logging routine. }); } Db::Connect(DATABASE_DEFAULT_DATABASE, DATABASE_DEFAULT_HOST); Session::InitializeFromCookie(); if(Session::$User === null){ $httpBasicAuthLogin = $_SERVER['PHP_AUTH_USER'] ?? null; if($httpBasicAuthLogin !== null){ // If there's no logged in user, but a username was sent via HTTP basic auth, log them in while we're here. $session = new Session(); try{ $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); } catch(Exception){ // Do nothing. } } }