summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-04-28 15:24:27 +0000
committerTed Trask <ttrask01@yahoo.com>2008-04-28 15:24:27 +0000
commit82fd96bdcc5b721d8fc208fe4edba54f4dc6fdb7 (patch)
treeabb2e621dd6e96b03344ace398be7c7a543f2990
parent40ea307aa34120de1409050525140831ce8634d8 (diff)
downloadacf-core-82fd96bdcc5b721d8fc208fe4edba54f4dc6fdb7.tar.bz2
acf-core-82fd96bdcc5b721d8fc208fe4edba54f4dc6fdb7.tar.xz
Changed error redir code to use redirect function instead
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1051 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rwxr-xr-xapp/acf-util/password-controller.lua6
-rwxr-xr-xwww/cgi-bin/mvc.lua4
2 files changed, 4 insertions, 6 deletions
diff --git a/app/acf-util/password-controller.lua b/app/acf-util/password-controller.lua
index fdcca8a..4dbe1eb 100755
--- a/app/acf-util/password-controller.lua
+++ b/app/acf-util/password-controller.lua
@@ -15,11 +15,7 @@ end
local function check_logonstatus(self)
-- Redirect the user if he's not logged in.
if not (self.sessiondata.userinfo) then
- self.conf.action = "logon"
- self.conf.controller = "logon"
- self.conf.type = "redir"
- error (self.conf)
- return self
+ redirect(self, "logon", "logon")
end
end
diff --git a/www/cgi-bin/mvc.lua b/www/cgi-bin/mvc.lua
index 3a4b530..432b591 100755
--- a/www/cgi-bin/mvc.lua
+++ b/www/cgi-bin/mvc.lua
@@ -231,7 +231,9 @@ end
-- Cause a redirect to specified (or default) action
-- We use the self.conf table because it already has prefix,controller,etc
-- The actual redirection is defined in the application error handler (acf-controller)
-redirect = function (self, action)
+redirect = function (self, action, controller, prefix)
+ if prefix then self.conf.prefix = prefix end
+ if controller then self.conf.controller = controller end
if nil == action then
action = rawget(self.worker, "default_action") or ""
end