Administrator(3);
$this->header();
}
public function __destruct()
{
$this->footer();
}
function index($_var_0 = [])
{
$_var_1 = SafeRequest("page", "get");
$this->type = SafeRequest("type", "get");
is_numeric($this->type) && ($_var_0[] = ["type", "=", $this->type]);
$this->status = SafeRequest("status", "get");
is_numeric($this->status) && ($_var_0[] = ["status", "=", $this->status]);
$_var_2 = db("cert")->where($_var_0)->order("in_id desc")->paginate(["page" => $_var_1]);
$_var_3 = $_var_2->total();
$_var_4 = getRender($_var_2, $_var_1);
$_var_5 = $_var_2->items();
?>
nav3();
$this->searchForm("", "", function () {
?>
where("in_id", $_var_9)->find();
$_var_11 = $_var_9 ? $_var_10["in_dir"] : uniqid();
$_var_12 = "/upload/cert/open?dir=" . $_var_11;
$_var_13 = "";
$this->editemplate($_var_13);
?>
ShowMessage("请上传p12文件", $_SERVER["HTTP_REFERER"], "infotitle3", 3000, 1);
}
$_var_16["p12_pwd"] = SafeRequest("p12_pwd", "post");
if (!$_var_16["p12_pwd"]) {
$this->ShowMessage("请输入p12密码", $_SERVER["HTTP_REFERER"], "infotitle3", 3000, 1);
}
$_var_17 = SafeRequest("mobileprovision", "post");
if (!$_var_17) {
$this->ShowMessage("请上传描述文件", $_SERVER["HTTP_REFERER"], "infotitle3", 3000, 1);
}
$_var_16["in_iden"] = SafeRequest("in_iden", "post");
$_var_16["in_name"] = SafeRequest("in_name", "post");
$_var_18 = [];
$_var_14 && ($_var_18[] = ["in_id", "<>", $_var_14]);
if (db("cert")->where($_var_18)->where("in_name", $_var_16["in_name"])->count()) {
$this->ShowMessage("证书名称已存在", $_SERVER["HTTP_REFERER"], "infotitle3", 3000, 1);
}
$_var_16["in_dir"] = SafeRequest("in_dir", "post");
$_var_16["p12_pwd"] = SafeRequest("p12_pwd", "post");
$_var_16["type"] = SafeRequest("type", "post");
if ($_var_14) {
$_var_19 = db("cert")->strict(false)->where("in_id", $_var_14)->update($_var_16);
} else {
$_var_19 = db("cert")->strict(false)->insert($_var_16);
}
if ($_var_19) {
$_var_20 = $_var_16["in_dir"];
$_var_21 = IN_TMP_PATH . $_var_20 . "/";
$_var_22 = IN_CERT_PATH . $_var_20 . ".zip";
$_var_23 = new PclZip($_var_22);
$_var_23->create($_var_21, PCLZIP_OPT_REMOVE_PATH, $_var_21);
}
$this->ShowMessage("恭喜您,保存成功!", "?c=cert", "infotitle2", 1000, 1);
}
function del()
{
$_var_24 = SafeRequest("in_id", "post") ?? explode(",", SafeRequest("in_id", "get"));
foreach ($_var_24 as $_var_25) {
$_var_26 = db("cert")->where("in_id", $_var_25)->value("in_dir");
@unlink("data/cert/" . $_var_26 . ".zip");
db("cert")->where("in_id", $_var_25)->delete();
}
$this->ShowMessage("恭喜您,证书删除成功!", "?c=cert", "infotitle2", 3000, 1);
}
function type()
{
$_var_27 = intval(SafeRequest("in_id", "get"));
$_var_28 = intval(SafeRequest("v", "get"));
$_var_29 = db("cert")->where("in_id", $_var_27)->update(["type" => $_var_28]);
$_var_30 = $_var_28 ? "稳定版" : "基础版";
$this->ShowMessage("恭喜您,证书已切换为" . $_var_30 . "!", "?c=cert", "infotitle2", 3000, 1);
}
function status()
{
$_var_31 = intval(SafeRequest("in_id", "get"));
$_var_32 = intval(SafeRequest("v", "get"));
$_var_33 = db("cert")->where("in_id", $_var_31)->update(["status" => $_var_32]);
$_var_34 = $_var_32 ? "已启用" : "已停用";
$this->ShowMessage("恭喜您,证书" . $_var_34 . "!", "?c=cert", "infotitle2", 3000, 1);
}
}