aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-06-09 21:25:59 +0100
committerMatthew Wild <mwild1@gmail.com>2010-06-09 21:25:59 +0100
commit79fcb39d49dc05914c0e26d8273d506b1d3ca781 (patch)
tree8a21a09fc74ab6f8a6ff6c347ad7040462f6460d /plugins
parent10abcc0f7beaf939dd2493a611ae044b287f9f34 (diff)
downloadprosody-79fcb39d49dc05914c0e26d8273d506b1d3ca781.tar.gz
prosody-79fcb39d49dc05914c0e26d8273d506b1d3ca781.zip
mod_auth_internal{,_hashed}: Update is_admin to only report the admin status of the current host (ignores global admin rights), fixes global access traceback
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_auth_internal.lua5
-rw-r--r--plugins/mod_auth_internal_hashed.lua5
2 files changed, 2 insertions, 8 deletions
diff --git a/plugins/mod_auth_internal.lua b/plugins/mod_auth_internal.lua
index 1c426030..42a792e2 100644
--- a/plugins/mod_auth_internal.lua
+++ b/plugins/mod_auth_internal.lua
@@ -95,16 +95,13 @@ function new_default_provider(host)
end
function provider.is_admin(jid)
- local admins = config.get(host, "core", "admins");
+ local admins = module:get_option_array("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
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
return provider;
end
diff --git a/plugins/mod_auth_internal_hashed.lua b/plugins/mod_auth_internal_hashed.lua
index 84487cde..3e5cb17a 100644
--- a/plugins/mod_auth_internal_hashed.lua
+++ b/plugins/mod_auth_internal_hashed.lua
@@ -159,16 +159,13 @@ function new_hashpass_provider(host)
end
function provider.is_admin(jid)
- local admins = config.get(host, "core", "admins");
+ local admins = module:get_option_array("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
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
return provider;
end