From 33aa95dadac2747fdda7b00f1651cbf2ecd09ab7 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 8 Jun 2022 15:40:53 +0200 Subject: Fix 2 --- .idea/workspace.xml | 69 ++++++++++++++++++++++++++++++++++++++++++++-- private/session-noconf.php | 11 ++++++++ private/session.php | 2 +- version.txt | 2 +- 4 files changed, 80 insertions(+), 4 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 41e9a9b..b6b250d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,7 +1,71 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/private/session-noconf.php b/private/session-noconf.php index 37ff9e7..844a640 100644 --- a/private/session-noconf.php +++ b/private/session-noconf.php @@ -21,6 +21,7 @@ if ($_SERVER['REMOTE_ADDR'] !== "127.0.0.1" && $_SERVER['REMOTE_ADDR'] !== "::0" $_USER = $_PROFILE['login']; $_SUID = $_PROFILE['login']; $_FULLNAME = $_PROFILE['name']; + $_FRENCH = $_PROFILE['profile']['locale']['name'] === "fr"; } else { header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]")); die(); @@ -37,3 +38,13 @@ if (isset($_PROFILE["projectRoles"]) && is_array($_PROFILE["projectRoles"]) && i } else { $_ADMIN = false; } + +function l($fr, $en) { + global $_FRENCH; + + if ($_FRENCH) { + return $fr; + } else { + return $en; + } +} \ No newline at end of file diff --git a/private/session.php b/private/session.php index e9a2370..bea80ed 100644 --- a/private/session.php +++ b/private/session.php @@ -26,7 +26,7 @@ if (isset($_COOKIE['FL_SESSION_TOKEN'])) { $_USER = $_PROFILE['login']; $_SUID = $_PROFILE['login']; $_FULLNAME = $_PROFILE['name']; - $_FRENCH = $_PROFILE['locale']['name'] === "fr"; + $_FRENCH = $_PROFILE['profile']['locale']['name'] === "fr"; if (!in_array($_USER, $_WELCOMED)) { header("Location: /welcome/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]")); diff --git a/version.txt b/version.txt index dd134ed..9fe1978 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -4.10.3 (%ea%) \ No newline at end of file +4.10.4b (%ea%) \ No newline at end of file -- cgit