<% local msg = {} if _SESSION["logined"] ~= nil then local type = _GET["type"] or _POST["type"] local domain = _GET["domain"] or _POST["domain"] local FTP_EVENT_COUNT = 27 local SSH_EVENT_COUNT = 25 local WEB_EVENT_COUNT = 25 local data = {} if type == "ftp" then for i= 0, FTP_EVENT_COUNT-1 do local val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,val12,val13,val14 = c_GetFTPEvent(domain,i) local obj = { RunExe = val1, ExeFile = val2, ExeParam = val3, LogFile = val4, LogFileName = val5, LogFileText = val6, SendMail = val7, MailTo = val8, MailSubject = val9, MailText = val10, MailAttachFile = val11, MailPriority = val12, RunLua = val13, LuaCode = val14 } table.insert(data, obj) end rawset(msg, "code", 0) rawset(msg, "data", data) print(json.encode(msg)) elseif type == "ssh" then for i= 0, SSH_EVENT_COUNT-1 do local val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,val12,val13,val14 = c_GetSSHEvent(domain,i) local obj = { RunExe = val1, ExeFile = val2, ExeParam = val3, LogFile = val4, LogFileName = val5, LogFileText = val6, SendMail = val7, MailTo = val8, MailSubject = val9, MailText = val10, MailAttachFile = val11, MailPriority = val12, RunLua = val13, LuaCode = val14 } table.insert(data, obj) end rawset(msg, "code", 0) rawset(msg, "data", data) print(json.encode(msg)) elseif type == "http" then for i= 0, WEB_EVENT_COUNT-1 do local val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,val12,val13,val14 = c_GetHTTPEvent(domain,i) local obj = { RunExe = val1, ExeFile = val2, ExeParam = val3, LogFile = val4, LogFileName = val5, LogFileText = val6, SendMail = val7, MailTo = val8, MailSubject = val9, MailText = val10, MailAttachFile = val11, MailPriority = val12, RunLua = val13, LuaCode = val14 } table.insert(data, obj) end rawset(msg, "code", 0) rawset(msg, "data", data) print(json.encode(msg)) end else rawset(msg, "code", -1) rawset(msg, "error", "Not logged in") print(json.encode(msg)) end %>