1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- // by 请勿倒卖,已申请软著,否则追究法律责任
- require "../system/db.class.php";
- 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);
- header("Access-Control-Allow-Origin: " . (isset($_SERVER["HTTP_ORIGIN"]) ? $_SERVER["HTTP_ORIGIN"] : NULL));
- header("Access-Control-Allow-Credentials: true");
- $status = SafeRequest("status", "get");
- $site = SafeRequest("site", "get");
- $id = intval(SafeRequest("id", "get"));
- $sid = db("sign")->where("in_site", $site)->where("in_aid", $id)->value("in_id");
- if ($status < 2) {
- $ssl = SafeRequest("ssl", "get");
- $path = SafeRequest("path", "get");
- $ipa = SafeRequest("ipa", "get");
- $replace = SafeRequest("replace", "get");
- $charset = SafeRequest("charset", "get");
- $name = SafeRequest("name", "get");
- $cert = SafeRequest("cert", "get");
- $setarr = array("in_aid" => $id, "in_aname" => @convert_utf8($name, $charset), "in_replace" => $replace, "in_ssl" => $ssl, "in_site" => $site, "in_path" => $path, "in_ipa" => $ipa, "in_status" => 1, "in_cert" => $cert, "in_time" => time());
- if ($sid) {
- db("sign")->where(array("in_id" => $sid))->update($setarr);
- } else {
- db("sign")->insert($setarr);
- }
- echo "1";
- } else {
- if ($sid) {
- db("sign")->where(array("in_id" => $sid))->update(array("in_status" => 2, "in_time" => time()));
- echo "1";
- }
- }
|