summaryrefslogtreecommitdiffstats
path: root/app/acf_www-controller.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-08-22 19:57:01 +0000
committerTed Trask <ttrask01@yahoo.com>2008-08-22 19:57:01 +0000
commit5d7bf149227635f13e5f23f23fff2493abde6a51 (patch)
treee5aeb3796252c76f4b403771cb938da1be409cd7 /app/acf_www-controller.lua
parenteeb35226477b6825abc1f53a9ad7c79abeaef0a7 (diff)
downloadacf-core-5d7bf149227635f13e5f23f23fff2493abde6a51.tar.bz2
acf-core-5d7bf149227635f13e5f23f23fff2493abde6a51.tar.xz
Modified acf_www and logon-controller to redirect to logon on dispatch error and redirect to requested page after logon.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1402 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'app/acf_www-controller.lua')
-rw-r--r--app/acf_www-controller.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua
index b00953e..dad0026 100644
--- a/app/acf_www-controller.lua
+++ b/app/acf_www-controller.lua
@@ -287,9 +287,14 @@ exception_handler = function (self, message )
local html = require ("html")
local viewtable
if type(message) == "table" then
- if message.type == "redir" and self.conf.component == true then
+ if self.conf.component == true then
io.write ("Component cannot be found")
- elseif message.type == "redir" or message.type == "redir_to_referrer" then
+ elseif message.type == "dispatch" and self.sessiondata.userinfo and self.sessiondata.userinfo.userid then
+ viewtable = message
+ self.conf.prefix = "/"
+ self.conf.controller = "dispatcherror"
+ self.conf.action = ""
+ elseif message.type == "redir" or message.type == "redir_to_referrer" or message.type == "dispatch" then
--if self.sessiondata.id then logevent("Redirecting " .. self.sessiondata.id) end
io.write ("Status: 302 Moved\n")
if message.type == "redir" then
@@ -297,6 +302,8 @@ exception_handler = function (self, message )
message.prefix .. message.controller ..
"/" .. message.action ..
(message.extra or "" ) .. "\n")
+ elseif message.type == "dispatch" then
+ io.write ("Location: " .. ENV["SCRIPT_NAME"] .. "/acf-util/logon/logon?redir="..message.prefix..message.controller.."/"..message.action.."\n")
else
io.write ("Location: " .. ENV.HTTP_REFERER .. "\n")
end
@@ -306,11 +313,6 @@ exception_handler = function (self, message )
io.write (html.cookie.unset("sessionid"))
end
io.write ( "Content-Type: text/html\n\n" )
- elseif message.type == "dispatch" then
- viewtable = message
- self.conf.prefix = "/"
- self.conf.controller = "dispatcherror"
- self.conf.action = ""
else
parent_exception_handler(self, message)
end