summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorGravatar brain2007-02-19 08:38:26 +0000
committerGravatar brain2007-02-19 08:38:26 +0000
commitddb970dd670bcd905c8f34458f8fcf70e9fd89bd (patch)
treedbd6e3fb9300eb04ff9feed8344d4e6891172141 /src/users.cpp
parentFix for crashbugs when quitting users as experienced by satmd, SiliconAI and ... (diff)
1) Fix for nickname overruled with new cullList stuff -- we have to change their nick, its not safe to quit them as it messes up the nick hash.
2) Add a mute flag for users, so we can drop commands from users who have been placed on the cullList. This is independent of the actual cullList and can be used as a general mute flag e.g. by shun modules. 3) Fix /kill to also not quit the user immediately, remove need for CMD_USER_DELETED return anywhere in the code. *** THIS NEEDS TESTING BY QA *** git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6596 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 55aa7c1ed..6398603d9 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -319,7 +319,7 @@ userrec::userrec(InspIRCd* Instance) : ServerInstance(Instance)
age = ServerInstance->Time(true);
lines_in = lastping = signon = idle_lastmsg = nping = registered = 0;
ChannelCount = timeout = flood = bytes_in = bytes_out = cmds_in = cmds_out = 0;
- exempt = haspassed = dns_done = false;
+ muted = exempt = haspassed = dns_done = false;
fd = -1;
recvq = "";
sendq = "";
@@ -802,6 +802,7 @@ void userrec::UnOper()
void userrec::QuitUser(InspIRCd* Instance, userrec *user, const std::string &quitreason)
{
+ user->muted = true;
Instance->GlobalCulls.AddItem(user, quitreason.c_str());
}
@@ -972,24 +973,28 @@ void userrec::FullConnect()
if ((!a) || (a->GetType() == CC_DENY))
{
+ this->muted = true;
ServerInstance->GlobalCulls.AddItem(this,"Unauthorised connection");
return;
}
if ((!a->GetPass().empty()) && (!this->haspassed))
{
+ this->muted = true;
ServerInstance->GlobalCulls.AddItem(this,"Invalid password");
return;
}
if (this->LocalCloneCount() > a->GetMaxLocal())
{
+ this->muted = true;
ServerInstance->GlobalCulls.AddItem(this, "No more connections allowed from your host via this connect class (local)");
ServerInstance->WriteOpers("*** WARNING: maximum LOCAL connections (%ld) exceeded for IP %s", a->GetMaxLocal(), this->GetIPString());
return;
}
else if (this->GlobalCloneCount() > a->GetMaxGlobal())
{
+ this->muted = true;
ServerInstance->GlobalCulls.AddItem(this, "No more connections allowed from your host via this connect class (global)");
ServerInstance->WriteOpers("*** WARNING: maximum GLOBAL connections (%ld) exceeded for IP %s",a->GetMaxGlobal(), this->GetIPString());
return;
@@ -1001,6 +1006,7 @@ void userrec::FullConnect()
if (r)
{
+ this->muted = true;
char reason[MAXBUF];
snprintf(reason,MAXBUF,"G-Lined: %s",r->reason);
ServerInstance->GlobalCulls.AddItem(this, reason);
@@ -1011,6 +1017,7 @@ void userrec::FullConnect()
if (n)
{
+ this->muted = true;
char reason[MAXBUF];
snprintf(reason,MAXBUF,"K-Lined: %s",n->reason);
ServerInstance->GlobalCulls.AddItem(this, reason);