* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2008 InspIRCd Development Team
* See: http://www.inspircd.org/wiki/index.php/Credits
*
* This program is free but copyrighted software; see
#include <dlfcn.h>
#endif
-int InspIRCd::OperPassCompare(const char* data,const char* input, int tagnumber)
+int InspIRCd::PassCompare(Extensible* ex, const char* data,const char* input, const char* hashtype)
{
int MOD_RESULT = 0;
- FOREACH_RESULT_I(this,I_OnOperCompare,OnOperCompare(data, input, tagnumber))
+ FOREACH_RESULT_I(this,I_OnPassCompare,OnPassCompare(ex, data, input, hashtype))
if (MOD_RESULT == 1)
return 0;
if (MOD_RESULT == -1)
while (current->BufferIsReady())
{
- if (ServerInstance->Time() > current->reset_due)
+ if (current->MyClass)
{
- current->reset_due = ServerInstance->Time() + current->MyClass->GetThreshold();
- current->lines_in = 0;
- }
+ if (ServerInstance->Time() > current->reset_due)
+ {
+ current->reset_due = ServerInstance->Time() + current->MyClass->GetThreshold();
+ current->lines_in = 0;
+ }
- if (++current->lines_in > current->MyClass->GetFlood() && current->MyClass->GetFlood())
- {
- ServerInstance->FloodQuitUser(current);
- return;
- }
+ if (++current->lines_in > current->MyClass->GetFlood() && current->MyClass->GetFlood())
+ {
+ ServerInstance->FloodQuitUser(current);
+ return;
+ }
- if ((++floodlines > current->MyClass->GetFlood()) && (current->MyClass->GetFlood() != 0))
- {
- ServerInstance->FloodQuitUser(current);
- return;
+ if ((++floodlines > current->MyClass->GetFlood()) && (current->MyClass->GetFlood() != 0))
+ {
+ ServerInstance->FloodQuitUser(current);
+ return;
+ }
}
// use GetBuffer to copy single lines into the sanitized string
return true;
}
- if (!user)
- {
- /*
- * before, we went and found the command even with no user.. seems nonsensical.
- * I'm not entirely sure when we would be passed NULL, but let's handle it
- * anyway, by dropping it like a hot potato. -- w00t
- */
- return true;
- }
-
/* find the command, check it exists */
Commandable::iterator cm = cmdlist.find(command);
if (cm == cmdlist.end())
{
+ if (user->registered == REG_ALL)
+ {
+ user->WriteServ("421 %s %s :Unknown command",user->nick,command.c_str());
+ }
ServerInstance->stats->statsUnknown++;
- user->WriteServ("421 %s %s :Unknown command",user->nick,command.c_str());
return true;
}
if (!user->ExemptFromPenalty)
{
user->IncreasePenalty(cm->second->Penalty);
- ServerInstance->Log(DEBUG,"Penalty for %s is now incremented to %d (%d added on)", user->nick, user->Penalty, cm->second->Penalty);
do_more = (user->Penalty < 10);
if (!do_more)
- {
user->OverPenalty = true;
- ServerInstance->Log(DEBUG,"User %s now OVER penalty of 10", user->nick);
- }
}
/* activity resets the ping pending timer */
- user->nping = ServerInstance->Time() + user->MyClass->GetPingTime();
+ if (user->MyClass)
+ user->nping = ServerInstance->Time() + user->MyClass->GetPingTime();
+
if (cm->second->flags_needed)
{
if (!user->IsModeSet(cm->second->flags_needed))
if (buffer.length())
{
- if (!user->muted)
- {
- ServerInstance->Log(DEBUG,"C[%d] I :%s %s",user->GetFd(), user->nick, buffer.c_str());
- return this->ProcessCommand(user,buffer);
- }
+ ServerInstance->Log(DEBUG,"C[%d] I :%s %s",user->GetFd(), user->nick, buffer.c_str());
+ return this->ProcessCommand(user,buffer);
}
+
return true;
}
if (ServerInstance->Parser->ReloadCommand(parameters[0], user))
{
user->WriteServ("NOTICE %s :*** Successfully reloaded command '%s'", user->nick, parameters[0]);
- ServerInstance->WriteOpers("*** RELOAD: %s reloaded the '%s' command.", user->nick, parameters[0]);
+ ServerInstance->SNO->WriteToSnoMask('A', "RELOAD: %s reloaded the '%s' command.", user->nick, parameters[0]);
return CMD_SUCCESS;
}
else