Software /
code /
prosody
Comparison
plugins/mod_auth_cyrus.lua @ 3291:c06b3f7c92b1
mod_auth_anonymous, mod_auth_cyrus: Removed is_admin(), as usermanager already has a default.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 24 Jun 2010 03:30:51 +0500 |
parent | 3271:1b6c2984c1f4 |
child | 3292:f2ac2ead80b1 |
comparison
equal
deleted
inserted
replaced
3290:1eec2bd19bf7 | 3291:c06b3f7c92b1 |
---|---|
56 function provider.get_sasl_handler() | 56 function provider.get_sasl_handler() |
57 local realm = module:get_option("sasl_realm") or module.host; | 57 local realm = module:get_option("sasl_realm") or module.host; |
58 return new_sasl(realm); | 58 return new_sasl(realm); |
59 end | 59 end |
60 | 60 |
61 function provider.is_admin(jid) | |
62 local admins = config.get(host, "core", "admins"); | |
63 if admins ~= config.get("*", "core", "admins") and type(admins) == "table" then | |
64 jid = jid_bare(jid); | |
65 for _,admin in ipairs(admins) do | |
66 if admin == jid then return true; end | |
67 end | |
68 elseif admins then | |
69 log("error", "Option 'admins' for host '%s' is not a table", host); | |
70 end | |
71 return is_admin(jid); -- Test whether it's a global admin instead | |
72 end | |
73 return provider; | 61 return provider; |
74 end | 62 end |
75 | 63 |
76 module:add_item("auth-provider", new_default_provider(module.host)); | 64 module:add_item("auth-provider", new_default_provider(module.host)); |
77 | 65 |