Initial commit
[2ch-be.git] / melon / mapi.php
blobbc24d1cd9e04bf25e7728d23ef7e8acc1fa1f97c
1 <?php
2 include('../encrypt.php');
4 if(isset($_GET['tkn']) && !empty($_GET['tkn'])) {
5 //echo $_GET['tkn'];
6 if(trim($_GET['tkn']) != "Mn2X65LB07wOXgU") {
7 echo "NG";
8 exit;
12 if (isset($_GET['d']) && isset($_GET['m']) && isset($_GET['r']) && isset($_GET['pts']) && $_GET['tkn']=="Mn2X65LB07wOXgU") {
13 $d = trim($_GET['d']);
14 $m = trim($_GET['m']);
15 $r = trim($_GET['r']);
16 $p = trim($_GET['pts']);
17 $trans = trim($_GET['trans']);
19 $d = strip_tags(addslashes($d));
20 $m = strip_tags(addslashes($m));
21 $r = strip_tags(addslashes($r));
22 $trans = strip_tags(addslashes($trans));
23 $p = strip_tags(addslashes($p));
24 if(!filter_var($p, FILTER_VALIDATE_INT) || $p < 0) {
25 echo "0";
26 exit;
29 $d = urldecode($d);
30 $m = urldecode($m);
32 $d = Decrypt($d,KEY);
33 $m = Decrypt($m,KEY);
35 //echo $d."<br>".$m;
36 //exit;
38 $d = filter_var($d, FILTER_SANITIZE_EMAIL);
39 #if (!filter_var($d, FILTER_VALIDATE_EMAIL)) {
40 # echo "0";
41 # exit;
43 $m = filter_var($m, FILTER_SANITIZE_STRING);
45 $fdir = substr($d, 0, 1);
46 $sdir = substr($d, 1, 1);
47 $data = @file(DB_PATH."$fdir/$sdir/$d");
49 if(md5($m."kahitanupo")==trim($data[2])){
50 echo $points = file_get_contents("http://tpol27.nttec.com/melon.php?subt=".$p."&usr=".$d."&r=".$r."&trans=".$trans);
53 if(hash("sha256", $m."kahitanupo")==trim($data[2])){
54 //echo "http://tpol27.nttec.com/melon.php?subt=".$p."&usr=".$d."&r=".$r;
55 echo $points = file_get_contents("http://tpol27.nttec.com/melon.php?subt=".$p."&usr=".$d."&r=".$r."&trans=".$trans);
58 } else {
59 echo "0";