From 04363ca342914ba75e693edb876cbe535839fa79 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 13 Feb 2009 00:00:05 +0100 Subject: Einfache Abfrage der Benutzerdatenbank implementiert --- src/Client/CommandParser.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/Client/CommandParser.cpp') diff --git a/src/Client/CommandParser.cpp b/src/Client/CommandParser.cpp index efc9c4b..304a2ff 100644 --- a/src/Client/CommandParser.cpp +++ b/src/Client/CommandParser.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -40,13 +41,14 @@ namespace Mad { namespace Client { const CommandParser::Command CommandParser::commands[] = { - {{"fsinfo", 0}, "fsinfo [host]", "Displays file system usage information", "Displays file system usage information of a host or the server (if no host is given).", &CommandParser::fsinfoCommand}, - {{"help", "?", 0}, "help [command]", "Displays usage information about commands", "Displays usage information about a command. If no command is given, a list of all available commands is displayed.", &CommandParser::helpCommand}, - {{"list_hosts", "hosts", 0}, "list_hosts [-a]", "Lists the currently active hosts", "Lists the currently active hosts.\n\n -a\tAlso list inactive hosts", &CommandParser::listHostsCommand}, - {{"reboot", 0}, "reboot *|host...", "Reboots host", "Reboots hosts. * will reboot all hosts.", &CommandParser::rebootCommand}, - {{"shutdown", "halt", 0}, "shutdown *|host...", "Shuts hosts down", "Shuts hosts down. * will shut down all hosts.", &CommandParser::shutdownCommand}, - {{"status", "st", 0}, "status [host]", "Displays status information", "Displays host status information. If no host is given, server status information is displayed.", &CommandParser::statusCommand}, - {{"exit", "quit", 0}, "exit", "Closes the connection and quits the client", "Closes the connection and quits the client.", &CommandParser::exitCommand}, + {{"fsinfo", 0}, "fsinfo [host]", "Display file system usage information", "Display file system usage information of a host or the server (if no host is given).", &CommandParser::fsinfoCommand}, + {{"help", "?", 0}, "help [command]", "Display usage information about commands", "Display usage information about a command. If no command is given, display a list of all available commands.", &CommandParser::helpCommand}, + {{"list_hosts", "hosts", 0}, "list_hosts [-a]", "List the currently active hosts", "List the currently active hosts.\n\n -a\tAlso list inactive hosts", &CommandParser::listHostsCommand}, + {{"reboot", 0}, "reboot *|host...", "Reboot host", "Reboot hosts. * will reboot all hosts.", &CommandParser::rebootCommand}, + {{"shutdown", "halt", 0}, "shutdown *|host...", "Shut hosts down", "Shut hosts down. * will shut down all hosts.", &CommandParser::shutdownCommand}, + {{"status", "st", 0}, "status [host]", "Display status information", "Display host status information. If no host is given, display server status information.", &CommandParser::statusCommand}, + {{"list_users", "users", 0}, "list_users", "Show the user account database", "Show the user account database.", &CommandParser::listUsersCommand}, + {{"exit", "quit", 0}, "exit", "Close the connection and quit the client", "Closes the connection and quits the client.", &CommandParser::exitCommand}, {{0}, 0, 0, 0, 0} }; @@ -253,6 +255,12 @@ void CommandParser::statusCommand(const std::vector &args) { ++CommandManager::get()->activeRequests; } +void CommandParser::listUsersCommand(const std::vector&) { + ++CommandManager::get()->activeRequests; + + Common::RequestManager::get()->sendRequest(connection, std::auto_ptr(new Common::Requests::UserListRequest(sigc::mem_fun(CommandManager::get(), &CommandManager::userListRequestFinished)))); +} + void CommandParser::exitCommand(const std::vector&) { ++CommandManager::get()->activeRequests; -- cgit v1.2.3