<% local msg = {} if _SESSION["logined"] ~= nil then local data = {} rawset(data, "httpport", c_GetAdminOptionInt(ADMIN_OPTION_LISTEN_PORT_INT)) rawset(data, "httpsecure", c_GetAdminOptionInt(ADMIN_OPTION_SECURE_ENABLE_INT) == 1) rawset(data, "httpcert", c_GetAdminOptionStr(ADMIN_OPTION_SSL_NAME_STR)) rawset(data, "listenerip", c_GetAdminOptionStr(ADMIN_OPTION_LISTEN_IP_STR)) local splitted_strings = {} for str in string.gmatch(c_GetLocalIpList(), "([^,]+)") do table.insert(splitted_strings, str) end rawset(data, "iplist", splitted_strings) rawset(data, "certlist", c_GetSSLCertList()) rawset(msg, "code", 0) rawset(msg, "data", data) else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") end print(json.encode(msg)) %>