aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-09-02 15:26:28 +0200
committerKim Alvefur <zash@zash.se>2015-09-02 15:26:28 +0200
commit15be099575baac2055c3ce00b4855f2ff48dd620 (patch)
tree8db278a7047ac6d1d8fa88180edb078d7c8ecb9b /core
parent73f4e79b479c7fca77481f0dde4cf230db3ea6a6 (diff)
downloadprosody-15be099575baac2055c3ce00b4855f2ff48dd620.tar.gz
prosody-15be099575baac2055c3ce00b4855f2ff48dd620.zip
storagemanager: Check if drivers support purging, warn otherwise
Diffstat (limited to 'core')
-rw-r--r--core/storagemanager.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index 55f0800a..fb868d03 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -98,9 +98,14 @@ local function purge(user, host)
if type(storage) == "table" then
-- multiple storage backends in use that we need to purge
local purged = {};
- for store, driver in pairs(storage) do
- if not purged[driver] then
- purged[driver] = get_driver(host, store):purge(user);
+ for store, driver_name in pairs(storage) do
+ if not purged[driver_name] then
+ local driver = get_driver(host, store);
+ if driver.purge then
+ purged[driver_name] = driver:purge(user);
+ else
+ log("warn", "Storage driver %s does not support removing all user data, you may need to delete it manually", driver_name);
+ end
end
end
end