Diff

plugins/mod_auth_internal.lua @ 3219:fd06023cbdcc

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
author Matthew Wild <mwild1@gmail.com>
date Wed, 09 Jun 2010 21:25:59 +0100
parent 3187:a475fbce1990
child 3272:5ad2710d7bb8
line wrap: on
line diff
--- 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