index.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. require("../../class/connect.php");
  3. require("../../class/db_sql.php");
  4. require("../../class/q_functions.php");
  5. require("../../member/class/user.php");
  6. require("../../data/dbcache/class.php");
  7. require("../../data/dbcache/MemberLevel.php");
  8. require("../class/DownSysFun.php");
  9. eCheckCloseMods('down');//关闭模块
  10. $link=db_connect();
  11. $empire=new mysqlquery();
  12. $editor=1;
  13. if(!$public_r['opengetdown'])
  14. {
  15. printerror('CloseGetDown','',1);
  16. }
  17. //验证IP
  18. //eCheckAccessDoIp('downinfo');
  19. $id=(int)$_GET['id'];
  20. $pathid=(int)$_GET['pathid'];
  21. $classid=(int)$_GET['classid'];
  22. if(!$classid||empty($class_r[$classid][tbname])||!$id)
  23. {
  24. printerror('ExiestSoftid','',1);
  25. }
  26. $mid=$class_r[$classid][modid];
  27. $tbname=$class_r[$classid][tbname];
  28. $query="select * from {$dbtbpre}ecms_".$tbname." where id='$id' limit 1";
  29. $r=$empire->fetch1($query);
  30. if(!$r['id']||$r['classid']!=$classid)
  31. {
  32. printerror('ExiestSoftid','',1);
  33. }
  34. //副表
  35. $finfor=$empire->fetch1("select ".ReturnSqlFtextF($mid)." from {$dbtbpre}ecms_".$tbname."_data_".$r[stb]." where id='$r[id]' limit 1");
  36. $r=array_merge($r,$finfor);
  37. //区分下载地址
  38. $path_r=explode("\r\n",$r[downpath]);
  39. if(!$path_r[$pathid])
  40. {
  41. printerror('ExiestSoftid','',1);
  42. }
  43. $showdown_r=explode("::::::",$path_r[$pathid]);
  44. //下载权限
  45. $nockpass='';
  46. $downgroup=$showdown_r[2];
  47. $user=array();
  48. if($downgroup)
  49. {
  50. $user=islogin();
  51. $nockpass=qReturnLoginPassNoCK($user['userid'],$user['username'],$user['rnd'],0);
  52. }
  53. //验证码
  54. $ip=egetip();
  55. $pass=md5(md5($classid."-!ecms!".$id."-!ecms!".$pathid).ReturnDownSysCheckIp()."wm_chief".$public_r[downpass].$user[userid]);
  56. $p=$user[userid].":::".$user[rnd].":::".$nockpass;
  57. DownSoft($classid,$id,$pathid,$p,$pass);
  58. db_close();
  59. $empire=null;
  60. ?>