diff options
author | Ted Trask <ttrask01@yahoo.com> | 2011-09-08 18:15:31 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2011-09-08 18:15:31 +0000 |
commit | 1ffa8dd1bfef01de170088bc3107df0eab1efc2e (patch) | |
tree | 564bba01aacb29cdf06f73fd9addfaf77b41feb1 /weblog-controller.lua | |
parent | 7dfca7898de732b9c268d633a526a154b58c2776 (diff) | |
download | acf-weblog-1ffa8dd1bfef01de170088bc3107df0eab1efc2e.tar.bz2 acf-weblog-1ffa8dd1bfef01de170088bc3107df0eab1efc2e.tar.xz |
Removed downloadlogview action and use downloadweblog action again.
Diffstat (limited to 'weblog-controller.lua')
-rw-r--r-- | weblog-controller.lua | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/weblog-controller.lua b/weblog-controller.lua index 83eeb9f..20b3134 100644 --- a/weblog-controller.lua +++ b/weblog-controller.lua @@ -56,25 +56,11 @@ end function downloadweblog(self) self.conf.viewtype = "stream" local retval = viewweblog(self) - local file = cfe({ type="longtext", value="", label=retval.value.clientuserid.value .. ".csv" }) - local content = {"clientuserid,clientip,logdatetime,uri,bytes,reason,score,reason,badyesno,deniedyesno,bypassyesno"} + local file = cfe({ type="longtext", value="", label="Weblog-"..os.date()..".tab" }) + local content = {"sourcename\tclientuserid\tclientip\tlogdatetime\turi\tbytes\treason\tscore\treason\tbadyesno\tdeniedyesno\tbypassyesno"} for i,log in ipairs(retval.value.log.value) do - content[#content+1] = string.format("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,", - log.clientuserid, log.clientip, log.logdatetime, log.uri, log.bytes, log.reason, log.score or "0", log.reason, log.badyesno, log.deniedyesno, log.bypassyesno ) - end - file.value = table.concat(content, "\n") - return file -end - -function downloadlogview(self) - thisdate=os.date() - self.conf.viewtype = "stream" - local retval = viewweblog(self) - local file = cfe({ type="longtext", value="", label="Weblog-resnet-"..thisdate..".tab" }) - local content = {"clientuserid\tclientip\tlogdatetime\turi\tbytes\treason\tscore\treason\tbadyesno\tdeniedyesno\tbypassyesno"} - for i,log in ipairs(retval.value.log.value) do - content[#content+1] = string.format("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t", - log.clientuserid, log.clientip, log.logdatetime, log.uri, log.bytes, log.reason, log.score or "0", log.reason, log.badyesno, log.deniedyesno, log.bypassyesno ) + content[#content+1] = string.format("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s", + log.sourcename, log.clientuserid, log.clientip, log.logdatetime, log.uri, log.bytes, log.reason, log.score, log.reason, log.badyesno, log.deniedyesno, log.bypassyesno) end file.value = table.concat(content, "\n") return file |