#include "module.h" #define AUTHOR "SGR" #define VERSION "1.03" /* ----------------------------------------------------------- * Name: cs_disablexop * Author: SGR * Date: 09/12/2003 * ----------------------------------------------------------- * Functions: m_cs_SA_only_chan_XOP. * 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 XOP_IS_DISABLED1-6 "Notice text". * i.e * #define XOP_IS_DISABLED1-6 "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 them noticed to a user [as shown below for XOP_IS_DISABLED4,5 and * XOP_IS_DISABLED6. */ #define XOP_IS_DISABLED1 "Sorry, the XOP system is not enabled on this network." #define XOP_IS_DISABLED2 "Please use \002/msg ChanServ HELP LEVELS\002 for more" #define XOP_IS_DISABLED3 "info on configuring your channels access settings." //#define XOP_IS_DISABLED4 "Feel Free to" //#define DENY_CHAN_REG_AS_NOT_OPER5 "Add something" //#define DENY_CHAN_REG_AS_NOT_OPER6 "here - if needed" // #define XOP_ADMIN_ONLY /* ---------------------------------------------------------------------- */ /* DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING */ /* ---------------------------------------------------------------------- */ int m_cs_SA_only_chan_XOP(User * u); int AnopeInit(int argc, char **argv) { Command *c; alog("Loading module cs_disablexop.so"); c = createCommand("SET", m_cs_SA_only_chan_XOP, NULL,-1,-1,-1,-1,-1); moduleAddCommand(CHANSERV, c, MOD_HEAD); alog("[cs_disablexop] Channel XOP setting is now restricted."); alog("[cs_disablexop] Yayness!(tm) - MODULE LOADED AND ACTIVE"); moduleAddAuthor(AUTHOR); moduleAddVersion(VERSION); return MOD_CONT; } int m_cs_SA_only_chan_XOP(User * u) { char *gettext = moduleGetLastBuffer(); char *target = myStrGetToken(gettext,' ',1); if (!target) { return MOD_CONT; } if (stricmp(target,"xop")==0) { #ifndef XOP_ADMIN_ONLY #ifdef XOP_IS_DISABLED1 notice(s_ChanServ, u->nick, XOP_IS_DISABLED1); #endif #ifdef XOP_IS_DISABLED2 notice(s_ChanServ, u->nick, XOP_IS_DISABLED2); #endif #ifdef XOP_IS_DISABLED3 notice(s_ChanServ, u->nick, XOP_IS_DISABLED3); #endif #ifdef XOP_IS_DISABLED4 notice(s_ChanServ, u->nick, XOP_IS_DISABLED4); #endif #ifdef XOP_IS_DISABLED5 notice(s_ChanServ, u->nick, XOP_IS_DISABLED5); #endif #ifdef XOP_IS_DISABLED6 notice(s_ChanServ, u->nick, XOP_IS_DISABLED6); #endif return MOD_STOP; #endif if (!is_services_admin(u)) { #ifdef XOP_IS_DISABLED1 notice(s_ChanServ, u->nick, XOP_IS_DISABLED1); #endif #ifdef XOP_IS_DISABLED2 notice(s_ChanServ, u->nick, XOP_IS_DISABLED2); #endif #ifdef XOP_IS_DISABLED3 notice(s_ChanServ, u->nick, XOP_IS_DISABLED3); #endif #ifdef XOP_IS_DISABLED4 notice(s_ChanServ, u->nick, XOP_IS_DISABLED4); #endif #ifdef XOP_IS_DISABLED5 notice(s_ChanServ, u->nick, XOP_IS_DISABLED5); #endif #ifdef XOP_IS_DISABLED6 notice(s_ChanServ, u->nick, XOP_IS_DISABLED6); #endif return MOD_STOP; } } if (target != NULL) { free(target); } return MOD_CONT; }