oauth.php 1.3 KB

1234567891011121314151617181920212223
  1. <?php
  2. // by 请勿倒卖,已申请软著,否则追究法律责任
  3. require "../system/db.class.php";
  4. error_reporting(0);
  5. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  6. header("Cache-Control: no-cache, must-revalidate");
  7. header("Pragma: no-cache");
  8. header("Content-type: text/html;charset=" . IN_CHARSET);
  9. header("Access-Control-Allow-Origin: " . $_SERVER["HTTP_ORIGIN"]);
  10. header("Access-Control-Allow-Credentials: true");
  11. $secret = SafeRequest("secret", "get");
  12. $secret && $secret == IN_SECRET || exit("Access denied");
  13. $ssl = is_ssl() ? "https://" : "http://";
  14. $api = $ssl . $_SERVER["HTTP_HOST"] . IN_PATH;
  15. $query = db("sign")->where("in_status=1 and in_time>0")->order("in_time desc")->select();
  16. foreach ($query as $row) {
  17. db("sign")->where(array("in_id" => $row["in_id"]))->update(array("in_time" => 0));
  18. $pw = db("secret")->where("in_site", str_replace("www.", "", $row["in_site"]))->value("in_md5");
  19. $pw = $pw ?: $secret;
  20. $src = "download.php?id=" . $row["in_aid"] . "&ssl=" . $row["in_ssl"] . "&site=" . $row["in_site"] . "&path=" . $row["in_path"] . "&ipa=" . $row["in_ipa"] . "&cert=" . $row["in_cert"] . "&replace=" . $row["in_replace"] . "&pw=" . $pw . "&api=" . $api;
  21. echo "<tr><td><iframe width=\"100%\" height=\"50\" allowtransparency=\"true\" scrolling=\"no\" border=\"0\" frameborder=\"0\" src=\"" . $src . "\"></iframe></td></tr>";
  22. }