diff options
-rwxr-xr-x | app/acf-util/password-controller.lua | 6 | ||||
-rwxr-xr-x | www/cgi-bin/mvc.lua | 4 |
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 |