diff options
Diffstat (limited to 'admin/api/terminateGameSessions.php')
-rw-r--r-- | admin/api/terminateGameSessions.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/admin/api/terminateGameSessions.php b/admin/api/terminateGameSessions.php new file mode 100644 index 0000000..2f895b1 --- /dev/null +++ b/admin/api/terminateGameSessions.php @@ -0,0 +1,23 @@ +<?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/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(); |