summaryrefslogtreecommitdiff
path: root/pages/logout.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-08-10 00:04:25 +0200
committerMinteck <contact@minteck.org>2022-08-10 00:04:25 +0200
commit0417260bf158c5d7b62888dae2e202b0de115a05 (patch)
tree7f54ee56da118813f2d1b3a324d322d0c74fa51b /pages/logout.php
downloadpluralconnect-0417260bf158c5d7b62888dae2e202b0de115a05.tar.gz
pluralconnect-0417260bf158c5d7b62888dae2e202b0de115a05.tar.bz2
pluralconnect-0417260bf158c5d7b62888dae2e202b0de115a05.zip
Initial commit
Diffstat (limited to 'pages/logout.php')
-rw-r--r--pages/logout.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/pages/logout.php b/pages/logout.php
new file mode 100644
index 0000000..ea1bfce
--- /dev/null
+++ b/pages/logout.php
@@ -0,0 +1,16 @@
+<?php
+
+if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) {
+ if (str_contains($_COOKIE['PEH2_SESSION_TOKEN'], ".") || str_contains($_COOKIE['PEH2_SESSION_TOKEN'], "/")) {
+ header("Location: /") and die();
+ }
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) {
+ unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])));
+ header("Location: /") and die();
+ } else {
+ header("Location: /") and die();
+ }
+} else {
+ header("Location: /") and die();
+} \ No newline at end of file