diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-07-03 13:42:27 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-07-03 13:42:27 +0000 |
commit | 060b3f4716e38a69d85ce104abbc21e384fb70a5 (patch) | |
tree | 25bb69279a6459bc1558aead1c6c8dc4401cf054 /app | |
parent | 5b1f815f835e543fe17d63993bf0d87b68d3f07a (diff) | |
download | acf-core-060b3f4716e38a69d85ce104abbc21e384fb70a5.tar.bz2 acf-core-060b3f4716e38a69d85ce104abbc21e384fb70a5.tar.xz |
Added debug html page. Change redirect_to_referreferrer when there's no referrer.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1271 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'app')
-rw-r--r-- | app/Makefile | 1 | ||||
-rw-r--r-- | app/acf_www-controller.lua | 19 | ||||
-rw-r--r-- | app/debug-html.lsp | 8 |
3 files changed, 22 insertions, 6 deletions
diff --git a/app/Makefile b/app/Makefile index 6a3664f..32b1654 100644 --- a/app/Makefile +++ b/app/Makefile @@ -31,6 +31,7 @@ APP_DIST= \ startstop-html.lsp\ filedetails-html.lsp\ expert-html.lsp\ + debug-html.lsp\ EXTRA_DIST=README Makefile DISTFILES=$(APP_DIST) $(EXTRA_DIST) diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua index 6b1bc6e..06570a7 100644 --- a/app/acf_www-controller.lua +++ b/app/acf_www-controller.lua @@ -468,15 +468,22 @@ end -- If we've done something, cause a redirect to the referring page (assuming it's different) -- Also handles retrieving the result of a previously redirected action redirect_to_referrer = function(self, result) - -- If we have a result, then we did something, so we might have to redirect if result then - local prefix, controller, action = self.parse_path_info(ENV.HTTP_REFERER) - if controller ~= self.conf.controller or action ~= self.conf.action then - self.sessiondata[self.conf.action.."result"] = result - error({type="redir_to_referrer"}) + -- If we have a result, then we did something, so we might have to redirect + if not ENV.HTTP_REFERER then + -- If no referrer, we have a problem. Can't let it go through, because action + -- might not have view. So redirect to default action for this controller. + self:redirect() + else + local prefix, controller, action = self.parse_path_info(ENV.HTTP_REFERER) + if controller ~= self.conf.controller or action ~= self.conf.action then + self.sessiondata[self.conf.action.."result"] = result + error({type="redir_to_referrer"}) + end end - -- If we don't have a result, then we might be a component redirected as above elseif self.sessiondata[self.conf.action.."result"] then + -- If we don't have a result, but there's a result in the session data, + -- then we're a component redirected as above. Return the last result. result = self.sessiondata[self.conf.action.."result"] self.sessiondata[self.conf.action.."result"] = nil end diff --git a/app/debug-html.lsp b/app/debug-html.lsp new file mode 100644 index 0000000..775b102 --- /dev/null +++ b/app/debug-html.lsp @@ -0,0 +1,8 @@ +<? local data, viewlibrary, page_info, session = ... ?> +<H1>Debugging</H1> +<H2>View Data:</H2> +<?= html.cfe_unpack(data) ?> +<H2>Session:</H2> +<?= html.cfe_unpack(session) ?> +<H2>Page Info:</H2> +<?= html.cfe_unpack(page_info) ?> |