MUC: Assign priorities to config form hooks so they have a consistent order on each...
[prosody.git] / plugins / mod_auth_anonymous.lua
index 761dc8a476aa4217524f7d46d32d7ec1ec5d2342..8de46f8c27a32bc870c65f60eb9d60f82328c5ff 100644 (file)
@@ -8,9 +8,10 @@
 
 local new_sasl = require "util.sasl".new;
 local datamanager = require "util.datamanager";
+local hosts = prosody.hosts;
 
 -- define auth provider
-local provider = { name = "anonymous" };
+local provider = {};
 
 function provider.test_password(username, password)
        return nil, "Password based auth not supported.";
@@ -41,6 +42,10 @@ function provider.get_sasl_handler()
        return new_sasl(module.host, anonymous_authentication_profile);
 end
 
+function provider.users()
+       return next, hosts[module.host].sessions, nil;
+end
+
 -- datamanager callback to disable writes
 local function dm_callback(username, host, datastore, data)
        if host == module.host then
@@ -62,5 +67,5 @@ function module.unload()
        datamanager.remove_callback(dm_callback);
 end
 
-module:add_item("auth-provider", provider);
+module:provides("auth", provider);