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);
34 /** Send an ERROR to unregistered users and a NOTICE to all registered local users
35 * @param message Message to send
37 void SendError(const std::string& message);
42 class CommandDie : public Command
45 /** Constructor for die.
47 CommandDie(Module* parent);
50 * @param parameters The parameters to the command
51 * @param user The user issuing the command
52 * @return A value from CmdResult to indicate command success or failure.
54 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
59 class CommandKill : public Command
62 std::string killreason;
65 /** Constructor for kill.
67 CommandKill(Module* parent);
70 * @param parameters The parameters to the command
71 * @param user The user issuing the command
72 * @return A value from CmdResult to indicate command success or failure.
74 CmdResult Handle(const std::vector<std::string>& parameters, User* user);
75 RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
77 void EncodeParameter(std::string& param, unsigned int index);
82 class CommandOper : public SplitCommand
85 /** Constructor for oper.
87 CommandOper(Module* parent);
90 * @param parameters The parameters to the command
91 * @param user The user issuing the command
92 * @return A value from CmdResult to indicate command success or failure.
94 CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user);
99 class CommandRehash : public Command
102 /** Constructor for rehash.
104 CommandRehash(Module* parent);
107 * @param parameters The parameters to the command
108 * @param user The user issuing the command
109 * @return A value from CmdResult to indicate command success or failure.
111 CmdResult Handle(const std::vector<std::string>& parameters, User *user);
116 class CommandRestart : public Command
119 /** Constructor for restart.
121 CommandRestart(Module* parent);
124 * @param parameters The parameters to the command
125 * @param user The user issuing the command
126 * @return A value from CmdResult to indicate command success or failure.
128 CmdResult Handle(const std::vector<std::string>& parameters, User* user);