aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-09-21 17:24:44 +0200
committerKim Alvefur <zash@zash.se>2012-09-21 17:24:44 +0200
commit7d9e3dd14b295afd60fca09bd80c147b533153ff (patch)
tree5ac27b49179231259ec29e59b20f827cf5eb1aea
parent504f8b921339427b7319c4f3cb26bdb258a04190 (diff)
downloadprosody-7d9e3dd14b295afd60fca09bd80c147b533153ff.tar.gz
prosody-7d9e3dd14b295afd60fca09bd80c147b533153ff.zip
storagemanager: Support for iterating over users
-rw-r--r--core/storagemanager.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index 5a7bb7bd..36a671be 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -118,6 +118,13 @@ end
function datamanager.store(username, host, datastore, data)
return open(host, datastore):set(username, data);
end
+function datamanager.users(host, datastore, typ)
+ local driver = open(host, datastore, typ);
+ if not driver.users then
+ return function() log("warn", "storage driver %s does not support listing users", driver.name) end
+ end
+ return driver:users();
+end
function datamanager.stores(username, host, typ)
return get_driver(host):stores(username, typ);
end