forked from Glennmen/PMSF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gym_data.php
40 lines (32 loc) · 864 Bytes
/
gym_data.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
include('config/config.php');
// set content type
header('Content-Type: application/json');
// init map
if (strtolower($map) === "monocle") {
if (strtolower($fork) === "asner") {
$scanner = new \Scanner\Monocle_Asner();
} elseif (strtolower($fork) === "default") {
$scanner = new \Scanner\Monocle();
} else {
$scanner = new \Scanner\Monocle_Alternate();
}
} elseif (strtolower($map) === "rm") {
if (strtolower($fork) === "sloppy") {
$scanner = new \Scanner\RocketMap_Sloppy();
} else {
$scanner = new \Scanner\RocketMap();
}
}
if (empty($_POST['id'])) {
http_response_code(400);
die();
}
if (!validateToken($_POST['token'])) {
http_response_code(400);
die();
}
$id = $_POST['id'];
$p = $scanner->get_gym($id);
$p['token'] = refreshCsrfToken();
echo json_encode($p);