1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 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 * ---------------------------------------------------
15 #include "u_listmode.h"
17 /* $ModDep: ../../include/u_listmode.h */
19 /* $ModDesc: Implements extban/invex +I O: - opertype bans */
21 class ModuleGecosBan : public Module
25 ModuleGecosBan(InspIRCd* Me) : Module(Me)
27 Implementation eventlist[] = { I_OnUserPreJoin, I_On005Numeric };
28 ServerInstance->Modules->Attach(eventlist, this, 2);
31 virtual ~ModuleGecosBan()
35 virtual Version GetVersion()
37 return Version("$Id$", VF_VENDOR, API_VERSION);
40 virtual int OnCheckInvite(User *user, Channel *c)
42 if (!IS_LOCAL(user) || !IS_OPER(user))
45 Module* ExceptionModule = ServerInstance->Modules->Find("m_inviteexception.so");
48 if (ListModeRequest(this, ExceptionModule, user->oper, 'O', c).Send())
50 // Oper type is exempt
58 virtual int OnUserPreJoin(User *user, Channel *c, const char *cname, std::string &privs, const std::string &key)
60 if (!IS_LOCAL(user) || !IS_OPER(user))
66 if (c->IsExtBanned(user->oper, 'O'))
68 user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Cannot join channel (You're banned)", user->nick.c_str(), c->name.c_str());
75 virtual void On005Numeric(std::string &output)
77 ServerInstance->AddExtBanChar('O');
82 MODULE_INIT(ModuleGecosBan)