-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
38 lines (34 loc) · 864 Bytes
/
index.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
<?php
include("include/Config.php");
include("include/Subscribers.php");
$api_calls = array(
"Test",
);
$json = json_decode(file_get_contents('php://input'));
$action = trim($json->service);
$username = trim($json->username);
if($action && in_array($action, $api_calls)){
// check if limited account
if($token != $paltelAuth){
$response = array(
"status" => "error",
"code" => 1,
"info" => "unauthorized request!"
);
} else {
switch ($action):
case "Test":
$response = Test($username);
break;
endswitch;
}
} else {
$response = array(
"status" => "error",
"code" => 99,
"info" => "bad request!"
);
}
header('Content-type: application/json');
exit(json_encode($response));
?>