diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-01-15 17:32:29 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-01-15 17:32:29 +0000 |
commit | b49907bb90004ddd89420e1714bdac631d4cf4bd (patch) | |
tree | ce6018c6db5a5d950017ad77ccf6de3b06ec2e54 /logfiles-controller.lua | |
parent | 0df0224d97673e818e198dd3bbcd30e39e1bd66c (diff) | |
download | acf-alpine-baselayout-b49907bb90004ddd89420e1714bdac631d4cf4bd.tar.bz2 acf-alpine-baselayout-b49907bb90004ddd89420e1714bdac631d4cf4bd.tar.xz |
Cleaned up the code and using some librarys instead.
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@582 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'logfiles-controller.lua')
-rw-r--r-- | logfiles-controller.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/logfiles-controller.lua b/logfiles-controller.lua index 1a5ca30..c5a5896 100644 --- a/logfiles-controller.lua +++ b/logfiles-controller.lua @@ -4,7 +4,7 @@ module (..., package.seeall) -- We use the self.conf table because it already has prefix,controller,etc -- The redir code is defined in the application error handler (acf-controller) local list_redir = function (self) - self.conf.action = "read" + self.conf.action = "status" self.conf.type = "redir" error (self.conf) end @@ -18,7 +18,7 @@ end -- Public methods -read = function (self ) +status = function (self ) return ({logfile = self.model:get(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) end @@ -34,11 +34,11 @@ end view = function (self) local filetoview = self.clientdata.name or "" - local content = ({logfile = self.model:view(filetoview)} ) - if content.logfile.name == "" then - list_redir(self) - else + local content = { logfile=self.model:get_filedetails(filetoview)} + if (filetoview ~= "") and (content.logfile.name ~= nil) then return content + else + list_redir(self) end end |