From a46bff52a39e04f63cd16602e461d791fa48b922 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 4 Jun 2022 16:20:25 +0200 Subject: Yes I fucked up --- .idea/workspace.xml | 20 ++++++++++++-------- app/session.php | 10 ++++++++++ private/session.php | 12 +++++++++++- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b40ebdf..baae3dc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -61,6 +61,8 @@ + + - @@ -104,14 +106,14 @@ - { + "keyToString": { + "WebServerToolWindowFactoryState": "true", + "last_opened_file_path": "/Users/Scoots/Code/Familine/private/news", + "nodejs_package_manager_path": "npm", + "vue.rearranger.settings.migration": "true" } -}]]> +} @@ -166,6 +168,8 @@ + + diff --git a/app/session.php b/app/session.php index 782c40e..f4acf2f 100644 --- a/app/session.php +++ b/app/session.php @@ -39,4 +39,14 @@ if (isset($_COOKIE['FL_SESSION_TOKEN'])) { } else { header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]")); die(); +} + +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 9b93712..e9a2370 100644 --- a/private/session.php +++ b/private/session.php @@ -26,6 +26,7 @@ if (isset($_COOKIE['FL_SESSION_TOKEN'])) { $_USER = $_PROFILE['login']; $_SUID = $_PROFILE['login']; $_FULLNAME = $_PROFILE['name']; + $_FRENCH = $_PROFILE['locale']['name'] === "fr"; if (!in_array($_USER, $_WELCOMED)) { header("Location: /welcome/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]")); @@ -40,4 +41,13 @@ if (isset($_COOKIE['FL_SESSION_TOKEN'])) { die(); } -$_SERVER["HTTP_USER_AGENT"] = str_replace("+AutomateCloud/", "+FamilineDesktop+AutomateCloud/", $_SERVER["HTTP_USER_AGENT"]); \ No newline at end of file +$_SERVER["HTTP_USER_AGENT"] = str_replace("+AutomateCloud/", "+FamilineDesktop+AutomateCloud/", $_SERVER["HTTP_USER_AGENT"]); +function l($fr, $en) { + global $_FRENCH; + + if ($_FRENCH) { + return $fr; + } else { + return $en; + } +} \ No newline at end of file -- cgit