+ return -1;
+ }
+
+ if ((chan->modes[CM_KEY]) && (CanOverride(user,"KEY")) && keygiven != chan->GetModeParameter('k'))
+ {
+ if (RequireKey && keygiven != "override")
+ {
+ // Can't join normally -- must use a special key to bypass restrictions
+ user->WriteServ("NOTICE %s :*** You may not join normally. You must join with a key of 'override' to oper override.", user->nick.c_str());
+ return 1;
+ }
+
+ if (NoisyOverride)
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass the channel key", cname, user->nick.c_str());
+ ServerInstance->SNO->WriteToSnoMask('G', user->nick+" used oper override to bypass +k on "+std::string(cname));
+ return -1;
+ }
+
+ if ((chan->modes[CM_LIMIT]) && (chan->GetUserCounter() >= atoi(chan->GetModeParameter('l').c_str())) && (CanOverride(user,"LIMIT")))
+ {
+ if (RequireKey && keygiven != "override")
+ {
+ // Can't join normally -- must use a special key to bypass restrictions
+ user->WriteServ("NOTICE %s :*** You may not join normally. You must join with a key of 'override' to oper override.", user->nick.c_str());
+ return 1;
+ }
+
+ if (NoisyOverride)
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass the channel limit", cname, user->nick.c_str());
+ ServerInstance->SNO->WriteToSnoMask('G', user->nick+" used oper override to bypass +l on "+std::string(cname));
+ return -1;
+ }
+
+ if (chan->IsBanned(user) && CanOverride(user,"BANWALK"))
+ {
+ if (RequireKey && keygiven != "override")
+ {
+ // Can't join normally -- must use a special key to bypass restrictions
+ user->WriteServ("NOTICE %s :*** You may not join normally. You must join with a key of 'override' to oper override.", user->nick.c_str());
+ return 1;
+ }
+
+ if (NoisyOverride)
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass channel ban", cname, user->nick.c_str());
+ ServerInstance->SNO->WriteToSnoMask('G',"%s used oper override to bypass channel ban on %s", user->nick.c_str(), cname);
+ return -1;