aboutsummaryrefslogtreecommitdiff
path: root/admin/api/terminateAllSessions.php
diff options
context:
space:
mode:
authorMinteck <46352972+Minteck@users.noreply.github.com>2021-08-01 22:28:15 +0200
committerMinteck <46352972+Minteck@users.noreply.github.com>2021-08-01 22:28:15 +0200
commit9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2 (patch)
tree22d9b851864f9370282f21d10113afd5d565e4cf /admin/api/terminateAllSessions.php
parentb028da9fea70c65ccd52d1d478859739027d756a (diff)
downloadmain-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.tar.gz
main-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.tar.bz2
main-9852b6cd074cceec0d0b549bb6c9bd7fe50c86f2.zip
Update
Diffstat (limited to 'admin/api/terminateAllSessions.php')
-rw-r--r--admin/api/terminateAllSessions.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/admin/api/terminateAllSessions.php b/admin/api/terminateAllSessions.php
new file mode 100644
index 0000000..2aa5c5f
--- /dev/null
+++ b/admin/api/terminateAllSessions.php
@@ -0,0 +1,34 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php";
+
+if (isset($_GET['_']) && strpos($_GET['_'], "/") === false) {
+ $arg = $_GET['_'];
+} else {
+ die();
+}
+
+$webs = scandir("/mnt/kartik/online/private/tokens");
+
+foreach ($webs as $webt) {
+ if (!is_dir("/mnt/kartik/online/private/tokens/" . $webt)) {
+ $d = json_decode(file_get_contents("/mnt/kartik/online/private/tokens/" . $webt), true);
+ if ($d["id"] === $arg) {
+ unlink("/mnt/kartik/online/private/tokens/" . $webt);
+ }
+ }
+}
+
+$webs = scandir("/mnt/kartik/online/private/gametokens");
+
+foreach ($webs as $webt) {
+ if (!is_dir("/mnt/kartik/online/private/gametokens/" . $webt)) {
+ $d = json_decode(file_get_contents("/mnt/kartik/online/private/gametokens/" . $webt), true);
+ if ($d["id"] === $arg) {
+ unlink("/mnt/kartik/online/private/gametokens/" . $webt);
+ }
+ }
+}
+
+header("Location: /admin/panes/kartik.php");
+die(); \ No newline at end of file