#include "inspircd.h"
+#include "exitcodes.h"
+#include "core_oper.h"
-/** Handle /DIE.
- */
-class CommandDie : public Command
+CommandDie::CommandDie(Module* parent)
+ : Command(parent, "DIE", 1)
{
- public:
- /** Constructor for die.
- */
- CommandDie ( Module* parent) : Command(parent,"DIE",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);
-};
-
-#include "exitcodes.h"
+ flags_needed = 'o';
+ syntax = "<password>";
+}
/** Handle /DIE
*/
CmdResult CommandDie::Handle (const std::vector<std::string>& parameters, User *user)
{
- if (ServerInstance->PassCompare(user, ServerInstance->Config->diepass, parameters[0], ServerInstance->Config->powerhash))
+ if (DieRestart::CheckPass(user, parameters[0], "diepass"))
{
{
std::string diebuf = "*** DIE command from " + user->GetFullHost() + ". Terminating.";
}
return CMD_SUCCESS;
}
-
-COMMAND_INIT(CommandDie)