Diff

core/storagemanager.lua @ 5155:a207d4bff5a4

storagemanager: Support for iterating over users
author Kim Alvefur <zash@zash.se>
date Fri, 21 Sep 2012 17:24:44 +0200
parent 5148:a0b8e5d03de2
child 5502:c773aa4467f1
line wrap: on
line diff
--- a/core/storagemanager.lua	Fri Sep 21 17:24:06 2012 +0200
+++ b/core/storagemanager.lua	Fri Sep 21 17:24:44 2012 +0200
@@ -118,6 +118,13 @@
 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