-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfontdl.php
More file actions
75 lines (63 loc) · 2.21 KB
/
fontdl.php
File metadata and controls
75 lines (63 loc) · 2.21 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/*
* 根据ID下载字体:
*/
header('content-type:text/html;charset=utf-8');
header ("Cache-Control: no-cache, must-revalidate");
try {
require_once 'lib/WriteLog.lib.php';
require_once 'configs/config.php';
require_once 'public/public.php';
$id = (isset($_GET['id']))?$_GET['id']:'';
$cpid = isset($_GET['cpid'])?$_GET['cpid']:'';
if(empty($id)){
Log::write('fontdl id is empty', 'log');
exit;
}
$strProduct = '';
$strImsi = '';
$strMeid = '';
$protocolCode = 0;
if(isset($_POST['statis'])){
$json_param = isset($_POST['statis'])?$_POST['statis']:'';
$json_param = stripslashes($json_param);
$arr_param = json_decode($json_param, true);
$strProduct = isset($arr_param['product'])?$arr_param['product']:'';
$strImsi = isset($arr_param['imsi'])?$arr_param['imsi']:'';
$strMeid = isset($arr_param['meid'])?$arr_param['meid']:'';
$strCyid = isset($arr_param['cyid'])?$arr_param['cyid']:'';
$protocolCode = (int)(isset($arr_param['protocolCode'])?$arr_param['protocolCode']:0);
}
require_once("tasks/CoolShow/CoolShowSearch.class.php");
$coolshow = new CoolShowSearch();
$bIsCharge = $coolshow->checkIscharge(COOLXIU_TYPE_FONT, $id);
if($bIsCharge){
require_once 'tasks/Exorder/ExorderRecordDb.class.php';
$erDb = new ExorderRecordDb();
$bResult = $erDb->checkMobileCharged($strProduct, COOLXIU_TYPE_FONT, $id, $cpid, $strMeid, $strImsi, $strCyid);
if(!$bResult){
$result = get_rsp_result(false, 'the resource is not paid');
exit($result);
}
}
$url = $coolshow->getUrl(COOLXIU_TYPE_FONT, $id);
if($url === false){
Log::write('CoolShowSearch::getUrl(COOLXIU_TYPE_FONT) id:'.$id, 'log');
exit;
}
url_skip_download($url);
if($protocolCode >= 1){
Log::write('fontdl protocolCode = '.$protocolCode, 'debug');
exit;
}
// require_once 'tasks/statis/ReqStatis.class.php';
// $reqStatis = new ReqStatis();
// $type = isset($_GET['type'])?$_GET['type']:0;
// $reqStatis->recordDownloadRequest($id, COOLXIU_TYPE_FONT, 0, 0, $cpid, $url, $type);
require_once 'tasks/Records/RecordTask.class.php';
$rt = new RecordTask();
$rt->saveDownload(COOLXIU_TYPE_FONT);
}catch(Exception $e){
Log::write("ringdl exception error:".$e->getMessage(), "log");
exit;
}