<% local msg = {} if _SESSION["logined"] ~= nil then local domain = _GET["domain"] or _POST["domain"] local sessionid = _GET["sessionid"] or _POST["sessionid"] local session_data = {} rawset(session_data, "sessiontime", c_GetSessionLiveTime(domain,sessionid)) local statistic = c_GetSessionStatistic(domain,sessionid) if statistic ~= nil then rawset(session_data, "down_speed", statistic["down_speed"]) rawset(session_data, "down_averagespeed", statistic["down_averagespeed"]) rawset(session_data, "down_bytes", statistic["down_bytes"]) rawset(session_data, "down_files", statistic["down_files"]) rawset(session_data, "up_speed", statistic["up_speed"]) rawset(session_data, "up_averagespeed", statistic["up_averagespeed"]) rawset(session_data, "up_bytes", statistic["up_bytes"]) rawset(session_data, "up_files", statistic["up_files"]) else rawset(session_data, "down_speed", 0) rawset(session_data, "down_averagespeed", 0) rawset(session_data, "down_bytes", 0) rawset(session_data, "down_files", 0) rawset(session_data, "up_speed", 0) rawset(session_data, "up_averagespeed", 0) rawset(session_data, "up_bytes", 0) rawset(session_data, "up_files", 0) end rawset(msg, "code", 0) rawset(msg, "data", session_data) print(json.encode(msg)) else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>