summaryrefslogtreecommitdiffstats
path: root/www/cgi-bin
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-04-22 19:44:45 +0000
committerTed Trask <ttrask01@yahoo.com>2008-04-22 19:44:45 +0000
commit84db09d81e4a9627b9467a9dfb205e75baf926e2 (patch)
treeee232aefd64e568e95c3c020df5310a238bed4c4 /www/cgi-bin
parent86cca6de0483cf5450ac9866131715cf438126b9 (diff)
downloadacf-core-84db09d81e4a9627b9467a9dfb205e75baf926e2.tar.bz2
acf-core-84db09d81e4a9627b9467a9dfb205e75baf926e2.tar.xz
Fixed automatic redirection to include prefix
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1033 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'www/cgi-bin')
-rwxr-xr-xwww/cgi-bin/mvc.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/www/cgi-bin/mvc.lua b/www/cgi-bin/mvc.lua
index 2b7c8b4..1fa88da 100755
--- a/www/cgi-bin/mvc.lua
+++ b/www/cgi-bin/mvc.lua
@@ -115,21 +115,24 @@ dispatch = function (self, userprefix, userctlr, useraction)
local controller = nil
local action = ""
self.conf.default_controller = self.conf.default_controller or ""
+ self.conf.default_prefix = self.conf.default_prefix or ""
if "" == self.conf.controller then
+ self.conf.prefix = self.conf.default_prefix
self.conf.controller = self.conf.default_controller
self.conf.action = ""
end
while "" ~= self.conf.controller do
-- We now know the controller / action combo, check if we're allowed to do it
local perm = true
+ local worker_loaded = false
if type(self.worker.mvc.check_permission) == "function" then
perm = self.worker.mvc.check_permission(self, self.conf.controller)
end
if perm then
- controller = self:new(self.conf.prefix .. self.conf.controller)
+ controller, worker_loaded = self:new(self.conf.prefix .. self.conf.controller)
end
- if controller then
+ if worker_loaded then
controller.conf.default_action = controller.conf.default_action or ""
action = controller.conf.action or ""
if "" == action then
@@ -161,6 +164,7 @@ dispatch = function (self, userprefix, userctlr, useraction)
controller = nil
self.conf.action = ""
if self.conf.controller ~= self.conf.default_controller then
+ self.conf.prefix = self.conf.default_prefix
self.conf.controller = self.conf.default_controller
else
self.conf.controller = ""