<% local msg = {} if _SESSION["logined"] ~= nil then local type = _GET["type"] or _POST["type"] local domain = _GET["domain"] or _POST["domain"] local event = _GET["event"] or _POST["event"] event = tonumber(event) or 0 local FTP_EVENT_COUNT = 27 local SSH_EVENT_COUNT = 25 local WEB_EVENT_COUNT = 25 if type == "ftp" then if(event == nil or event < 0 or event >= FTP_EVENT_COUNT) then rawset(msg, "code", -2) rawset(msg, "error", "Invalid event") print(json.encode(msg)) exit() end local val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,val12,val13,val14 = c_GetFTPEvent(domain,event) 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 } rawset(msg, "code", 0) rawset(msg, "data", obj) print(json.encode(msg)) elseif type == "ssh" then if(event == nil or event < 0 or event >= SSH_EVENT_COUNT) then rawset(msg, "code", -2) rawset(msg, "error", "Invalid event") print(json.encode(msg)) exit() end local val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,val12,val13,val14 = c_GetSSHEvent(domain,event) 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 } rawset(msg, "code", 0) rawset(msg, "data", obj) print(json.encode(msg)) elseif type == "http" then if(event == nil or event < 0 or event >= WEB_EVENT_COUNT) then rawset(msg, "code", -2) rawset(msg, "error", "Invalid event") print(json.encode(msg)) exit() end local val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,val12,val13,val14 = c_GetHTTPEvent(domain,event) 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 } rawset(msg, "code", 0) rawset(msg, "data", obj) print(json.encode(msg)) end else rawset(msg, "code", -1) rawset(msg, "error", "Not logged in") print(json.encode(msg)) end %>