mod_http_files: Export function can be used by other modules to serve files. Don...
[prosody.git] / plugins / mod_auth_internal_plain.lua
index 7705cb66ee2383c8257c2b589edcc2df9c4a0235..7514164d6f71ee6b1d99afcabb079e855b6069e6 100644 (file)
@@ -15,7 +15,7 @@ local log = module._log;
 local host = module.host;
 
 -- define auth provider
-local provider = { name = "internal_plain" };
+local provider = {};
 log("debug", "initializing internal_plain authentication provider for host '%s'", host);
 
 function provider.test_password(username, password)
@@ -52,6 +52,10 @@ function provider.user_exists(username)
        return true;
 end
 
+function provider.users()
+       return datamanager.users(host, "accounts");
+end
+
 function provider.create_user(username, password)
        return datamanager.store(username, host, "accounts", {password = password});
 end
@@ -78,5 +82,5 @@ function provider.get_sasl_handler()
        return new_sasl(host, getpass_authentication_profile);
 end
        
-module:add_item("auth-provider", provider);
+module:provides("auth", provider);