aboutsummaryrefslogtreecommitdiffstats
path: root/core/usermanager.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-10-21 11:39:02 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-10-21 11:39:02 +0500
commit057cf59598c1fa755fbbb7a0c9e55b40fc00ce78 (patch)
tree8e940747ed05b73527b27d825c1e7e37538d5125 /core/usermanager.lua
parent2eb8cf191a1cfdeedf38c18b8ad07d2b8f760581 (diff)
downloadprosody-057cf59598c1fa755fbbb7a0c9e55b40fc00ce78.tar.gz
prosody-057cf59598c1fa755fbbb7a0c9e55b40fc00ce78.zip
usermanager: Changed function is_admin to allow checking for host-specific admins.
Diffstat (limited to 'core/usermanager.lua')
-rw-r--r--core/usermanager.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/usermanager.lua b/core/usermanager.lua
index 6c36fa29..04154cdb 100644
--- a/core/usermanager.lua
+++ b/core/usermanager.lua
@@ -66,8 +66,12 @@ function get_supported_methods(host)
return {["PLAIN"] = true, ["DIGEST-MD5"] = true}; -- TODO this should be taken from the config
end
-function is_admin(jid)
- local admins = config.get("*", "core", "admins");
+function is_admin(jid, host)
+ host = host or "*";
+ local admins = config.get(host, "core", "admins");
+ if host ~= "*" and admins == config.get("*", "core", "admins") then
+ return nil;
+ end
if type(admins) == "table" then
jid = jid_bare(jid);
for _,admin in ipairs(admins) do