Software / code / prosody
Comparison
plugins/mod_console.lua @ 2007:b89d61db74d1
mod_console: Add missing hosts:list() command
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 18 Oct 2009 12:26:53 +0100 |
| parent | 1977:325a49f8edab |
| child | 2009:3f9cce29c57d |
comparison
equal
deleted
inserted
replaced
| 2006:0c62bed9d338 | 2007:b89d61db74d1 |
|---|---|
| 598 end | 598 end |
| 599 hostmanager_deactivate(hostname, reason); | 599 hostmanager_deactivate(hostname, reason); |
| 600 return true, "Host "..tostring(hostname).." deactivated"; | 600 return true, "Host "..tostring(hostname).." deactivated"; |
| 601 end | 601 end |
| 602 | 602 |
| 603 function def_env.host:list() | |
| 604 local print = self.session.print; | |
| 605 local i = 0; | |
| 606 for host in values(array.collect(keys(prosody.hosts)):sort()) do | |
| 607 i = i + 1; | |
| 608 print(host); | |
| 609 end | |
| 610 return true, i.." hosts"; | |
| 611 end | |
| 612 | |
| 603 ------------- | 613 ------------- |
| 604 | 614 |
| 605 function printbanner(session) | 615 function printbanner(session) |
| 606 local option = config.get("*", "core", "console_banner"); | 616 local option = config.get("*", "core", "console_banner"); |
| 607 if option == nil or option == "full" or option == "graphic" then | 617 if option == nil or option == "full" or option == "graphic" then |