diff options
author | Minteck <minteck@phoenixnet.tech> | 2021-10-31 11:49:13 +0100 |
---|---|---|
committer | Minteck <minteck@phoenixnet.tech> | 2021-10-31 11:49:13 +0100 |
commit | e8e6a0906702dc7b569ef4f0b2d9486d772ba562 (patch) | |
tree | fb1361db2820ee7182c5023f6fa03237c8f46367 /statusbar.php | |
download | core-e8e6a0906702dc7b569ef4f0b2d9486d772ba562.tar.gz core-e8e6a0906702dc7b569ef4f0b2d9486d772ba562.tar.bz2 core-e8e6a0906702dc7b569ef4f0b2d9486d772ba562.zip |
Initial commit
Diffstat (limited to 'statusbar.php')
-rw-r--r-- | statusbar.php | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/statusbar.php b/statusbar.php new file mode 100644 index 0000000..ffb4ae9 --- /dev/null +++ b/statusbar.php @@ -0,0 +1,134 @@ +<?php + +if (isset($_COOKIE['FL_SESSION_TOKEN'])) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/private/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['FL_SESSION_TOKEN'])))) { + $_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/private/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['FL_SESSION_TOKEN']))), true); + + if (isset($_PROFILE['familine'])) { + header("Location: /login/embed"); + die(); + } + + $_USER = $_PROFILE['login']; + $_SUID = $_PROFILE['login']; + $_FULLNAME = $_PROFILE['name']; + } else { + header("Location: /login/embed"); + die(); + } +} else { + header("Location: /login/embed"); + die(); +} + +if (isset($_PROFILE["projectRoles"]) && is_array($_PROFILE["projectRoles"]) && isset($_PROFILE["projectRoles"][0]) && is_array($_PROFILE["projectRoles"][0]) && isset($_PROFILE["projectRoles"][0]["role"]) && is_array($_PROFILE["projectRoles"][0]["role"]) && isset($_PROFILE["projectRoles"][0]["role"]["key"]) && is_string($_PROFILE["projectRoles"][0]["role"]["key"]) && $_PROFILE["projectRoles"][0]["role"]["key"] === "system-admin") { + $_ADMIN = true; +} else { + $_ADMIN = false; +} + +?> + +<!DOCTYPE html> +<html> +<head> + <title>frame</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="icon" href="/favicon.svg"> + <link rel="stylesheet" href="/styles.css"> +</head> + +<body> + <style> + /* Statusbar */ + #statusbar { + background: whitesmoke; + padding: 8px 32px; + font-size: 14px; + z-index: 99; + position: fixed; + top: 0; + right: 0; + left: 0; + color: black; + } + + #statusbar-tag { + opacity: .5; + } + + .logo:hover { + background: rgba(0, 0, 0, .25); + } + + .logo:active { + background: rgba(0, 0, 0, .5); + } + + .logo { + cursor: pointer; + color: black; + } + + .account:hover { + background: rgba(0, 0, 0, .25); + } + + .account:active { + background: rgba(0, 0, 0, .5); + } + + .account { + cursor: pointer; + color: black; + } + + @media (prefers-color-scheme: dark) { + .account { + color: white; + } + + .logo { + color: white; + } + } + + @media (max-width: 800px) { + #apps-desktop { + display: none; + } + + #statusbar { + text-align: center; + } + } + + @media (max-width: 1100px) { + #copyright { + display: none; + } + } + </style> + <div id="statusbar"> + <a title="Accueil de Familine" href="https://familine.minteck.org" target="_parent"><span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 7px 7px 7px;margin: -11px 0;"><img src="https://familine.minteck.org/favicon.svg" style="width: 16px;vertical-align: middle;"> Familine</span></a> + <span style="opacity: .25;">|</span> + <span id="apps-desktop" <?= $_SERVER['HTTP_REFERER'] === "https://familine.minteck.org/" ? "style=\"display: none;\"" : "" ?>> + <a style="text-decoration: none;" title="Familine Docs" href="https://docs.familine.minteck.org" target="_parent"> + <?php if ($_ADMIN): ?><a style="text-decoration: none;" title="Familine Camera" href="https://console.familine.minteck.org" target="_parent"> + <span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 2px 7px 2px;margin: -11px 0;"><img src="https://familine.minteck.org/icns/familine-camera.svg" style="width: 20px;vertical-align: middle;"></span></a> + <?php endif; ?><span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 2px 7px 2px;margin: -11px 0;"><img src="https://familine.minteck.org/icns/familine-docs.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Help" href="https://support.familine.minteck.org" target="_parent"> + <span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 2px 7px 2px;margin: -11px 0;"><img src="https://familine.minteck.org/icns/familine-help.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Money" href="https://money.familine.minteck.org" target="_parent"> + <span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 2px 7px 2px;margin: -11px 0;"><img src="https://familine.minteck.org/icns/familine-money.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Movies" href="https://cinema.familine.minteck.org" target="_parent"> + <span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 2px 7px 2px;margin: -11px 0;"><img src="https://familine.minteck.org/icns/familine-movies.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Photos" href="https://photos.familine.minteck.org" target="_parent"> + <span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 2px 7px 2px;margin: -11px 0;"><img src="https://familine.minteck.org/icns/familine-photos.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Review" href="https://cloud.familine.minteck.org" target="_parent"> + <span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 2px 7px 2px;margin: -11px 0;"><img src="https://familine.minteck.org/icns/familine-review.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Share" href="https://share.familine.minteck.org" target="_parent"> + <span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 2px 7px 2px;margin: -11px 0;"><img src="https://familine.minteck.org/icns/familine-share.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Yikes" href="https://chat.familine.minteck.org" target="_parent"> + <span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 2px 7px 2px;margin: -11px 0;"><img src="https://familine.minteck.org/icns/familine-you.svg" style="width: 20px;vertical-align: middle;"></span></a> + <span style="opacity: .25;">|</span> + </span> + <a title="Mon compte" href="https://account.familine.minteck.org/hub/users/me" target="_parent"><span class="account" style="display: inline-block;top: 0;position: relative;padding: 8px 7px 7px 7px;margin: -11px 0;"><?= $_FULLNAME ?> <span id="statusbar-tag">@<?= $_USER ?></span></span></a> + <a id="copyright">version <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/version.txt") ?> · © 2020-<?= date('Y') ?> Familine</a> + </div> +</body> +</html>
\ No newline at end of file |