<% local msg = {} if _SESSION["logined"] ~= nil then local httpport = _POST["httpport"] local listenerip = _POST["listenerip"] local ssl_cert = _POST["httpcert"] local httpsecure = false if _POST["httpsecure"] == "1" then httpsecure = true end local result = c_CheckSSLCertificate(ssl_cert) if result == true then result = c_ChangeAdminListener(httpport, httpsecure, listenerip) if result == true then c_SetAdminOptionStr(ADMIN_OPTION_SSL_NAME_STR,ssl_cert) c_AddAdminLog("administrator '".._SESSION["admin"].."' changed administrator listener.",ADMIN_LOG_OK) rawset(msg, "code", 0) else rawset(msg, "code", -2) c_AddAdminLog("administrator '".._SESSION["admin"].."' changed administrator listener failed.",ADMIN_LOG_ERROR) end else rawset(msg, "code", -2) c_AddAdminLog("administrator '".._SESSION["admin"].."' changed administrator listener failed.",ADMIN_LOG_ERROR) end print(json.encode(msg)) else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>