function getSessionUser() { $user = NULL; //start session if it isn't already if (session_status() == PHP_SESSION_NONE) { session_start(); } // if (isset($_SESSION['FFuser'])) { $user = unserialize($_SESSION['FFuser']); if (FALSE == $user) { die("utilities.getSessionUser: session user is invalid"); } } else { $user = addGuestUserToSession(); } if (NULL == $user) { die("utilities.getSessionUser: Having a really hard time setting a user!"); } else { return $user; } }
$config = new Configuration($configArray['realConfigFile']); $config->SaveInSession(); $action = isset($_GET["action"]) ? $_GET["action"] : ''; $user = NULL; switch ($action) { case 'onSite': $_SESSION['location'] = $action; if (!isset($_SESSION['FFuser'])) { addGuestUserToSession(); } header('Location: entryTracker.php'); break; case 'atHome': $_SESSION['location'] = $action; if (!isset($_SESSION['FFuser'])) { addGuestUserToSession(); } header('Location: entryTracker.php'); break; case 'register': $userManager = new UserManager(); $roles = $userManager->getAllRoles(); $user = new User(); include '../views/userRegister.view.php'; break; case 'register_user': $error = registerUser(); header("Location: index.php?msg={$error}"); break; case 'login': unset($_SESSION['FFuser']);