util.sasl.plain: Adding plain_hashed authentication backend support.
[prosody.git] / prosodyctl
index 8b2485ad59114bf54ce17d9db24f90833dff49c5..ccc1e2f9cfe5d86f8d3d55353d3842911aad35be 100755 (executable)
@@ -29,14 +29,6 @@ if CFG_DATADIR then
        end
 end
 
--- Global 'prosody' object
-prosody = {
-       hosts = {},
-       events = require "util.events".new(),
-       platform = "posix"
-};
-local prosody = prosody;
-
 config = require "core.configmanager"
 
 do
@@ -71,6 +63,8 @@ if not require "util.dependencies".check_dependencies() then
        os.exit(1);
 end
 
+prosody = { hosts = {}, events = events, platform = "posix" };
+
 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data";
 require "util.datamanager".set_data_path(data_path);
 
@@ -120,10 +114,12 @@ local error_messages = setmetatable({
                ["not-running"] = "Prosody is not running";
                }, { __index = function (t,k) return "Error: "..(tostring(k):gsub("%-", " "):gsub("^.", string.upper)); end });
 
+local events = require "util.events".new();
+
 hosts = prosody.hosts;
 
 for hostname, config in pairs(config.getconfig()) do
-       hosts[hostname] = { events = prosody.events };
+       hosts[hostname] = { events = events };
 end
        
 require "core.modulemanager"