#include "inspircd.h"
+#include "core_oper.h"
-/** Handle /RESTART
- */
-class CommandRestart : public Command
+CommandRestart::CommandRestart(Module* parent)
+ : Command(parent, "RESTART", 1, 1)
{
- public:
- /** Constructor for restart.
- */
- CommandRestart(Module* parent) : Command(parent,"RESTART",1,1) { flags_needed = 'o'; syntax = "<password>"; }
- /** Handle command.
- * @param parameters The parameters to the command
- * @param user The user issuing the command
- * @return A value from CmdResult to indicate command success or failure.
- */
- CmdResult Handle(const std::vector<std::string>& parameters, User *user);
-};
+ flags_needed = 'o';
+ syntax = "<password>";
+}
CmdResult CommandRestart::Handle (const std::vector<std::string>& parameters, User *user)
{
ServerInstance->Logs->Log("COMMAND", LOG_DEFAULT, "Restart: %s",user->nick.c_str());
- if (ServerInstance->PassCompare(user, ServerInstance->Config->restartpass, parameters[0], ServerInstance->Config->powerhash))
+ if (DieRestart::CheckPass(user, parameters[0], "restartpass"))
{
ServerInstance->SNO->WriteGlobalSno('a', "RESTART command from %s, restarting server.", user->GetFullRealHost().c_str());
}
return CMD_FAILURE;
}
-
-
-COMMAND_INIT(CommandRestart)