-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfull.php
50 lines (48 loc) · 1.72 KB
/
full.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
41
42
43
44
45
46
47
48
49
50
<?php
include 'functions.php';
if (isset($_POST["email"]) && isset($_POST["password"]) && isset($_POST["app_id"])){
$email = $_POST['email'];
$pass = $_POST['password'];
$app_id = $_POST["app_id"];
if(getenv('HOST_NAME')){
$host = getenv('HOST_NAME');
}
else {
$host = 'http://localhost';
}
if($app_id == 350685531728)
{
$useragent = array_rand($user_agent['android']);
$app = 'android';
$token = json_decode(file_get_contents($host.'/android.php?u='.$email.'&p='.$pass.'&user_agent='.$useragent.''),true);
}else if($app_id == 165907476854626)
{
$useragent = array_rand($user_agent['iphone']);
$app = 'iphone';
$token = json_decode(file_get_contents($host.'/ios.php?u='.$email.'&p='.$pass.'&user_agent='.$useragent.''),true);
}else if($app_id == 6628568379)
{
$useragent = array_rand($user_agent['iphone']);
$app = 'iphone';
$token = json_decode(file_get_contents($host.'/iphone.php?u='.$email.'&p='.$pass.'&user_agent='.$useragent.''),true);
}
if(isset($token['access_token'])) {
$token_validating = validate_token($app,$token['access_token'],$useragent);
//Debug $token_validating
// exit(json_encode($token_validating));
if($token_validating['status'] == 'ok'){
$token_info['status'] = 'ok';
$token_info['access_token'] = $token['access_token'];
}
else{
$token_info['status'] = 'error';
$token_info['error_msg'] = $token_validating['message'];
}
}
else {
$token_info['error_msg'] = $token['error_msg'];
$token_info['status'] = 'error';
}
exit(json_encode($token_info));
}
?>