Software /
code /
prosody
Comparison
plugins/mod_admin_telnet.lua @ 9391:4001eb3f465a
mod_admin_telnet: Fix local reference to util.iterator
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 29 Sep 2018 16:29:30 +0200 |
parent | 9332:048389a9bbd4 |
child | 9403:4416c1a96400 |
comparison
equal
deleted
inserted
replaced
9390:b749cce57f08 | 9391:4001eb3f465a |
---|---|
875 | 875 |
876 function def_env.host:list() | 876 function def_env.host:list() |
877 local print = self.session.print; | 877 local print = self.session.print; |
878 local i = 0; | 878 local i = 0; |
879 local type; | 879 local type; |
880 for host, host_session in it.sorted_pairs(prosody.hosts) do | 880 for host, host_session in iterators.sorted_pairs(prosody.hosts) do |
881 i = i + 1; | 881 i = i + 1; |
882 type = host_session.type; | 882 type = host_session.type; |
883 if type == "local" then | 883 if type == "local" then |
884 print(host); | 884 print(host); |
885 else | 885 else |
897 | 897 |
898 function def_env.port:list() | 898 function def_env.port:list() |
899 local print = self.session.print; | 899 local print = self.session.print; |
900 local services = portmanager.get_active_services().data; | 900 local services = portmanager.get_active_services().data; |
901 local n_services, n_ports = 0, 0; | 901 local n_services, n_ports = 0, 0; |
902 for service, interfaces in it.sorted_pairs(services) do | 902 for service, interfaces in iterators.sorted_pairs(services) do |
903 n_services = n_services + 1; | 903 n_services = n_services + 1; |
904 local ports_list = {}; | 904 local ports_list = {}; |
905 for interface, ports in pairs(interfaces) do | 905 for interface, ports in pairs(interfaces) do |
906 for port in pairs(ports) do | 906 for port in pairs(ports) do |
907 table.insert(ports_list, "["..interface.."]:"..port); | 907 table.insert(ports_list, "["..interface.."]:"..port); |