Browse Source

Add app icon to login flow

master
Skylar Ittner 5 months ago
parent
commit
ba1369d842
1 changed files with 21 additions and 3 deletions
  1. 21
    3
      index.php

+ 21
- 3
index.php View File

@@ -28,14 +28,30 @@ if (!empty($_GET['logout'])) {
28 28
     <link href="static/css/svg-with-js.min.css" rel="stylesheet">
29 29
     <style nonce="<?php echo $SECURE_NONCE; ?>">
30 30
         .display-5 {
31
-            font-size: 3rem;
31
+            font-size: 2.5rem;
32 32
             font-weight: 300;
33 33
             line-height: 1.2;
34 34
         }
35
+
36
+        .banner-image {
37
+            max-height: 100px;
38
+            margin: 2em auto;
39
+            border: 1px solid grey;
40
+            border-radius: 15%;
41
+        }
42
+
43
+        .blank-image {
44
+            height: 100px;
45
+            margin: 2em auto;
46
+        }
35 47
     </style>
36 48
 
37 49
     <div class="container mt-4">
38 50
         <div class="row justify-content-center">
51
+            <div class="col-12 text-center">
52
+                <img class="banner-image" src="./static/img/logo.svg" />
53
+            </div>
54
+
39 55
             <div class="col-12 text-center">
40 56
                 <h1 class="display-5 mb-4"><?php $Strings->get("You have been logged out.") ?></h1>
41 57
             </div>
@@ -79,13 +95,15 @@ if (empty($_SESSION["login_code"])) {
79 95
 
80 96
 if ($redirecttologin) {
81 97
     try {
82
-        $codedata = AccountHubApi::get("getloginkey", ["appname" => $SETTINGS["site_title"]]);
98
+        $urlbase = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . (($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) ? ":" . $_SERVER['SERVER_PORT'] : "");
99
+        $iconurl = $urlbase . str_replace("index.php", "", $_SERVER["REQUEST_URI"]) . "static/img/logo.svg";
100
+        $codedata = AccountHubApi::get("getloginkey", ["appname" => $SETTINGS["site_title"], "appicon" => $iconurl]);
83 101
 
84 102
         if ($codedata['status'] != "OK") {
85 103
             throw new Exception($Strings->get("login server unavailable", false));
86 104
         }
87 105
 
88
-        $redirecturl = $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . (($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) ? ":" . $_SERVER['SERVER_PORT'] : "") . $_SERVER['REQUEST_URI'];
106
+        $redirecturl = $urlbase . $_SERVER['REQUEST_URI'];
89 107
 
90 108
         $_SESSION["login_code"] = $codedata["code"];
91 109
 

Loading…
Cancel
Save