diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-06-02 15:56:37 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-06-02 15:56:37 +0000 |
commit | 3fb4985ae7cd7d5c8fc874ec03c5c0ad7c2d8456 (patch) | |
tree | 71cc0dc4e56853f93988330e118d32444825bbd1 /logfiles-controller.lua | |
parent | a280c3b1faa2847b6d4f850a55d0cd4ea8453283 (diff) | |
download | acf-alpine-baselayout-3fb4985ae7cd7d5c8fc874ec03c5c0ad7c2d8456.tar.bz2 acf-alpine-baselayout-3fb4985ae7cd7d5c8fc874ec03c5c0ad7c2d8456.tar.xz |
Modified logfiles to use cfe's more properly.
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@1192 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'logfiles-controller.lua')
-rw-r--r-- | logfiles-controller.lua | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/logfiles-controller.lua b/logfiles-controller.lua index 3a7900a..400756e 100644 --- a/logfiles-controller.lua +++ b/logfiles-controller.lua @@ -5,14 +5,14 @@ default_action = "status" -- Public methods status = function (self ) - return ({logfile = self.model:get(), url = self.conf.script .. self.conf.prefix .. self.conf.controller} ) + return self.model.get() end delete = function (self) local filetodelete = self.clientdata.name or "" - local me = ({deletestatus = self.model:delete(filetodelete)}) - if (me.deletestatus.errtxt) then - return me + local deletestatus = self.model.delete(filetodelete) + if (deletestatus.errtxt) then + return deletestatus else redirect(self) end @@ -20,12 +20,19 @@ end view = function (self) local filetoview = self.clientdata.name or "" - local content = { logfile=self.model:get_filedetails(filetoview)} - if (filetoview ~= "") and (content.logfile.name ~= nil) then + local content = self.model.get_filedetails(filetoview) + if (filetoview ~= "") and content then return content else redirect(self) end end -download = view +download = function (self) + local filestatus = view(self) + local filecontent = filestatus.value.filecontent + filecontent.label = basename(filestatus.value.filename.value) + self.conf.viewtype = "stream" + + return filecontent +end |