# HG changeset patch # User Kim Alvefur # Date 1317851673 -7200 # Node ID f43d2d26c1c4a5d51774af6737900aed855c2515 # Parent fb152d4af082e22f9e2e20bb8cbc2b544c7ac7d6 mod_seclabels: Fix config reloading diff -r fb152d4af082 -r f43d2d26c1c4 mod_seclabels/mod_seclabels.lua --- a/mod_seclabels/mod_seclabels.lua Wed Oct 05 21:03:51 2011 +0200 +++ b/mod_seclabels/mod_seclabels.lua Wed Oct 05 23:54:33 2011 +0200 @@ -21,12 +21,12 @@ }; }; local catalog_name, catalog_desc, labels; -function get_conf() +local function get_conf() catalog_name = module:get_option_string("security_catalog_name", "Default"); catalog_desc = module:get_option_string("security_catalog_desc", "My labels"); labels = module:get_option("security_labels", default_labels); end -module:hook("config-reloaded",get_conf); +module:hook_global("config-reloaded",get_conf); get_conf(); function handle_catalog_request(request) @@ -74,6 +74,14 @@ end end end + -- TODO query remote servers + --[[ FIXME later + labels = module:fire_event("sec-label-catalog", { + to = catalog_request.attr.to, + request = request; -- or just origin? + labels = labels; + }) or labels; + --]] add_labels(reply, labels, ""); request.origin.send(reply); return true;