# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1276115159 -3600
# Node ID fd06023cbdcc90e8a10cc24c8660d2dd7bde2530
# Parent  032b81731f0fde1f82ad175193dfaf0c372f6f3f
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

diff -r 032b81731f0f -r fd06023cbdcc plugins/mod_auth_internal.lua
--- a/plugins/mod_auth_internal.lua	Wed Jun 09 21:24:20 2010 +0100
+++ b/plugins/mod_auth_internal.lua	Wed Jun 09 21:25:59 2010 +0100
@@ -95,16 +95,13 @@
 	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 -r 032b81731f0f -r fd06023cbdcc plugins/mod_auth_internal_hashed.lua
--- a/plugins/mod_auth_internal_hashed.lua	Wed Jun 09 21:24:20 2010 +0100
+++ b/plugins/mod_auth_internal_hashed.lua	Wed Jun 09 21:25:59 2010 +0100
@@ -159,16 +159,13 @@
 	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