From ba1369d842bbc4d2fe00bce552ba9da2cb37aabe Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 22 Dec 2018 21:26:57 -0700 Subject: [PATCH] Add app icon to login flow --- index.php | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 9e9468e..8f3b4b9 100644 --- a/index.php +++ b/index.php @@ -28,14 +28,30 @@ if (!empty($_GET['logout'])) {
+
+ +
+

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

@@ -79,13 +95,15 @@ if (empty($_SESSION["login_code"])) { if ($redirecttologin) { try { - $codedata = AccountHubApi::get("getloginkey", ["appname" => $SETTINGS["site_title"]]); + $urlbase = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . (($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) ? ":" . $_SERVER['SERVER_PORT'] : ""); + $iconurl = $urlbase . str_replace("index.php", "", $_SERVER["REQUEST_URI"]) . "static/img/logo.svg"; + $codedata = AccountHubApi::get("getloginkey", ["appname" => $SETTINGS["site_title"], "appicon" => $iconurl]); 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']; + $redirecturl = $urlbase . $_SERVER['REQUEST_URI']; $_SESSION["login_code"] = $codedata["code"];