#include "module.h" #define AUTHOR "SGR" #define VERSION "1.01" /* ----------------------------------------------------------- * Name: ns_operonly_register * Author: SGR * Date: 05/11/2003 * ----------------------------------------------------------- * Functions: oper_only_NICK_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. * * I should add some credit for 'mouse' here as he did upload * the original version. [It was his idea :p] All ive changed * is the default global constants to make it more official as * standard and sorted out a minor annoyance where he assumed * NICKSERV was the name for the s_NickServ Clients on all * nets. * * * Please set the config options below. * * To DISABLE the notices comment out the #DEFINE lines. * #define DENY_NICK_REG_AS_NOT_OPER1-6 "Notice text". * i.e * #define DENY_NICK_REG_AS_NOT_OPER1 "notice text" becomes */ // #define DENY_NICK_REG_AS_NOT_OPER1 "notice text" /* -----------------------------------------------------------*/ /* ---------------------------------------------------------------------- */ /* START OF CONFIGURATION BLOCK - please read the comments :) */ /* ---------------------------------------------------------------------- */ /* ----------------------------------------------*/ /* ONLY NICKGE 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_NICK_REG_AS_NOT_OPER5 and * DENY_NICK_REG_AS_NOT_OPER6. */ #define DENY_NICK_REG_AS_NOT_OPER1 "Users are not permitted to register with NickServ on" #define DENY_NICK_REG_AS_NOT_OPER2 "this network. To have your nick registered for you" #define DENY_NICK_REG_AS_NOT_OPER3 "please join the network HELP room told of in /MOTD." /* To use the following remove the // from the beginning of the line and edit the same way * as the above. */ // #define DENY_NICK_REG_AS_NOT_OPER4 " Feel free to" // #define DENY_NICK_REG_AS_NOT_OPER5 "Add something" // #define DENY_NICK_REG_AS_NOT_OPER6 "here - if needed" int oper_only_nick_reg(User * u); int AnopeInit(int argc, char **argv) { Command *c; alog("Loading module ns_operonly_register.so"); c = createCommand("REGISTER", oper_only_nick_reg, NULL,-1,-1,-1,-1,-1); moduleAddCommand(NICKSERV, c, MOD_HEAD); alog("[ns_operonly_register] %s registration is now restricted to IRC Operators.", s_NickServ); alog("[ns_operonly_register] Yayness!(tm) - MODULE LOADED AND ACTIVE"); return MOD_CONT; } int oper_only_nick_reg(User * u) { if (!(is_oper(u))) { #ifdef DENY_NICK_REG_AS_NOT_OPER1 notice(s_NickServ, u->nick, "%s", DENY_NICK_REG_AS_NOT_OPER1); #endif #ifdef DENY_NICK_REG_AS_NOT_OPER2 notice(s_NickServ, u->nick, "%s", DENY_NICK_REG_AS_NOT_OPER2); #endif #ifdef DENY_NICK_REG_AS_NOT_OPER3 notice(s_NickServ, u->nick, "%s", DENY_NICK_REG_AS_NOT_OPER3); #endif #ifdef DENY_NICK_REG_AS_NOT_OPER4 notice(s_NickServ, u->nick, "%s", DENY_NICK_REG_AS_NOT_OPER4); #endif #ifdef DENY_NICK_REG_AS_NOT_OPER5 notice(s_NickServ, u->nick, "%s", DENY_NICK_REG_AS_NOT_OPER5); #endif #ifdef DENY_NICK_REG_AS_NOT_OPER6 notice(s_NickServ, u->nick, "%s", DENY_NICK_REG_AS_NOT_OPER6); #endif return MOD_STOP; } return MOD_CONT; }