-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.php
More file actions
33 lines (29 loc) · 826 Bytes
/
requests.php
File metadata and controls
33 lines (29 loc) · 826 Bytes
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
<?php
require_once('./includes/autoload.php');
$deliver = array(
'status' => 400,
'error' => $TEMP['#word']['error']
);
$one = Specific::Filter($_GET['one']);
$token = Specific::Filter($_POST['token']);
if (!empty($_GET['token'])) {
$token = Specific::Filter($_GET['token']);
}
if (empty($token) || $token != $_SESSION['_LOGIN_TOKEN']) {
$deliver['error'] = $TEMP['#word']['invalid_request'];
}
if (!empty($_GET['request-name']) && !empty($token) && $token == $_SESSION['_LOGIN_TOKEN']) {
$req = Specific::Filter($_GET['request-name']);
if (file_exists('./requests/'.$req.'.php')) {
require_once('./requests/'.$req.'.php');
} else {
$deliver = array(
'status' => 404,
'error' => $TEMP['#word']['request_not_found']
);
}
}
header('Content-Type: application/json');
echo json_encode($deliver);
exit();
?>