aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-10-02 16:44:30 +0100
committerMatthew Wild <mwild1@gmail.com>2020-10-02 16:44:30 +0100
commitbe5199db29773bad53139598f2dfc8a4d65fbe1a (patch)
tree696e5cb7f6c6397bdbb0d12ffa81de830164e144
parent5fd3895de56b1189e2baac2a17a02a301785e625 (diff)
downloadprosody-be5199db29773bad53139598f2dfc8a4d65fbe1a.tar.gz
prosody-be5199db29773bad53139598f2dfc8a4d65fbe1a.zip
mod_auth_anonymous: Add config option to allow/disallow storage writes
-rw-r--r--plugins/mod_auth_anonymous.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/mod_auth_anonymous.lua b/plugins/mod_auth_anonymous.lua
index 1f2bceb3..90646e71 100644
--- a/plugins/mod_auth_anonymous.lua
+++ b/plugins/mod_auth_anonymous.lua
@@ -11,6 +11,8 @@ local new_sasl = require "util.sasl".new;
local datamanager = require "util.datamanager";
local hosts = prosody.hosts;
+local allow_storage = module:get_option_boolean("allow_anonymous_storage", false);
+
-- define auth provider
local provider = {};
@@ -62,10 +64,14 @@ if not module:get_option_boolean("allow_anonymous_s2s", false) then
end
function module.load()
- datamanager.add_callback(dm_callback);
+ if not allow_storage then
+ datamanager.add_callback(dm_callback);
+ end
end
function module.unload()
- datamanager.remove_callback(dm_callback);
+ if not allow_storage then
+ datamanager.remove_callback(dm_callback);
+ end
end
module:provides("auth", provider);