+ ServerInstance->SNO->WriteToSnoMask('G',std::string(source->nick)+" used oper override to change a topic on "+std::string(channel->name));
+ }
+
+ // Explicit allow
+ return -1;
+ }
+
+ return 0;
+ }
+
+ virtual int OnUserPreKick(User* source, User* user, Channel* chan, const std::string &reason)
+ {
+ if (IS_OPER(source) && CanOverride(source,"KICK"))
+ {
+ // If the kicker's status is less than the target's, or the kicker's status is less than or equal to voice
+ if ((chan->GetStatus(source) < chan->GetStatus(user)) || (chan->GetStatus(source) <= STATUS_VOICE))
+ {
+ ServerInstance->SNO->WriteToSnoMask('G',std::string(source->nick)+" used oper override to kick "+std::string(user->nick)+" on "+std::string(chan->name)+" ("+reason+")");
+ }
+ /* Returning -1 explicitly allows the kick */
+ return -1;
+ }
+ return 0;
+ }
+
+ virtual int OnAccessCheck(User* source,User* dest,Channel* channel,int access_type)
+ {
+ if (IS_OPER(source))
+ {
+ if (source && channel)
+ {
+ // Fix by brain - allow the change if they arent on channel - rely on boolean short-circuit
+ // to not check the other items in the statement if they arent on the channel
+ int mode = channel->GetStatus(source);
+ switch (access_type)
+ {
+ case AC_DEOP:
+ if (CanOverride(source,"MODEDEOP"))
+ {
+ if ((!channel->HasUser(source)) || (mode < STATUS_OP))
+ OverDeops++;
+ return ACR_ALLOW;
+ }
+ else
+ {
+ return ACR_DEFAULT;
+ }
+ break;
+ case AC_OP:
+ if (CanOverride(source,"MODEOP"))
+ {
+ if ((!channel->HasUser(source)) || (mode < STATUS_OP))
+ OverOps++;
+ return ACR_ALLOW;
+ }
+ else
+ {
+ return ACR_DEFAULT;
+ }
+ break;
+ case AC_VOICE:
+ if (CanOverride(source,"MODEVOICE"))
+ {
+ if ((!channel->HasUser(source)) || (mode < STATUS_HOP))
+ OverVoices++;
+ return ACR_ALLOW;
+ }
+ else
+ {
+ return ACR_DEFAULT;
+ }
+ break;
+ case AC_DEVOICE:
+ if (CanOverride(source,"MODEDEVOICE"))
+ {
+ if ((!channel->HasUser(source)) || (mode < STATUS_HOP))
+ OverDevoices++;
+ return ACR_ALLOW;
+ }
+ else
+ {
+ return ACR_DEFAULT;
+ }
+ break;
+ case AC_HALFOP:
+ if (CanOverride(source,"MODEHALFOP"))
+ {
+ if ((!channel->HasUser(source)) || (mode < STATUS_OP))
+ OverHalfops++;
+ return ACR_ALLOW;
+ }
+ else
+ {
+ return ACR_DEFAULT;
+ }
+ break;
+ case AC_DEHALFOP:
+ if (CanOverride(source,"MODEDEHALFOP"))
+ {
+ if ((!channel->HasUser(source)) || (mode < STATUS_OP))
+ OverDehalfops++;
+ return ACR_ALLOW;
+ }
+ else
+ {
+ return ACR_DEFAULT;
+ }
+ break;
+ }
+
+ if (CanOverride(source,"OTHERMODE"))