get("You have been logged out.") ?>

$_SESSION["login_code"]]); if ($uidinfo["status"] == "ERROR") { throw new Exception(); } if (is_numeric($uidinfo['uid'])) { $user = new User($uidinfo['uid'] * 1); Session::start($user); $_SESSION["login_code"] = null; header('Location: app.php'); die("Logged in, go to app.php"); } else { throw new Exception(); } } catch (Exception $ex) { $redirecttologin = true; } } if ($redirecttologin) { try { $codedata = AccountHubApi::get("getloginkey", ["appname" => $SETTINGS["site_title"]]); if ($codedata['status'] != "OK") { throw new Exception($Strings->get("login server unavailable", false)); } $redirecturl = $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . (($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) ? ":" . $_SERVER['SERVER_PORT'] : "") . $_SERVER['REQUEST_URI']; $_SESSION["login_code"] = $codedata["code"]; header("Location: " . $codedata["loginurl"] . "?code=" . htmlentities($codedata["code"]) . "&redirect=" . htmlentities($redirecturl)); } catch (Exception $ex) { sendError($ex->getMessage()); } }