app.php 827 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. // by 请勿倒卖,已申请软著,否则追究法律责任
  3. namespace app\download;
  4. use app\index\Base;
  5. class app extends Base
  6. {
  7. function index()
  8. {
  9. close_browse();
  10. $_var_0 = explode(".", @bees_decrypt($this->action));
  11. $_var_1 = $_var_0[0] ?: 0;
  12. $_var_2 = $_var_0[1] ?? "app";
  13. $_var_3 = $_var_0[2] ?? 0;
  14. $_var_4 = db($_var_2)->where("in_id", $_var_1)->find();
  15. if (IN_DENIED) {
  16. if (!$this->userlogined || $_var_3 && $_var_3 < strtotime("-5 minutes")) {
  17. header("HTTP/1.1 404 NOT FOUND");
  18. exit("file not exists");
  19. }
  20. if (!$_var_3) {
  21. $_var_0[2] = time();
  22. header("location:/download/app/" . implode(".", $_var_0));
  23. }
  24. downloadFile("data/attachment/" . $_var_4["in_app"], $_var_4["in_originalName"]);
  25. } else {
  26. header("location:/data/attachment/" . $_var_4["in_app"]);
  27. }
  28. }
  29. }