1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- // by 请勿倒卖,已申请软著,否则追究法律责任
- namespace app\index;
- use app\aliyunoss\Aliyunoss;
- use app\qiniuoss\Qiniuoss;
- class Base extends \app\system\Base
- {
- public $info;
- public $mobule;
- public $action;
- public $userlogined;
- public $userid;
- public $username;
- public $userpassword;
- public $user;
- function initialize()
- {
- if (isset($this->info) && !in_array($this->info, array("upload"))) {
- if (isset($this->module) && in_array($this->module, array("apps", "app_sign", "tf", "price", "price", "utils", "promote", "login", "lost", "reg", "user_profile", "user_order", "user_aclog", "user_promote", "user_cash"))) {
- Chk_authkey();
- }
- }
- if (IN_OPEN == 0) {
- exit(html_message("维护通知", IN_OPENS));
- }
- db("appid")->where("in_sign", ">", "0")->where("in_sign", "<", time())->update(array("in_sign" => 0, "in_resign" => 0));
- $this->userid = isset($_COOKIE["in_userid"]) ? intval($_COOKIE["in_userid"]) : 0;
- $this->username = isset($_COOKIE["in_username"]) ? SafeSql($_COOKIE["in_username"]) : NULL;
- $this->userpassword = isset($_COOKIE["in_userpassword"]) ? SafeSql($_COOKIE["in_userpassword"]) : NULL;
- $this->user = db("user")->where("in_userid", $this->userid)->where("in_username", $this->username)->where("in_userpassword", $this->userpassword)->where("in_islock", "0")->find();
- if ($this->user) {
- $this->userlogined = true;
- } else {
- $this->userlogined = false;
- }
- $this->super_clear();
- }
- function ajax_header()
- {
- header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
- header("Cache-Control: no-cache, must-revalidate");
- header("Pragma: no-cache");
- header("Content-type: text/html;charset=" . IN_CHARSET);
- }
- function header()
- {
- include_once "public/header.php";
- }
- function static_()
- {
- ?> <link rel="stylesheet" href="//at.alicdn.com/t/font_780494_fdjuk9baed7.css"/>
- <link rel="stylesheet" href="/static/pack/bootstrap-3.3.7-dist/css/bootstrap.min.css"/>
- <link rel="stylesheet" href="/static/index/css/base.css"/>
- <link rel="stylesheet" href="/static/index/css/main.css"/>
- <link rel="stylesheet" href="/static/index/css/h5.css"/>
- <script charset="utf-8" src="/static/index/js/jquery.min.js"></script>
- <script charset="utf-8" src="/static/index/js/bootstrap.min.js"></script>
- <script charset="utf-8" src="/static/index/js/js.js"></script>
- <link rel="shortcut icon" href="//<?php echo $_SERVER["HTTP_HOST"];?>/favicon.ico" type="image/x-icon"/>
- <script>
- isHideFooter = false;
- </script>
- <?php
- }
- function footer()
- {
- include_once "public/footer.php";
- }
- function super_clear($_var_0 = 0)
- {
- $_var_1 = array();
- $_var_0 && ($_var_1[] = array("app_id", "=", $_var_0));
- $_var_2 = is_numeric(IN_SUPER_CLEAR_INTERVAL) && IN_SUPER_CLEAR_INTERVAL ? IN_SUPER_CLEAR_INTERVAL : 4;
- $_var_3 = db("super_sign")->where($_var_1)->where("clear_time", "0")->whereTime("update_time", "<", strtotime("- " . $_var_2 . " hours"))->paginate()->items();
- if ($_var_3) {
- $_var_4 = IN_REMOTE == 1 ? new Qiniuoss() : new Aliyunoss();
- foreach ($_var_3 as $_var_5 => $_var_6) {
- @unlink($_var_6["ipa_path"]);
- @unlink($_var_6["plist_path"]);
- if (IN_MANDATORY_REMOTE || $_var_6["remote"]) {
- @$_var_4->delete($_var_6["ipa_path"]);
- }
- db("super_sign")->where("id", $_var_6["id"])->update(array("clear_time" => time()));
- }
- }
- }
- }
|