Merge with 0.9
authorMatthew Wild <mwild1@gmail.com>
Wed, 08 Feb 2012 16:20:07 +0100
changeset 4500 bfa387f268e2
parent 4496 11983a1e92c0 (current diff)
parent 4499 55ef5d83d00a (diff)
child 4503 6dc327809dfd
Merge with 0.9
util/prosodyctl.lua
--- a/prosody.cfg.lua.dist	Sun Feb 05 00:10:13 2012 +0500
+++ b/prosody.cfg.lua.dist	Wed Feb 08 16:20:07 2012 +0100
@@ -45,7 +45,6 @@
 		--"compression"; -- Stream compression
 
 	-- Nice to have
-		"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
 		"version"; -- Replies to server version requests
 		"uptime"; -- Report how long server has been running
 		"time"; -- Let others know the time here on this server
@@ -67,6 +66,7 @@
 		--"welcome"; -- Welcome users who register accounts
 		--"watchregistrations"; -- Alert admins of registrations
 		--"motd"; -- Send a message to users when they log in
+		--"legacyauth"; -- Legacy authentication. Only used by some old clients and bots.
 };
 
 -- These modules are auto-loaded, should you
--- a/util/prosodyctl.lua	Sun Feb 05 00:10:13 2012 +0500
+++ b/util/prosodyctl.lua	Wed Feb 08 16:20:07 2012 +0100
@@ -136,7 +136,11 @@
 		return false, "invalid-hostname";
 	end
 
-	local provider = prosody.hosts[host].users;
+	local host = prosody.hosts[host];
+	if not host then
+		return false, "no-such-host";
+	end
+	local provider = host.users;
 	if not(provider) or provider.name == "null" then
 		usermanager.initialize_host(host);
 	end