]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/coremods/core_oper/core_oper.h
Don't update the idle timer when a user replies to a CTCP.
[user/henk/code/inspircd.git] / src / coremods / core_oper / core_oper.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
5  *
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.
9  *
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
13  * details.
14  *
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/>.
17  */
18
19
20 #pragma once
21
22 #include "inspircd.h"
23
24 namespace DieRestart
25 {
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
31          */
32         bool CheckPass(User* user, const std::string& inputpass, const char* confkey);
33
34         /** Send an ERROR to unregistered users and a NOTICE to all registered local users
35          * @param message Message to send
36          */
37         void SendError(const std::string& message);
38 }
39
40 /** Handle /DIE.
41  */
42 class CommandDie : public Command
43 {
44  public:
45         /** Constructor for die.
46          */
47         CommandDie(Module* parent);
48
49         /** Handle command.
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.
53          */
54         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
55 };
56
57 /** Handle /KILL.
58  */
59 class CommandKill : public Command
60 {
61         std::string lastuuid;
62         std::string killreason;
63         ClientProtocol::EventProvider protoev;
64
65  public:
66         /** Constructor for kill.
67          */
68         CommandKill(Module* parent);
69
70         /** Handle command.
71          * @param user User issuing the command
72          * @param parameters Parameters to the command
73          * @return A value from CmdResult to indicate command success or failure.
74          */
75         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
76         RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE;
77
78         void EncodeParameter(std::string& param, unsigned int index) CXX11_OVERRIDE;
79 };
80
81 /** Handle /OPER.
82  */
83 class CommandOper : public SplitCommand
84 {
85  public:
86         /** Constructor for oper.
87          */
88         CommandOper(Module* parent);
89
90         /** Handle command.
91          * @param user User issuing the command
92          * @param parameters Parameters to the command
93          * @return A value from CmdResult to indicate command success or failure.
94          */
95         CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
96 };
97
98 /** Handle /REHASH.
99  */
100 class CommandRehash : public Command
101 {
102  public:
103         /** Constructor for rehash.
104          */
105         CommandRehash(Module* parent);
106
107         /** Handle command.
108          * @param user User issuing the command
109          * @param parameters Parameters to the command
110          * @return A value from CmdResult to indicate command success or failure.
111          */
112         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
113 };
114
115 /** Handle /RESTART
116  */
117 class CommandRestart : public Command
118 {
119  public:
120         /** Constructor for restart.
121          */
122         CommandRestart(Module* parent);
123
124         /** Handle command.
125          * @param user User issuing the command
126          * @param parameters Parameters to the command
127          * @return A value from CmdResult to indicate command success or failure.
128          */
129         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
130 };