# HG changeset patch # User Matthew Wild # Date 1601653470 -3600 # Node ID d60094d9b4589952daad6d7fea8618192ff27090 # Parent 2d38242a08ddf198df463cc202e1d20e0874a437 mod_auth_anonymous: Add config option to allow/disallow storage writes diff -r 2d38242a08dd -r d60094d9b458 plugins/mod_auth_anonymous.lua --- a/plugins/mod_auth_anonymous.lua Fri Oct 02 16:35:05 2020 +0200 +++ b/plugins/mod_auth_anonymous.lua Fri Oct 02 16:44:30 2020 +0100 @@ -11,6 +11,8 @@ 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 @@ 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);