* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2010 InspIRCd Development Team
* See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
{
bool& locked;
public:
- CommandLockserv (InspIRCd* Instance, Module* Creator, bool& lock)
- : Command(Instance, Creator, "LOCKSERV", "o", 0), locked(lock)
+ CommandLockserv(Module* Creator, bool& lock) : Command(Creator, "LOCKSERV", 0), locked(lock)
{
- syntax.clear();
+ flags_needed = 'o'; syntax.clear();
}
CmdResult Handle (const std::vector<std::string> ¶meters, User *user)
{
locked = true;
- user->WriteNumeric(988, "%s %s :Closed for new connections", user->nick.c_str(), user->server);
+ user->WriteNumeric(988, "%s %s :Closed for new connections", user->nick.c_str(), user->server.c_str());
ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used LOCKSERV to temporarily close for new connections", user->nick.c_str());
/* Dont send to the network */
- return CMD_LOCALONLY;
+ return CMD_SUCCESS;
}
};
bool& locked;
public:
- CommandUnlockserv (InspIRCd* Instance, Module* Creator, bool &lock)
- : Command(Instance, Creator, "UNLOCKSERV", "o", 0), locked(lock)
+ CommandUnlockserv(Module* Creator, bool &lock) : Command(Creator, "UNLOCKSERV", 0), locked(lock)
{
- syntax.clear();
+ flags_needed = 'o'; syntax.clear();
}
CmdResult Handle (const std::vector<std::string> ¶meters, User *user)
{
locked = false;
- user->WriteNumeric(989, "%s %s :Open for new connections", user->nick.c_str(), user->server);
+ user->WriteNumeric(989, "%s %s :Open for new connections", user->nick.c_str(), user->server.c_str());
ServerInstance->SNO->WriteGlobalSno('a', "Oper %s used UNLOCKSERV to allow for new connections", user->nick.c_str());
/* Dont send to the network */
- return CMD_LOCALONLY;
+ return CMD_SUCCESS;
}
};
}
public:
- ModuleLockserv(InspIRCd* Me) : Module(Me), lockcommand(Me, this, locked), unlockcommand(Me, this, locked)
+ ModuleLockserv() : lockcommand(this, locked), unlockcommand(this, locked)
{
ResetLocked();
ServerInstance->AddCommand(&lockcommand);
ResetLocked();
}
- virtual ModResult OnUserRegister(User* user)
+ virtual ModResult OnUserRegister(LocalUser* user)
{
if (locked)
{
return MOD_RES_PASSTHRU;
}
- virtual ModResult OnCheckReady(User* user)
+ virtual ModResult OnCheckReady(LocalUser* user)
{
return locked ? MOD_RES_DENY : MOD_RES_PASSTHRU;
}
virtual Version GetVersion()
{
- return Version("$Id$", VF_VENDOR, API_VERSION);
+ return Version("Allows locking of the server to stop all incoming connections till unlocked again", VF_VENDOR);
}
};