2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
6 * This file is part of InspIRCd. InspIRCd is free software: you can
7 * redistribute it and/or modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation, version 2.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 /** Checks a die or restart password
27 * @param user The user executing /DIE or /RESTART
28 * @param inputpass The password given by the user
29 * @param confkey The name of the key in the power tag containing the correct password
30 * @return True if the given password was correct, false if it was not
32 bool CheckPass(User* user, const std::string& inputpass, const char* confkey);
37 class CommandDie : public Command
40 /** Constructor for die.
42 CommandDie(Module* parent);
45 * @param parameters The parameters to the command
46 * @param user The user issuing the command
47 * @return A value from CmdResult to indicate command success or failure.
49 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
54 class CommandKill : public Command
57 std::string killreason;
60 /** Constructor for kill.
62 CommandKill(Module* parent);
65 * @param parameters The parameters to the command
66 * @param user The user issuing the command
67 * @return A value from CmdResult to indicate command success or failure.
69 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
70 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
72 void EncodeParameter(std::string& param, int index);
77 class CommandOper : public SplitCommand
80 /** Constructor for oper.
82 CommandOper(Module* parent);
85 * @param parameters The parameters to the command
86 * @param user The user issuing the command
87 * @return A value from CmdResult to indicate command success or failure.
89 CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user);
94 class CommandRehash : public Command
97 /** Constructor for rehash.
99 CommandRehash(Module* parent);
102 * @param parameters The parameters to the command
103 * @param user The user issuing the command
104 * @return A value from CmdResult to indicate command success or failure.
106 CmdResult Handle(const std::vector<std::string>& parameters, User *user);
111 class CommandRestart : public Command
114 /** Constructor for restart.
116 CommandRestart(Module* parent);
119 * @param parameters The parameters to the command
120 * @param user The user issuing the command
121 * @return A value from CmdResult to indicate command success or failure.
123 CmdResult Handle(const std::vector<std::string>& parameters, User* user);