* ---------------------------------------------------
*/
-/* $Core: libIRCDmode */
+/* $Core */
/* $ExtraDeps: $(RELCPPFILES) */
/* $ExtraObjects: modes/modeclasses.a */
/* $ExtraBuild: @${MAKE} -C "modes" DIRNAME="src/modes" CC="$(CC)" $(MAKEARGS) CPPFILES="$(CPPFILES)" */
#include "modes/cmode_h.h"
/* +v (channel voice) */
#include "modes/cmode_v.h"
-/* +s (server notices) */
-#include "modes/umode_s.h"
/* +w (see wallops) */
#include "modes/umode_w.h"
/* +i (invisible) */
#include "modes/umode_i.h"
/* +o (operator) */
#include "modes/umode_o.h"
-/* +n (notice mask - our implementation of snomasks) */
-#include "modes/umode_n.h"
+/* +s (server notice masks) */
+#include "modes/umode_s.h"
ModeHandler::ModeHandler(InspIRCd* Instance, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly, char mprefix, char prefixrequired)
: ServerInstance(Instance), mode(modeletter), n_params_on(parameters_on), n_params_off(parameters_off), list(listmode), m_type(type), oper(operonly), prefix(mprefix), count(0), prefixneeded(prefixrequired)
if (abort)
continue;
+ /* If it's disabled, they have to be an oper.
+ */
+ if (IS_LOCAL(user) && !IS_OPER(user) && ((type == MODETYPE_CHANNEL ? ServerInstance->Config->DisabledCModes : ServerInstance->Config->DisabledUModes)[modehandlers[handler_id]->GetModeChar() - 'A']))
+ {
+ user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Permission Denied - %s mode %c has been locked by the administrator",
+ user->nick.c_str(),
+ type == MODETYPE_CHANNEL ? "channel" : "user",
+ modehandlers[handler_id]->GetModeChar());
+ continue;
+ }
+
/* It's an oper only mode, check if theyre an oper. If they arent,
* eat any parameter that came with the mode, and continue to next
*/
new ModeChannelOp(Instance),
new ModeChannelHalfOp(Instance),
new ModeChannelVoice(Instance),
- new ModeUserServerNotice(Instance),
new ModeUserWallops(Instance),
new ModeUserInvisible(Instance),
new ModeUserOperator(Instance),
this->AddMode(modes[index]);
seq = 0;
- memset(&sent, 0, 256);
+ memset(&sent, 0, sizeof(sent));
}