diff options
author | Scoots Dash <contact@minteck.org> | 2022-05-31 08:48:19 +0000 |
---|---|---|
committer | Scoots Dash <contact@minteck.org> | 2022-05-31 08:48:19 +0000 |
commit | 488edeef27df623e6e5b1da8c39ff0ad2e7c8d95 (patch) | |
tree | 115b1a6181b048a9e854fc0883a04d60117deb56 | |
parent | efa1a883df6aa15b60b40e211f0aa87e92e4e479 (diff) | |
download | core-488edeef27df623e6e5b1da8c39ff0ad2e7c8d95.tar.gz core-488edeef27df623e6e5b1da8c39ff0ad2e7c8d95.tar.bz2 core-488edeef27df623e6e5b1da8c39ff0ad2e7c8d95.zip |
Remove chat + bump version number
-rw-r--r-- | app/cdn/statusbar.php | 388 | ||||
-rw-r--r-- | index.php | 408 | ||||
-rw-r--r-- | version.txt | 2 |
3 files changed, 399 insertions, 399 deletions
diff --git a/app/cdn/statusbar.php b/app/cdn/statusbar.php index 42cef9d..787fcc1 100644 --- a/app/cdn/statusbar.php +++ b/app/cdn/statusbar.php @@ -1,194 +1,194 @@ -<?php
-
-global $_CONFIG;
-$_CONFIG = json_decode(file_get_contents("/mnt/familine/private/FamilineConfig.json"), true);
-
-if (isset($_COOKIE['FL_SESSION_TOKEN'])) {
- if (file_exists("/mnt/familine/private/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['FL_SESSION_TOKEN'])))) {
- $_PROFILE = json_decode(file_get_contents("/mnt/familine/private/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['FL_SESSION_TOKEN']))), true);
-
- if (isset($_PROFILE['familine'])) {
- header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"));
- die();
- }
-
- $_USER = $_PROFILE['login'];
- $_SUID = $_PROFILE['login'];
- $_FULLNAME = $_PROFILE['name'];
- } else {
- header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"));
- die();
- }
-} else {
- header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"));
- 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, #user-name {
- display: none;
- }
- }
-
- .statusbar-drag-region {
- -webkit-app-region: drag;
- }
-
- #statusbar-drag-region-01 {
- left: 348px;
- position: fixed;
- top: 0;
- /*background: rgba(255, 0, 0, 0.5);*/
- height: 36px;
- right: 70px;
- }
-
- #statusbar-drag-region-02 {
- left: 0;
- position: fixed;
- top: 0;
- /*background: rgba(255, 0, 0, 0.5);*/
- height: 36px;
- right: unset;
- width: 32px;
- }
-
- #statusbar-drag-region-03 {
- left: unset;
- position: fixed;
- top: 0;
- /*background: rgba(255, 0, 0, 0.5);*/
- height: 36px;
- right: 0;
- width: 32px;
- }
-
- #statusbar.desktop #statusbar-drag-region-01 {
- left: 118px;
- }
-
- @media (min-width: 1101px) {
- #statusbar-drag-region-01 {
- right: 154px;
- }
- }
- </style>
- <div id="statusbar">
- <div class="statusbar-drag-region" id="statusbar-drag-region-01"></div>
- <div class="statusbar-drag-region" id="statusbar-drag-region-02"></div>
- <div class="statusbar-drag-region" id="statusbar-drag-region-03"></div>
- <a title="Accueil de Familine" href="https://app.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent"><span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 7px 7px 7px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/favicon.svg" style="width: 16px;vertical-align: middle;position: relative;top: -2px;"> Familine</span></a>
- <span id="apps-desktop" <?= $_SERVER['HTTP_REFERER'] === "https://app." . $_CONFIG["Global"]["domain"] . "/" ? "style=\"display: none;\"" : "" ?>><span style="opacity: .25;">|</span><a style="text-decoration: none;" title="Familine Pages" href="https://docs.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent">
- <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-docs.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Aide" href="https://support.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent">
- <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-help.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Média" href="https://media.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent">
- <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-media.svg" style="width: 20px;vertical-align: middle;"></span></a><!--<a style="text-decoration: none;" title="Familine Planning" href="https://planning.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent">
- <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-planning.svg" style="width: 20px;vertical-align: middle;"></span></a>--><a style="text-decoration: none;" title="Familine Généalogie" href="https://genealogy.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent">
- <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-recall.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Partage" href="https://share.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent">
- <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-share.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Discussions" href="https://chat.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent">
- <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-you.svg" style="width: 20px;vertical-align: middle;"></span></a>
- </span>
- <div id="user">
- <a title="Mon compte" href="https://auth.<?= $_CONFIG["Global"]["domain"] ?>/auth/realms/Familine/account" target="_parent"><span class="account" style="display: inline-block;top: 0;position: relative;padding: 8px 7px 7px 7px;margin: -11px 0;">
- <span id="user-name" style="position: relative;margin-left:5px;top: 2.5px;right: 5px;"><?= $_FULLNAME ?></span>
- <img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/me" alt="" style="width:24px;border-radius:999px;vertical-align: middle;position:relative;top: 2px;">
- </span></a>
- </div>
- </div>
-
- <script>
- window.addEventListener('load', () => {
- if (navigator.userAgent.includes("+FL4D")) {
- console.log("Detected desktop app");
- document.getElementsByClassName("account")[0].parentElement.onclick = (e) => {
- e.preventDefault();
- open(document.getElementsByClassName("account")[0].parentElement.href);
- return false;
- };
- }
- })
- </script>
-</body>
-</html>
\ No newline at end of file +<?php + +global $_CONFIG; +$_CONFIG = json_decode(file_get_contents("/mnt/familine/private/FamilineConfig.json"), true); + +if (isset($_COOKIE['FL_SESSION_TOKEN'])) { + if (file_exists("/mnt/familine/private/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['FL_SESSION_TOKEN'])))) { + $_PROFILE = json_decode(file_get_contents("/mnt/familine/private/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['FL_SESSION_TOKEN']))), true); + + if (isset($_PROFILE['familine'])) { + header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]")); + die(); + } + + $_USER = $_PROFILE['login']; + $_SUID = $_PROFILE['login']; + $_FULLNAME = $_PROFILE['name']; + } else { + header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]")); + die(); + } +} else { + header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]")); + 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, #user-name { + display: none; + } + } + + .statusbar-drag-region { + -webkit-app-region: drag; + } + + #statusbar-drag-region-01 { + left: 348px; + position: fixed; + top: 0; + /*background: rgba(255, 0, 0, 0.5);*/ + height: 36px; + right: 70px; + } + + #statusbar-drag-region-02 { + left: 0; + position: fixed; + top: 0; + /*background: rgba(255, 0, 0, 0.5);*/ + height: 36px; + right: unset; + width: 32px; + } + + #statusbar-drag-region-03 { + left: unset; + position: fixed; + top: 0; + /*background: rgba(255, 0, 0, 0.5);*/ + height: 36px; + right: 0; + width: 32px; + } + + #statusbar.desktop #statusbar-drag-region-01 { + left: 118px; + } + + @media (min-width: 1101px) { + #statusbar-drag-region-01 { + right: 154px; + } + } + </style> + <div id="statusbar"> + <div class="statusbar-drag-region" id="statusbar-drag-region-01"></div> + <div class="statusbar-drag-region" id="statusbar-drag-region-02"></div> + <div class="statusbar-drag-region" id="statusbar-drag-region-03"></div> + <a title="Accueil de Familine" href="https://app.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent"><span class="logo" style="display: inline-block;top: 0;position: relative;padding: 8px 7px 7px 7px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/favicon.svg" style="width: 16px;vertical-align: middle;position: relative;top: -2px;"> Familine</span></a> + <span id="apps-desktop" <?= $_SERVER['HTTP_REFERER'] === "https://app." . $_CONFIG["Global"]["domain"] . "/" ? "style=\"display: none;\"" : "" ?>><span style="opacity: .25;">|</span><a style="text-decoration: none;" title="Familine Pages" href="https://docs.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent"> + <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-docs.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Aide" href="https://support.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent"> + <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-help.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Média" href="https://media.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent"> + <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-media.svg" style="width: 20px;vertical-align: middle;"></span></a><!--<a style="text-decoration: none;" title="Familine Planning" href="https://planning.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent"> + <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-planning.svg" style="width: 20px;vertical-align: middle;"></span></a>--><a style="text-decoration: none;" title="Familine Généalogie" href="https://genealogy.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent"> + <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-recall.svg" style="width: 20px;vertical-align: middle;"></span></a><a style="text-decoration: none;" title="Familine Partage" href="https://share.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent"> + <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-share.svg" style="width: 20px;vertical-align: middle;"></span></a><!--<a style="text-decoration: none;" title="Familine Discussions" href="https://chat.<?= $_CONFIG["Global"]["domain"] ?>" target="_parent"> + <span class="logo" style="display: inline-block;top: -2px;position: relative;padding: 6px 2px 7px 2px;margin: -11px 0;"><img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/icns/familine-you.svg" style="width: 20px;vertical-align: middle;"></span></a>--> + </span> + <div id="user"> + <a title="Mon compte" href="https://auth.<?= $_CONFIG["Global"]["domain"] ?>/auth/realms/Familine/account" target="_parent"><span class="account" style="display: inline-block;top: 0;position: relative;padding: 8px 7px 7px 7px;margin: -11px 0;"> + <span id="user-name" style="position: relative;margin-left:5px;top: 2.5px;right: 5px;"><?= $_FULLNAME ?></span> + <img src="https://<?= $_CONFIG["Global"]["cdn"] ?>/me" alt="" style="width:24px;border-radius:999px;vertical-align: middle;position:relative;top: 2px;"> + </span></a> + </div> + </div> + + <script> + window.addEventListener('load', () => { + if (navigator.userAgent.includes("+FL4D")) { + console.log("Detected desktop app"); + document.getElementsByClassName("account")[0].parentElement.onclick = (e) => { + e.preventDefault(); + open(document.getElementsByClassName("account")[0].parentElement.href); + return false; + }; + } + }) + </script> +</body> +</html> @@ -1,204 +1,204 @@ -<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/private/session.php";
-
-/** @var string $_FULLNAME
- * @var string $_USER
- * @var array $_PROFILE
- * @var boolean $_ADMIN
- * @var array $_CONFIG
- */
-
-?>
-
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Familine</title>
- <link rel="icon" href="https://<?= $_CONFIG["Global"]["cdn"] ?>/favicon.svg">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
- <?= strpos($_SERVER['HTTP_USER_AGENT'], "+Familine/") !== false ? '<link rel="stylesheet" href="/native.css">' : "" ?>
- <?= strpos($_SERVER['HTTP_USER_AGENT'], "+Familine/") !== false ? '<script>$ = require(\'jquery\');jQuery = require(\'jquery\');</script>' : '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>' ?>
- <link rel="stylesheet" href="https://<?= $_CONFIG["Global"]["cdn"] ?>/styles.css">
-</head>
-<body>
- <div class='progress' style="display:none;" id="progress_div">
- <div class='bar' id='bar1'></div>
- <div class='percent' id='percent1'></div>
- </div>
- <input type="hidden" id="progress_width" value="0">
- <script src="/js/loading.js"></script>
- <div id="loading">
- <img src="/loader.svg" style="filter:invert(1);width:96px;">
- </div>
-
- <div id="explore-outer" style="margin-top: -32px;height: max-content;">
- <div id="explore">
- <div>
- <img src="/favicon.svg" width="128px" height="128px">
- <h1 style="color:white !important;font-size: 48px;">Familine</h1>
- <p style="color:white !important;">Familine soutient la population ukrainienne. <a href="/ukraine" style="color:white;">En savoir plus.</a><br>
- <?php
-
- $list = array_reverse(scandir($_SERVER["DOCUMENT_ROOT"] . "/private/news"));
- foreach ($list as $paf) {
- if (str_ends_with($paf, ".json")) {
- $pa = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $paf), true);
- if ($pa["limited"] === null || in_array($_USER, $pa["limited"])) {
- $article = $paf;
- $data = $pa;
- break;
- }
- }
- }
-
- ?><a href="/news/<?= substr($article, 0, -5) ?>" style="color:white;">En ce moment : <?= $data["title"] ?></a></p>
- <div id="explore-list" class="container">
- <a href="https://docs.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn">
- <img src="/icns/familine-docs.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;">
- <span>Pages</span>
- <span class="explore-description">Une encyclopédie de toutes les personnes de la famille</span>
- </a>
- <a href="https://support.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn">
- <img src="/icns/familine-help.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;">
- <span>Aide</span>
- <span class="explore-description">Votre point d'accès à l'aide de Familine</span>
- </a>
- <a href="https://media.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn">
- <img src="/icns/familine-media.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;">
- <span>Média</span>
- <span class="explore-description">Musique, photos et vidéos de la famille au même endroit</span>
- </a>
-<!-- <a href="https://planning.--><?//= $_CONFIG["Global"]["domain"] ?><!--" class="explore-btn">-->
-<!-- <img src="/icns/familine-planning.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;">-->
-<!-- <span>Planning</span>-->
-<!-- <span class="explore-description">Gérez vos présences et absences aux événements de Familine</span>-->
-<!-- </a>-->
- <a href="https://genealogy.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn">
- <img src="/icns/familine-recall.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;">
- <span>Généalogie</span>
- <span class="explore-description">Un accès plus simple à la généalogie</span>
- </a>
- <a href="https://share.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn">
- <img src="/icns/familine-share.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;">
- <span>Partage</span>
- <span class="explore-description">Partagez des fichiers avec qui vous voulez</span>
- </a>
- <a href="https://chat.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn">
- <img src="/icns/familine-you.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;">
- <span>Discussions</span>
- <span class="explore-description">Communiquez de façon simple et sécurisée avec la famille</span>
- </a>
- </div>
- <div style="color: white;text-align: center;margin-top: 10px;opacity: .5;font-size: 14px;">
- <?php if ($_ADMIN): ?><a style="color:white;display:inline-block;" href="https://console.familine.minteck.org">Familine Camera</a> · <?php endif; ?><a style="color:white;display:inline-block;" href="https://app.familine.minteck.org/known">Problèmes connus</a> · <a target="_blank" style="color:white;display:inline-block;" href="https://gitlab.minteck.org/explore/projects/topics/Familine">Code source</a> · version <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/version.txt") ?>
- </div>
- <br>
- <br>
- <br>
- </div>
- </div>
- </div>
-
- <?php
-
- $icons = scandir($_SERVER['DOCUMENT_ROOT'] . "/icons");
- foreach ($icons as $icon) {
- if ($icon != "." && $icon != ".." && $icon != ".htaccess") {
- echo("<img src='/icons/{$icon}' style='opacity:0;pointer-events:none;width:0;'>");
- }
- }
-
- ?>
-
- <br>
- <div class="container">
- <h1><span id="home-greeting">Bienvenue</span> <?php $p = explode(" ", $_FULLNAME); array_shift($p); echo(implode(" ", $p)) ?></h1>
- <script>
- hours = new Date().getHours();
- switch (hours) {
- case 23:
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- document.getElementById("home-greeting").innerText = "Bonne nuit";
- break;
- case 5:
- case 6:
- case 7:
- document.getElementById("home-greeting").innerText = "Bon matin";
- break;
- case 8:
- case 9:
- case 10:
- case 11:
- document.getElementById("home-greeting").innerText = "Bonne journée";
- break;
- case 12:
- case 13:
- document.getElementById("home-greeting").innerText = "Bon appétit";
- break;
- case 14:
- case 15:
- case 16:
- case 17:
- document.getElementById("home-greeting").innerText = "Bonne après-midi";
- break;
- case 18:
- document.getElementById("home-greeting").innerText = "Bonne fin de journée";
- break;
- case 19:
- case 20:
- document.getElementById("home-greeting").innerText = "Bon appétit";
- break;
- case 21:
- case 22:
- document.getElementById("home-greeting").innerText = "Bonne soirée";
- break;
- }
- </script>
- <br>
- <?php foreach (array_reverse(scandir($_SERVER["DOCUMENT_ROOT"] . "/private/news")) as $article): if (str_ends_with($article, ".json")): ?>
- <?php $data = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $article), true); $html = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . substr($article, 0, -5) . ".html"); $summary = trim(explode("<!---->", $html)[0]); $full = trim($html); ?>
- <?php if ($data["limited"] === null || in_array($_USER, $data["limited"])): ?>
- <div class="jumbotron">
- <h5><?= $data["date"] ?></h5>
- <h3><?= $data["title"] ?></h3>
- <p><?= $summary ?></p>
- <a class="news-link" href="/news/<?= substr($article, 0, -5) ?>">En lire plus...</a>
- </div>
- <?php endif; endif; endforeach; ?>
-
- </div>
-
- <br>
-
- <script src="/js/iframe.js"></script>
- <script src="/js/navigation.js"></script>
- <script src="/js/statusbar.js"></script>
- <script>
- function openNews(news) {
- document.getElementById("news_internal-" + news + "-open").style.display = "none";
- document.getElementById("news_internal-" + news + "-close").style.display = "";
- document.getElementById("news_internal-" + news).open = true;
- }
-
- function closeNews(news) {
- document.getElementById("news_internal-" + news + "-close").style.display = "none";
- document.getElementById("news_internal-" + news + "-open").style.display = "";
- document.getElementById("news_internal-" + news).open = false;
- }
- </script>
- <style>
- summary { display: none; }
- </style>
-</body>
-</html>
+<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/private/session.php"; + +/** @var string $_FULLNAME + * @var string $_USER + * @var array $_PROFILE + * @var boolean $_ADMIN + * @var array $_CONFIG + */ + +?> + +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Familine</title> + <link rel="icon" href="https://<?= $_CONFIG["Global"]["cdn"] ?>/favicon.svg"> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> + <?= strpos($_SERVER['HTTP_USER_AGENT'], "+Familine/") !== false ? '<link rel="stylesheet" href="/native.css">' : "" ?> + <?= strpos($_SERVER['HTTP_USER_AGENT'], "+Familine/") !== false ? '<script>$ = require(\'jquery\');jQuery = require(\'jquery\');</script>' : '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>' ?> + <link rel="stylesheet" href="https://<?= $_CONFIG["Global"]["cdn"] ?>/styles.css"> +</head> +<body> + <div class='progress' style="display:none;" id="progress_div"> + <div class='bar' id='bar1'></div> + <div class='percent' id='percent1'></div> + </div> + <input type="hidden" id="progress_width" value="0"> + <script src="/js/loading.js"></script> + <div id="loading"> + <img src="/loader.svg" style="filter:invert(1);width:96px;"> + </div> + + <div id="explore-outer" style="margin-top: -32px;height: max-content;"> + <div id="explore"> + <div> + <img src="/favicon.svg" width="128px" height="128px"> + <h1 style="color:white !important;font-size: 48px;">Familine</h1> + <p style="color:white !important;">Familine soutient la population ukrainienne. <a href="/ukraine" style="color:white;">En savoir plus.</a><br> + <?php + + $list = array_reverse(scandir($_SERVER["DOCUMENT_ROOT"] . "/private/news")); + foreach ($list as $paf) { + if (str_ends_with($paf, ".json")) { + $pa = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $paf), true); + if ($pa["limited"] === null || in_array($_USER, $pa["limited"])) { + $article = $paf; + $data = $pa; + break; + } + } + } + + ?><a href="/news/<?= substr($article, 0, -5) ?>" style="color:white;">En ce moment : <?= $data["title"] ?></a></p> + <div id="explore-list" class="container"> + <a href="https://docs.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn"> + <img src="/icns/familine-docs.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;"> + <span>Pages</span> + <span class="explore-description">Une encyclopédie de toutes les personnes de la famille</span> + </a> + <a href="https://support.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn"> + <img src="/icns/familine-help.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;"> + <span>Aide</span> + <span class="explore-description">Votre point d'accès à l'aide de Familine</span> + </a> + <a href="https://media.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn"> + <img src="/icns/familine-media.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;"> + <span>Média</span> + <span class="explore-description">Musique, photos et vidéos de la famille au même endroit</span> + </a> +<!-- <a href="https://planning.--><?//= $_CONFIG["Global"]["domain"] ?><!--" class="explore-btn">--> +<!-- <img src="/icns/familine-planning.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;">--> +<!-- <span>Planning</span>--> +<!-- <span class="explore-description">Gérez vos présences et absences aux événements de Familine</span>--> +<!-- </a>--> + <a href="https://genealogy.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn"> + <img src="/icns/familine-recall.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;"> + <span>Généalogie</span> + <span class="explore-description">Un accès plus simple à la généalogie</span> + </a> + <a href="https://share.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn"> + <img src="/icns/familine-share.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;"> + <span>Partage</span> + <span class="explore-description">Partagez des fichiers avec qui vous voulez</span> + </a> + <!-- <a href="https://chat.<?= $_CONFIG["Global"]["domain"] ?>" class="explore-btn"> + <img src="/icns/familine-you.svg" width="48px" height="48px" style="height:32px;width:32px;margin: 0 5px;"> + <span>Discussions</span> + <span class="explore-description">Communiquez de façon simple et sécurisée avec la famille</span> + </a> --> + </div> + <div style="color: white;text-align: center;margin-top: 10px;opacity: .5;font-size: 14px;"> + <?php if ($_ADMIN): ?><a style="color:white;display:inline-block;" href="https://console.familine.minteck.org">Familine Camera</a> · <?php endif; ?><a style="color:white;display:inline-block;" href="https://app.familine.minteck.org/known">Problèmes connus</a> · <a target="_blank" style="color:white;display:inline-block;" href="https://gitlab.minteck.org/familine">Code source</a> · version <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/version.txt") ?> + </div> + <br> + <br> + <br> + </div> + </div> + </div> + + <?php + + $icons = scandir($_SERVER['DOCUMENT_ROOT'] . "/icons"); + foreach ($icons as $icon) { + if ($icon != "." && $icon != ".." && $icon != ".htaccess") { + echo("<img src='/icons/{$icon}' style='opacity:0;pointer-events:none;width:0;'>"); + } + } + + ?> + + <br> + <div class="container"> + <h1><span id="home-greeting">Bienvenue</span> <?php $p = explode(" ", $_FULLNAME); array_shift($p); echo(implode(" ", $p)) ?></h1> + <script> + hours = new Date().getHours(); + switch (hours) { + case 23: + case 0: + case 1: + case 2: + case 3: + case 4: + document.getElementById("home-greeting").innerText = "Bonne nuit"; + break; + case 5: + case 6: + case 7: + document.getElementById("home-greeting").innerText = "Bon matin"; + break; + case 8: + case 9: + case 10: + case 11: + document.getElementById("home-greeting").innerText = "Bonne journée"; + break; + case 12: + case 13: + document.getElementById("home-greeting").innerText = "Bon appétit"; + break; + case 14: + case 15: + case 16: + case 17: + document.getElementById("home-greeting").innerText = "Bonne après-midi"; + break; + case 18: + document.getElementById("home-greeting").innerText = "Bonne fin de journée"; + break; + case 19: + case 20: + document.getElementById("home-greeting").innerText = "Bon appétit"; + break; + case 21: + case 22: + document.getElementById("home-greeting").innerText = "Bonne soirée"; + break; + } + </script> + <br> + <?php foreach (array_reverse(scandir($_SERVER["DOCUMENT_ROOT"] . "/private/news")) as $article): if (str_ends_with($article, ".json")): ?> + <?php $data = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . $article), true); $html = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/private/news/" . substr($article, 0, -5) . ".html"); $summary = trim(explode("<!---->", $html)[0]); $full = trim($html); ?> + <?php if ($data["limited"] === null || in_array($_USER, $data["limited"])): ?> + <div class="jumbotron"> + <h5><?= $data["date"] ?></h5> + <h3><?= $data["title"] ?></h3> + <p><?= $summary ?></p> + <a class="news-link" href="/news/<?= substr($article, 0, -5) ?>">En lire plus...</a> + </div> + <?php endif; endif; endforeach; ?> + + </div> + + <br> + + <script src="/js/iframe.js"></script> + <script src="/js/navigation.js"></script> + <script src="/js/statusbar.js"></script> + <script> + function openNews(news) { + document.getElementById("news_internal-" + news + "-open").style.display = "none"; + document.getElementById("news_internal-" + news + "-close").style.display = ""; + document.getElementById("news_internal-" + news).open = true; + } + + function closeNews(news) { + document.getElementById("news_internal-" + news + "-close").style.display = "none"; + document.getElementById("news_internal-" + news + "-open").style.display = ""; + document.getElementById("news_internal-" + news).open = false; + } + </script> + <style> + summary { display: none; } + </style> +</body> +</html> diff --git a/version.txt b/version.txt index deef6e9..ba2d407 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -4.9.2 (accès anticipé) +4.9.4 (accès anticipé) |