+ user->IncreasePenalty(cm->second->Penalty);
+ do_more = (user->Penalty < 10);
+ if (!do_more)
+ user->OverPenalty = true;
+ }
+
+ /* activity resets the ping pending timer */
+ if (user->MyClass)
+ user->nping = ServerInstance->Time() + user->MyClass->GetPingTime();
+
+ if (cm->second->flags_needed)
+ {
+ if (!user->IsModeSet(cm->second->flags_needed))
+ {
+ user->WriteNumeric(481, "%s :Permission Denied - You do not have the required operator privileges",user->nick);
+ return do_more;
+ }
+ if (!user->HasPermission(command))
+ {
+ user->WriteNumeric(481, "%s :Permission Denied - Oper type %s does not have access to command %s",user->nick,user->oper,command.c_str());
+ return do_more;
+ }
+ }
+ if ((user->registered == REG_ALL) && (!IS_OPER(user)) && (cm->second->IsDisabled()))
+ {
+ /* command is disabled! */
+ user->WriteNumeric(421, "%s %s :This command has been disabled.",user->nick,command.c_str());
+ ServerInstance->SNO->WriteToSnoMask('d', "%s denied for %s (%s@%s)",
+ command.c_str(), user->nick, user->ident, user->host);
+ return do_more;
+ }
+ if (items < cm->second->min_params)
+ {
+ user->WriteNumeric(461, "%s %s :Not enough parameters.", user->nick, command.c_str());
+ if ((ServerInstance->Config->SyntaxHints) && (user->registered == REG_ALL) && (cm->second->syntax.length()))
+ user->WriteNumeric(304, "%s :SYNTAX %s %s", user->nick, cm->second->command.c_str(), cm->second->syntax.c_str());
+ return do_more;
+ }
+ if ((user->registered != REG_ALL) && (!cm->second->WorksBeforeReg()))
+ {
+ user->WriteNumeric(451, "%s :You have not registered",command.c_str());
+ return do_more;
+ }
+ else
+ {
+ /* passed all checks.. first, do the (ugly) stats counters. */
+ cm->second->use_count++;
+ cm->second->total_bytes += cmd.length();
+
+ /* module calls too */
+ MOD_RESULT = 0;
+ FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command,command_p,items,user,true,cmd));
+ if (MOD_RESULT == 1)
+ return do_more;
+
+ /*
+ * WARNING: be careful, the user may be deleted soon
+ */
+ CmdResult result = cm->second->Handle(command_p,items,user);
+
+ FOREACH_MOD(I_OnPostCommand,OnPostCommand(command, command_p, items, user, result,cmd));
+ return do_more;