index.php
1.58 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
<?php
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../class/q_functions.php");
require("../../member/class/user.php");
require("../../data/dbcache/class.php");
require("../../data/dbcache/MemberLevel.php");
require("../class/DownSysFun.php");
eCheckCloseMods('down');//關閉模塊
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
if(!$public_r['opengetdown'])
{
printerror('CloseGetDown','',1);
}
//驗證IP
//eCheckAccessDoIp('downinfo');
$id=(int)$_GET['id'];
$pathid=(int)$_GET['pathid'];
$classid=(int)$_GET['classid'];
if(!$classid||empty($class_r[$classid][tbname])||!$id)
{
printerror('ExiestSoftid','',1);
}
$mid=$class_r[$classid][modid];
$tbname=$class_r[$classid][tbname];
$query="select * from {$dbtbpre}ecms_".$tbname." where id='$id' limit 1";
$r=$empire->fetch1($query);
if(!$r['id']||$r['classid']!=$classid)
{
printerror('ExiestSoftid','',1);
}
//副表
$finfor=$empire->fetch1("select ".ReturnSqlFtextF($mid)." from {$dbtbpre}ecms_".$tbname."_data_".$r[stb]." where id='$r[id]' limit 1");
$r=array_merge($r,$finfor);
//區分下載地址
$path_r=explode("\r\n",$r[downpath]);
if(!$path_r[$pathid])
{
printerror('ExiestSoftid','',1);
}
$showdown_r=explode("::::::",$path_r[$pathid]);
//下載權限
$downgroup=$showdown_r[2];
$user=array();
if($downgroup)
{
$user=islogin();
}
//驗證碼
$ip=egetip();
$pass=md5(ReturnDownSysCheckIp()."wm_chief".$public_r[downpass].$user[userid]);
$p=$user[userid].":::".$user[rnd];
DownSoft($classid,$id,$pathid,$p,$pass);
db_close();
$empire=null;
?>