# HG changeset patch # User Matthew Wild # Date 1376443624 -3600 # Node ID 05685fd073951fbdc2def46d36a861ad67361a38 # Parent c56a1d449cad00731c726d5571875f9fcc51bf0e mod_auth_external: Re-organise initialization a bit (superficial) diff -r c56a1d449cad -r 05685fd07395 mod_auth_external/mod_auth_external.lua --- a/mod_auth_external/mod_auth_external.lua Tue Aug 13 23:37:31 2013 +0100 +++ b/mod_auth_external/mod_auth_external.lua Wed Aug 14 02:27:04 2013 +0100 @@ -10,18 +10,19 @@ -- local lpty = assert(require "lpty", "mod_auth_external requires lpty: https://code.google.com/p/prosody-modules/wiki/mod_auth_external#Installation"); +local usermanager = require "core.usermanager"; +local new_sasl = require "util.sasl".new; +local server = require "net.server"; +local have_async, async = pcall(require, "util.async"); local log = module._log; local host = module.host; + local script_type = module:get_option_string("external_auth_protocol", "generic"); assert(script_type == "ejabberd" or script_type == "generic", "Config error: external_auth_protocol must be 'ejabberd' or 'generic'"); local command = module:get_option_string("external_auth_command", ""); local read_timeout = module:get_option_number("external_auth_timeout", 5); assert(not host:find(":"), "Invalid hostname"); -local usermanager = require "core.usermanager"; -local new_sasl = require "util.sasl".new; -local server = require "net.server"; -local have_async, async = pcall(require, "util.async"); local blocking = module:get_option_boolean("external_auth_blocking", not(have_async and server.event and lpty.getfd));