getUser(); header("Location: https://" . $_SERVER['HTTP_HOST'] . "/"); exit; } catch (\Exception $e) { include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "header.php"))); echo "

$charity

\n"; echo "

Not logged in!

\n"; echo "

There was an authentication error.

\n"; include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "footer.php"))); } } $auth0_user = $auth0->getUser(); if (isset($auth0_user)) $username = $auth0_user["sub"]; else $username = null; include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "header.php"))); if ($username) { $q = new UserQuery; $user = $q->findOneByUsername($username); if (! $q->count()) { echo "

$charity

\n"; echo "

Not logged in!

\n"; echo "

User $username needs an entry in the user table.

\n"; } else { $user_id = $user->getContactId(); $admin_level = $user->getAdmin(); if ($module) { echo "

$charity $module

\n"; include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "$module.php"))); } #else include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "menu.php"))); } } else $auth0->login(); include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "footer.php"))); ?>