diff options
author | Kim Alvefur <zash@zash.se> | 2018-03-29 20:51:16 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-03-29 20:51:16 +0200 |
commit | 7af7beb0ea6945cb7d75d7b042397bc059808b53 (patch) | |
tree | 44ae7d0f859d968e3508f110cac422efb9d17694 /prosodyctl | |
parent | 77fbea8cdc788e69aa336aec3f3855f1b6071689 (diff) | |
download | prosody-7af7beb0ea6945cb7d75d7b042397bc059808b53.tar.gz prosody-7af7beb0ea6945cb7d75d7b042397bc059808b53.zip |
prosodyctl: Use prosody.hosts instead of _G.hosts
Diffstat (limited to 'prosodyctl')
-rwxr-xr-x | prosodyctl | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -102,10 +102,10 @@ function commands.adduser(arg) return 1; end - if not hosts[host] then + if not prosody.hosts[host] then show_warning("The host '%s' is not listed in the configuration file (or is not enabled).", host) show_warning("The user will not be able to log in until this is changed."); - hosts[host] = startup.make_host(host); --luacheck: ignore 122/hosts + prosody.hosts[host] = startup.make_host(host); --luacheck: ignore 122 end if prosodyctl.user_exists{ user = user, host = host } then @@ -141,10 +141,10 @@ function commands.passwd(arg) return 1; end - if not hosts[host] then + if not prosody.hosts[host] then show_warning("The host '%s' is not listed in the configuration file (or is not enabled).", host) show_warning("The user will not be able to log in until this is changed."); - hosts[host] = startup.make_host(host); --luacheck: ignore 122/hosts + prosody.hosts[host] = startup.make_host(host); --luacheck: ignore 122 end if not prosodyctl.user_exists { user = user, host = host } then @@ -180,9 +180,9 @@ function commands.deluser(arg) return 1; end - if not hosts[host] then + if not prosody.hosts[host] then show_warning("The host '%s' is not listed in the configuration file (or is not enabled).", host) - hosts[host] = startup.make_host(host); --luacheck: ignore 122/hosts + prosody.hosts[host] = startup.make_host(host); --luacheck: ignore 122 end if not prosodyctl.user_exists { user = user, host = host } then @@ -526,7 +526,7 @@ function cert_commands.config(arg) distinguished_name = table.remove(arg); end local conf = openssl.config.new(); - conf:from_prosody(hosts, configmanager, arg); + conf:from_prosody(prosody.hosts, configmanager, arg); if distinguished_name then local dn = {}; for k, v in distinguished_name:gmatch("/([^=/]+)=([^/]+)") do @@ -751,7 +751,7 @@ function commands.cert(arg) show_message"You need to supply at least one hostname" arg = { "--help" }; end - if arg[1] ~= "--help" and not hosts[arg[1]] then + if arg[1] ~= "--help" and not prosody.hosts[arg[1]] then show_message(error_messages["no-such-host"]); return 1; end |