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(User* user, const Params& parameters) CXX11_OVERRIDE;
59 class CommandKill : public Command
62 std::string killreason;
63 ClientProtocol::EventProvider protoev;
66 /** Set to a non empty string to obfuscate nicknames prepended to a KILL. */
69 /** Set to hide kills from clients of ulined servers in snotices. */
72 /** Constructor for kill.
74 CommandKill(Module* parent);
77 * @param user User issuing the command
78 * @param parameters Parameters to the command
79 * @return A value from CmdResult to indicate command success or failure.
81 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
82 RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE;
84 void EncodeParameter(std::string& param, unsigned int index) CXX11_OVERRIDE;
89 class CommandOper : public SplitCommand
92 /** Constructor for oper.
94 CommandOper(Module* parent);
97 * @param user User issuing the command
98 * @param parameters Parameters to the command
99 * @return A value from CmdResult to indicate command success or failure.
101 CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
106 class CommandRehash : public Command
109 /** Constructor for rehash.
111 CommandRehash(Module* parent);
114 * @param user User issuing the command
115 * @param parameters Parameters to the command
116 * @return A value from CmdResult to indicate command success or failure.
118 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
123 class CommandRestart : public Command
126 /** Constructor for restart.
128 CommandRestart(Module* parent);
131 * @param user User issuing the command
132 * @param parameters Parameters to the command
133 * @return A value from CmdResult to indicate command success or failure.
135 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;