diff options
author | Ted Trask <ttrask01@yahoo.com> | 2016-02-17 20:31:24 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2016-02-17 20:31:24 +0000 |
commit | 8d72c0b64e70f77eea76ddefd14eba7fda2fe159 (patch) | |
tree | 27172a9aecdca78db76503a0dfeb19f5780111dc | |
parent | 0b1838c580ae14625c2b997540214bad829e9960 (diff) | |
download | acf-weblog-8d72c0b64e70f77eea76ddefd14eba7fda2fe159.tar.bz2 acf-weblog-8d72c0b64e70f77eea76ddefd14eba7fda2fe159.tar.xz |
Change downloadweblog/adhocquery to use proper cfe and new stream template
-rw-r--r-- | weblog-controller.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/weblog-controller.lua b/weblog-controller.lua index 93a23b0..215ae86 100644 --- a/weblog-controller.lua +++ b/weblog-controller.lua @@ -45,14 +45,15 @@ end function mymodule.downloadweblog(self) local retval = mymodule.viewweblog(self) - local file = cfe({ type="longtext", value="", label="Weblog-"..os.date()..".tab" }) + local file = cfe({ type="raw", value="", label="Weblog-"..os.date()..".tab" }) local content = {"sourcename\tclientuserid\tclientip\tlogdatetime\turi\tbytes\treason\tscore\tshortreason\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%s", log.sourcename, log.clientuserid, log.clientip, log.logdatetime, log.uri, log.bytes, log.reason, log.score, log.shortreason or "", log.badyesno, log.deniedyesno, log.bypassyesno) end file.value = table.concat(content, "\n") - return file + retval.value.file = file + return retval end function mymodule.updateselected(self) @@ -84,8 +85,8 @@ function mymodule.downloadadhocquery(self) self.handle_clientdata(retval, self.clientdata) retval = self.model.adhocquery(self, retval) - local file = cfe({ type="longtext", value="", label="weblogadhocquery.tab" }) if retval.value.result and #retval.value.result.value > 0 then + local file = cfe({ type="raw", value="", label="weblogadhocquery.tab" }) local content = {table.concat(retval.value.names.value, "\t")} for i,entry in ipairs(retval.value.result.value) do local line = {} @@ -95,9 +96,10 @@ function mymodule.downloadadhocquery(self) content[#content+1] = table.concat(line, "\t") end file.value = table.concat(content, "\n") + retval.value.file = file end - return file + return retval end function mymodule.status(self) |