Changeset

5377:898454038524

core.*: Complete removal of all traces of the "core" section and section-related code.
author Kim Alvefur <zash@zash.se>
date Sat, 23 Mar 2013 02:33:15 +0100
parents 5376:ba9be0be4bbb
children 5378:ec3accda44d3
files core/certmanager.lua core/hostmanager.lua core/loggingmanager.lua core/moduleapi.lua core/modulemanager.lua core/sessionmanager.lua core/usermanager.lua
diffstat 7 files changed, 20 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/core/certmanager.lua	Sat Mar 23 02:24:11 2013 +0100
+++ b/core/certmanager.lua	Sat Mar 23 02:33:15 2013 +0100
@@ -27,7 +27,7 @@
 module "certmanager"
 
 -- Global SSL options if not overridden per-host
-local default_ssl_config = configmanager.get("*", "core", "ssl");
+local default_ssl_config = configmanager.get("*", "ssl");
 local default_capath = "/etc/ssl/certs";
 local default_verify = (ssl and ssl.x509 and { "peer", "client_once", }) or "none";
 local default_options = { "no_sslv2", luasec_has_noticket and "no_ticket" or nil };
@@ -100,7 +100,7 @@
 end
 
 function reload_ssl_config()
-	default_ssl_config = configmanager.get("*", "core", "ssl");
+	default_ssl_config = configmanager.get("*", "ssl");
 end
 
 prosody.events.add_handler("config-reloaded", reload_ssl_config);
--- a/core/hostmanager.lua	Sat Mar 23 02:24:11 2013 +0100
+++ b/core/hostmanager.lua	Sat Mar 23 02:33:15 2013 +0100
@@ -74,7 +74,7 @@
 		host = host;
 		s2sout = {};
 		events = events_new();
-		dialback_secret = configmanager.get(host, "core", "dialback_secret") or uuid_gen();
+		dialback_secret = configmanager.get(host, "dialback_secret") or uuid_gen();
 		send = host_send;
 		modules = {};
 	};
--- a/core/loggingmanager.lua	Sat Mar 23 02:24:11 2013 +0100
+++ b/core/loggingmanager.lua	Sat Mar 23 02:33:15 2013 +0100
@@ -146,7 +146,7 @@
 	
 	logger.reset();
 
-	local debug_mode = config.get("*", "core", "debug");
+	local debug_mode = config.get("*", "debug");
 
 	default_logging = { { to = "console" , levels = { min = (debug_mode and "debug") or "info" } } };
 	default_file_logging = {
@@ -154,7 +154,7 @@
 	};
 	default_timestamp = "%b %d %H:%M:%S";
 
-	logging_config = config.get("*", "core", "log") or default_logging;
+	logging_config = config.get("*", "log") or default_logging;
 	
 	
 	for name, sink_maker in pairs(old_sink_types) do
--- a/core/moduleapi.lua	Sat Mar 23 02:24:11 2013 +0100
+++ b/core/moduleapi.lua	Sat Mar 23 02:33:15 2013 +0100
@@ -167,12 +167,9 @@
 end
 
 function api:get_option(name, default_value)
-	local value = config.get(self.host, self.name, name);
+	local value = config.get(self.host, name);
 	if value == nil then
-		value = config.get(self.host, "core", name);
-		if value == nil then
-			value = default_value;
-		end
+		value = default_value;
 	end
 	return value;
 end
--- a/core/modulemanager.lua	Sat Mar 23 02:24:11 2013 +0100
+++ b/core/modulemanager.lua	Sat Mar 23 02:33:15 2013 +0100
@@ -44,12 +44,12 @@
 
 -- Load modules when a host is activated
 function load_modules_for_host(host)
-	local component = config.get(host, "core", "component_module");
+	local component = config.get(host, "component_module");
 	
-	local global_modules_enabled = config.get("*", "core", "modules_enabled");
-	local global_modules_disabled = config.get("*", "core", "modules_disabled");
-	local host_modules_enabled = config.get(host, "core", "modules_enabled");
-	local host_modules_disabled = config.get(host, "core", "modules_disabled");
+	local global_modules_enabled = config.get("*", "modules_enabled");
+	local global_modules_disabled = config.get("*", "modules_disabled");
+	local host_modules_enabled = config.get(host, "modules_enabled");
+	local host_modules_disabled = config.get(host, "modules_disabled");
 	
 	if host_modules_enabled == global_modules_enabled then host_modules_enabled = nil; end
 	if host_modules_disabled == global_modules_disabled then host_modules_disabled = nil; end
@@ -218,7 +218,7 @@
 			saved = ret;
 		else
 			log("warn", "Error saving module '%s:%s' state: %s", host, name, ret);
-			if not config.get(host, "core", "force_module_reload") then
+			if not config.get(host, "force_module_reload") then
 				log("warn", "Aborting reload due to error, set force_module_reload to ignore this");
 				return nil, "save-state-failed";
 			else
--- a/core/sessionmanager.lua	Sat Mar 23 02:24:11 2013 +0100
+++ b/core/sessionmanager.lua	Sat Mar 23 02:33:15 2013 +0100
@@ -140,7 +140,7 @@
 		local sessions = hosts[session.host].sessions[session.username].sessions;
 		if sessions[resource] then
 			-- Resource conflict
-			local policy = config_get(session.host, "core", "conflict_resolve");
+			local policy = config_get(session.host, "conflict_resolve");
 			local increment;
 			if policy == "random" then
 				resource = uuid_generate();
--- a/core/usermanager.lua	Sat Mar 23 02:24:11 2013 +0100
+++ b/core/usermanager.lua	Sat Mar 23 02:33:15 2013 +0100
@@ -42,8 +42,8 @@
 	
 	host_session.events.add_handler("item-added/auth-provider", function (event)
 		local provider = event.item;
-		local auth_provider = config.get(host, "core", "authentication") or default_provider;
-		if config.get(host, "core", "anonymous_login") then
+		local auth_provider = config.get(host, "authentication") or default_provider;
+		if config.get(host, "anonymous_login") then
 			log("error", "Deprecated config option 'anonymous_login'. Use authentication = 'anonymous' instead.");
 			auth_provider = "anonymous";
 		end -- COMPAT 0.7
@@ -61,8 +61,8 @@
 		end
 	end);
 	host_session.users = new_null_provider(); -- Start with the default usermanager provider
-	local auth_provider = config.get(host, "core", "authentication") or default_provider;
-	if config.get(host, "core", "anonymous_login") then auth_provider = "anonymous"; end -- COMPAT 0.7
+	local auth_provider = config.get(host, "authentication") or default_provider;
+	if config.get(host, "anonymous_login") then auth_provider = "anonymous"; end -- COMPAT 0.7
 	if auth_provider ~= "null" then
 		modulemanager.load(host, "auth_"..auth_provider);
 	end
@@ -116,8 +116,8 @@
 	jid = jid_bare(jid);
 	host = host or "*";
 	
-	local host_admins = config.get(host, "core", "admins");
-	local global_admins = config.get("*", "core", "admins");
+	local host_admins = config.get(host, "admins");
+	local global_admins = config.get("*", "admins");
 	
 	if host_admins and host_admins ~= global_admins then
 		if type(host_admins) == "table" then