1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Hide /MAP and /LINKS in the same form as ircu (mostly useless) */
18 class ModuleMapHide : public Module
22 ModuleMapHide(InspIRCd* Me)
25 // Create a new command
26 ServerInstance->Modules->Attach(I_OnPreCommand, this);
27 ServerInstance->Modules->Attach(I_OnRehash, this);
31 void OnRehash(User* user, const std::string ¶meter)
33 ConfigReader MyConf(ServerInstance);
34 url = MyConf.ReadValue("security", "maphide", 0);
37 int OnPreCommand(std::string &command, std::vector<std::string> ¶meters, User *user, bool validated, const std::string &original_line)
39 if (!IS_OPER(user) && !url.empty() && (command == "MAP" || command == "LINKS"))
41 user->WriteServ("NOTICE %s :/%s has been disabled; visit %s", user->nick.c_str(), command.c_str(), url.c_str());
48 virtual ~ModuleMapHide()
52 virtual Version GetVersion()
54 return Version("$Id$", VF_VENDOR, API_VERSION);
58 MODULE_INIT(ModuleMapHide)