usermanager: Check host exists before trying to look up admins for it
[prosody.git] / prosody
diff --git a/prosody b/prosody
index 48977c30ce5a7d69620c5a2582d9662c3aedd2a1..86e82490a8f460aba9b83e5435c56bc58cb86e10 100755 (executable)
--- a/prosody
+++ b/prosody
@@ -184,9 +184,14 @@ function init_global_state()
        prosody.hosts = hosts;
        
        local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data";
-       CFG_PLUGINDIR = config.get("*", "core", "plugin_path") or CFG_PLUGINDIR or "plugins"
+       local custom_plugin_paths = config.get("*", "core", "plugin_paths");
+       if custom_plugin_paths then
+               local path_sep = package.config:sub(3,3);
+               -- path1;path2;path3;defaultpath...
+               CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins");
+       end
        prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR, 
-                         plugins = CFG_PLUGINDIR, data = data_path };
+                         plugins = CFG_PLUGINDIR or "plugins", data = data_path };
 
        prosody.arg = _G.arg;
 
@@ -340,6 +345,7 @@ function load_secondary_libraries()
        ]]
 
        require "net.connlisteners";
+       require "net.httpserver";
        
        require "util.stanza"
        require "util.jid"