]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/cmd_rehash.cpp
No promises, but maybe this will fix issue with disabled commands, reported by relax
[user/henk/code/inspircd.git] / src / cmd_rehash.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 #include "configreader.h"
18 #include "users.h"
19 #include "modules.h"
20 #include "commands/cmd_rehash.h"
21
22
23
24 extern "C" command_t* init_command(InspIRCd* Instance)
25 {
26         return new cmd_rehash(Instance);
27 }
28
29 CmdResult cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user)
30 {
31         user->WriteServ("382 %s %s :Rehashing",user->nick,ServerConfig::CleanFilename(CONFIG_FILE));
32         std::string parameter = "";
33         if (pcnt)
34         {
35                 parameter = parameters[0];
36         }
37         else
38         {
39                 ServerInstance->WriteOpers("%s is rehashing config file %s",user->nick,ServerConfig::CleanFilename(CONFIG_FILE));
40                 ServerInstance->Config->Read(false,user);
41         }
42         InitializeDisabledCommands(ServerInstance->Config->DisabledCommands, ServerInstance);
43         FOREACH_MOD(I_OnRehash,OnRehash(parameter));
44
45         return CMD_SUCCESS;
46 }
47