1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/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 ServerInstance->Modules->Attach(I_OnPreCommand, this);
26 ServerInstance->Modules->Attach(I_OnRehash, this);
30 void OnRehash(User* user)
32 ConfigReader MyConf(ServerInstance);
33 url = MyConf.ReadValue("security", "maphide", 0);
36 ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, User *user, bool validated, const std::string &original_line)
38 if (!IS_OPER(user) && !url.empty() && (command == "MAP" || command == "LINKS"))
40 user->WriteServ("NOTICE %s :/%s has been disabled; visit %s", user->nick.c_str(), command.c_str(), url.c_str());
44 return MOD_RES_PASSTHRU;
47 virtual ~ModuleMapHide()
51 virtual Version GetVersion()
53 return Version("$Id$", VF_VENDOR, API_VERSION);
57 MODULE_INIT(ModuleMapHide)