diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-08 22:31:51 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-08-08 22:31:51 +0200 |
commit | 94c57fa247ba107fce8fc1d1fc355191229dbddc (patch) | |
tree | 865048aa574ef63ad322ed8e5057eb7629e03c29 /admin/private/header.sso.php | |
parent | e255736e3f2a95ee82cadc01b0c70749ab946226 (diff) | |
download | main-94c57fa247ba107fce8fc1d1fc355191229dbddc.tar.gz main-94c57fa247ba107fce8fc1d1fc355191229dbddc.tar.bz2 main-94c57fa247ba107fce8fc1d1fc355191229dbddc.zip |
Permissions system
Diffstat (limited to 'admin/private/header.sso.php')
-rw-r--r-- | admin/private/header.sso.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/admin/private/header.sso.php b/admin/private/header.sso.php new file mode 100644 index 0000000..5911f62 --- /dev/null +++ b/admin/private/header.sso.php @@ -0,0 +1,25 @@ +<?php
+
+if (!isset($_COOKIE["ADMIN_TOKEN"])) {
+ header("Location: https://jetbrains.minteck.ro.lt:1024/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.ro.lt/admin/callback&scope=hub&request_credentials=default&access_type=offline");
+ die();
+} else if (ctype_xdigit($_COOKIE["ADMIN_TOKEN"]) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN'])) {
+ $_DATA = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/admin/private/tokens/" . $_COOKIE['ADMIN_TOKEN']), true);
+} else {
+ header("Location: https://jetbrains.minteck.ro.lt:1024/hub/hub/api/rest/oauth2/auth?client_id=36245ba5-ee9f-44c1-a149-ab2006fcb226&response_type=code&redirect_uri=https://minteck.ro.lt/admin/callback&scope=hub&request_credentials=default&access_type=offline");
+ die();
+}
+
+$_PERMSFORSSO = true;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/permissions.php";
+
+function l($en, $fr = null) {
+ global $lang;
+
+ if ((($lang === "fr" && isset($fr)) || (isset($_GET['fr']) && isset($fr) || isset($_COOKIE['fr']))) && !isset($_GET['en']) && !isset($_COOKIE['en']) && isset($fr)) {
+ setlocale(LC_TIME, array('fr_FR.UTF-8','fr_FR@euro','fr_FR','french'));
+ return $fr;
+ } else {
+ return $en;
+ }
+}
\ No newline at end of file |