#include "inspircd.h"
-/* $ModDesc: Provides /CLOSE functionality */
-
/** Handle /CLOSE
*/
class CommandClose : public Command
/* Command 'close', needs operator */
CommandClose(Module* Creator) : Command(Creator,"CLOSE", 0)
{
- flags_needed = 'o'; }
+ flags_needed = 'o';
+ }
CmdResult Handle (const std::vector<std::string> ¶meters, User *src)
{
std::map<std::string,int> closed;
- for (LocalUserList::const_iterator u = ServerInstance->Users->local_users.begin(); u != ServerInstance->Users->local_users.end(); ++u)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator u = list.begin(); u != list.end(); )
{
+ // Quitting the user removes it from the list
LocalUser* user = *u;
+ ++u;
if (user->registered != REG_ALL)
{
ServerInstance->Users->QuitUser(user, "Closing all unknown connections per request");
{
}
- void init() CXX11_OVERRIDE
- {
- ServerInstance->Modules->AddService(cmd);
- }
-
Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides /CLOSE functionality", VF_VENDOR);