diff options
author | Nathan Angelacos <nangel@tetrasec.net> | 2008-11-09 00:27:32 +0000 |
---|---|---|
committer | Nathan Angelacos <nangel@tetrasec.net> | 2008-11-09 00:27:32 +0000 |
commit | 95e743197047cc4c2550563ea8ef323c9b1230fd (patch) | |
tree | ef2f16f60fd30b3bdd405a177aa3ff3e3125556e /www/cgi-bin | |
parent | 004f2adfc85bed299c762e019120732fe90d597d (diff) | |
download | acf-core-95e743197047cc4c2550563ea8ef323c9b1230fd.tar.bz2 acf-core-95e743197047cc4c2550563ea8ef323c9b1230fd.tar.xz |
per-controller auditing now allowed via acf-hooks.lua
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1582 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'www/cgi-bin')
-rwxr-xr-x | www/cgi-bin/mvc.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/www/cgi-bin/mvc.lua b/www/cgi-bin/mvc.lua index aef3547..4ded73d 100755 --- a/www/cgi-bin/mvc.lua +++ b/www/cgi-bin/mvc.lua @@ -260,6 +260,20 @@ read_config = function( self, appname ) break end end + + if (#self.conf.confdir) then -- check for an appname-hooks.lua file + self.conf.app_hooks = {} + setmetatable (self.conf.app_hooks, {__index = _G}) + + -- loadfile loads into the global environment + -- so we set env 0, not env 1 + setfenv (0, self.conf.app_hooks) + local f = loadfile(self.conf.confdir .. "/" .. appname.. "-hooks.lua") + if (f) then f() end + setfenv (0, _G) + -- setmetatable (self.conf.app_hooks, {}) + end + end -- parse a "URI" like string into a prefix, controller and action |