aboutsummaryrefslogtreecommitdiff
path: root/app/session.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/session.php')
-rw-r--r--app/session.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/session.php b/app/session.php
index fc088c1..10db146 100644
--- a/app/session.php
+++ b/app/session.php
@@ -3,10 +3,14 @@
global $_CONFIG;
$_CONFIG = json_decode(file_get_contents("/mnt/familine/private/FamilineConfig.json"), true);
+global $_USER;
+global $_SUID;
+global $_FULLNAME;
+
if ($_SERVER['REMOTE_ADDR'] !== "127.0.0.1" && $_SERVER['REMOTE_ADDR'] !== "::0") {
if (isset($_COOKIE['FL_SESSION_TOKEN'])) {
if (strpos($_COOKIE['FL_SESSION_TOKEN'], ".") !== false || strpos($_COOKIE['FL_SESSION_TOKEN'], "/") !== false) {
- header("Location: https://" . $_CONFIG["Global"]["domain"] . "/welcome");
+ header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"));
die();
}
@@ -14,7 +18,7 @@ if ($_SERVER['REMOTE_ADDR'] !== "127.0.0.1" && $_SERVER['REMOTE_ADDR'] !== "::0"
$_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"] . "/welcome");
+ header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"));
die();
}
@@ -22,11 +26,11 @@ if ($_SERVER['REMOTE_ADDR'] !== "127.0.0.1" && $_SERVER['REMOTE_ADDR'] !== "::0"
$_SUID = $_PROFILE['login'];
$_FULLNAME = $_PROFILE['name'];
} else {
- header("Location: https://" . $_CONFIG["Global"]["domain"] . "/welcome");
+ header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"));
die();
}
} else {
- header("Location: https://" . $_CONFIG["Global"]["domain"] . "/welcome");
+ header("Location: https://" . $_CONFIG["Global"]["domain"] . "/login/?r=" . urlencode("https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"));
die();
}