From ddb970dd670bcd905c8f34458f8fcf70e9fd89bd Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 19 Feb 2007 08:38:26 +0000 Subject: 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 --- src/users.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/users.cpp') 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); -- cgit v1.3.1-10-gc9f91