Software / code / prosody
Comparison
plugins/mod_admin_telnet.lua @ 5167:ecd9e300ec94
mod_admin_telnet: user:list() check that the given host exists
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 12 Oct 2012 18:33:24 +0200 |
| parent | 5159:0638ff1e1a5a |
| child | 5168:46fc0eff10b4 |
comparison
equal
deleted
inserted
replaced
| 5165:39bb9344f194 | 5167:ecd9e300ec94 |
|---|---|
| 954 end | 954 end |
| 955 | 955 |
| 956 function def_env.user:list(host) | 956 function def_env.user:list(host) |
| 957 if not host then | 957 if not host then |
| 958 return nil, "No host given"; | 958 return nil, "No host given"; |
| 959 elseif not hosts[host] then | |
| 960 return nil, "No such host"; | |
| 959 end | 961 end |
| 960 local print = self.session.print; | 962 local print = self.session.print; |
| 961 for user in um.users(host) do | 963 for user in um.users(host) do |
| 962 print(user.."@"..host); | 964 print(user.."@"..host); |
| 963 end | 965 end |