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: Prevents users who's nicks are not registered from creating new channels */
18 class ModuleRegOnlyCreate : public Module
21 ModuleRegOnlyCreate(InspIRCd* Me)
24 Implementation eventlist[] = { I_OnUserPreJoin };
25 ServerInstance->Modules->Attach(eventlist, this, 1);
29 virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
37 if ((!user->IsModeSet('r')) && (!user->GetExt("accountname")))
39 // XXX. there may be a better numeric for this..
40 user->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :You must have a registered nickname to create a new channel", user->nick.c_str(), cname);
47 virtual ~ModuleRegOnlyCreate()
51 virtual Version GetVersion()
53 return Version("$Id$", VF_VENDOR, API_VERSION);
57 MODULE_INIT(ModuleRegOnlyCreate)