diff options
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 |