diff options
author | Minteck <minteck@phoenixnet.tech> | 2021-10-31 12:30:56 +0100 |
---|---|---|
committer | Minteck <minteck@phoenixnet.tech> | 2021-10-31 12:30:56 +0100 |
commit | 9eabae58420ecb3cc289d6d7ff4c2414f9c63370 (patch) | |
tree | 055f950af077d2be7f65ae1f3b2a11362f0d3556 /includes/session.php | |
download | movies-9eabae58420ecb3cc289d6d7ff4c2414f9c63370.tar.gz movies-9eabae58420ecb3cc289d6d7ff4c2414f9c63370.tar.bz2 movies-9eabae58420ecb3cc289d6d7ff4c2414f9c63370.zip |
Initial commit
Diffstat (limited to 'includes/session.php')
-rw-r--r-- | includes/session.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/includes/session.php b/includes/session.php new file mode 100644 index 0000000..ef1f84d --- /dev/null +++ b/includes/session.php @@ -0,0 +1,26 @@ +<?php + +// Insert here the code that validates the user session +if ($_SERVER['REMOTE_ADDR'] !== "127.0.0.1" && $_SERVER['REMOTE_ADDR'] !== "::0") { + 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://familine.minteck.org/welcome"); + die(); + } + + $_USER = $_PROFILE['login']; + $_SUID = $_PROFILE['login']; + $_FULLNAME = $_PROFILE['name']; + } else { + header("Location: https://familine.minteck.org/welcome"); + die(); + } + } else { + header("Location: https://familine.minteck.org/welcome"); + die(); + } + +} |