diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-05-12 23:06:46 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-05-12 23:06:46 +0100 |
commit | b8a433767a1b9279c5c44325d85a3aee696a6e66 (patch) | |
tree | c94cc3998cb2618fe3668acfc583dcb1428cf782 | |
parent | 42d89c47c763d1a9449cc99f7e4bfbfda842048d (diff) | |
download | prosody-b8a433767a1b9279c5c44325d85a3aee696a6e66.tar.gz prosody-b8a433767a1b9279c5c44325d85a3aee696a6e66.zip |
usermanager: Fix logic for per-host admin tables (thanks Maranda)
-rw-r--r-- | core/usermanager.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/usermanager.lua b/core/usermanager.lua index fd579692..e338ebbd 100644 --- a/core/usermanager.lua +++ b/core/usermanager.lua @@ -84,13 +84,15 @@ function new_default_provider(host) function provider.is_admin(jid) local admins = config.get(host, "core", "admins"); - if admins ~= config.get("*", "core", "admins") and type(admins) == "table" then - jid = jid_bare(jid); - for _,admin in ipairs(admins) do - if admin == jid then return true; end + if admins ~= config.get("*", "core", "admins") then + if type(admins) == "table" then + jid = jid_bare(jid); + for _,admin in ipairs(admins) do + if admin == jid then return true; end + end + elseif admins then + log("error", "Option 'admins' for host '%s' is not a table", host); end - elseif admins then - log("error", "Option 'admins' for host '%s' is not a table", host); end return is_admin(jid); -- Test whether it's a global admin instead end |