#include "module.h" #define AUTHOR "SGR" #define VERSION "1.01" /* ----------------------------------------------------------- * Name: cs_operonly_register * Author: SGR * Date: 16/10/2003 * ----------------------------------------------------------- * Functions: oper_only_chan_reg. * Limitations: NONE KNOWN. * Tested: Ultimate(2.8.x), Unreal(3.2) * ----------------------------------------------------------- * This version has been tested on Ultimate2.8.6, viagra * Unreal and Bahamut. All IRCd's should be compatible with * this module. * * Please set the config options below. * * To DISABLE the notices comment out the #DEFINE lines. * #define DENY_CHAN_REG_AS_NOT_OPER1-6 "Notice text". * i.e * #define DENY_CHAN_REG_AS_NOT_OPER1 "notice text" becomes */ // #define DENY_CHAN_REG_AS_NOT_OPER1 "notice text" /* -----------------------------------------------------------*/ /* ---------------------------------------------------------------------- */ /* START OF CONFIGURATION BLOCK - please read the comments :) */ /* ---------------------------------------------------------------------- */ /* ----------------------------------------------*/ /* ONLY CHANGE WHAT IS INSIDE THE "speach marks" * and limit each line to 400 characters. */ /* ----------------------------------------------*/ /* if you wish to use less than 4 lines, just add // to the beginning of the lines * you do NOT want noticed to a user as shown below for DENY_CHAN_REG_AS_NOT_OPER5 and * DENY_CHAN_REG_AS_NOT_OPER6. */ #define DENY_CHAN_REG_AS_NOT_OPER1 "Sorry, channel registration must be authorised by a" #define DENY_CHAN_REG_AS_NOT_OPER2 "network staff member. Please join #ChanRequest to" #define DENY_CHAN_REG_AS_NOT_OPER3 "Have your channel registered. More information can" #define DENY_CHAN_REG_AS_NOT_OPER4 "be found using: /MOTD" /* To use the following remove the // from the beginning of the line and edit the same way * as the above. */ // #define DENY_CHAN_REG_AS_NOT_OPER5 "Add something" // #define DENY_CHAN_REG_AS_NOT_OPER6 "here - if needed" int oper_only_chan_reg(User * u); int AnopeInit(int argc, char **argv) { Command *c; alog("Loading module cs_operonly_register.so"); c = createCommand("REGISTER", oper_only_chan_reg, NULL,-1,-1,-1,-1,-1); moduleAddCommand(CHANSERV, c, MOD_HEAD); alog("[cs_operonly_register] Channel Registration is now restricted to IRC Operators."); alog("[cs_operonly_register] Yayness!(tm) - MODULE LOADED AND ACTIVE"); moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); return MOD_CONT; } int oper_only_chan_reg(User * u) { if (!(is_oper(u))) { #ifdef DENY_CHAN_REG_AS_NOT_OPER1 notice(s_ChanServ, u->nick, "%s", DENY_CHAN_REG_AS_NOT_OPER1); #endif #ifdef DENY_CHAN_REG_AS_NOT_OPER2 notice(s_ChanServ, u->nick, "%s", DENY_CHAN_REG_AS_NOT_OPER2); #endif #ifdef DENY_CHAN_REG_AS_NOT_OPER3 notice(s_ChanServ, u->nick, "%s", DENY_CHAN_REG_AS_NOT_OPER3); #endif #ifdef DENY_CHAN_REG_AS_NOT_OPER4 notice(s_ChanServ, u->nick, "%s", DENY_CHAN_REG_AS_NOT_OPER4); #endif #ifdef DENY_CHAN_REG_AS_NOT_OPER5 notice(s_ChanServ, u->nick, "%s", DENY_CHAN_REG_AS_NOT_OPER5); #endif #ifdef DENY_CHAN_REG_AS_NOT_OPER6 notice(s_ChanServ, u->nick, "%s", DENY_CHAN_REG_AS_NOT_OPER6); #endif return MOD_STOP; } return MOD_CONT; }