From b54f879f3539c298646449ede2e8d458fc305605 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 4 Apr 2005 17:55:48 +0000 Subject: Added E:Lines, a form of ban exception that can prevent opers, netadmins etc from being glined. Can be added and removed either in the config or by an oper with the correct permissions to use the /ELINE command git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@975 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index d979750b5..2ef0b53bc 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -2243,8 +2243,10 @@ void AddClient(int socket, char* host, int port, bool iscached, char* ip) if (clientlist.size() == MAXCLIENTS) kill_link(clientlist[tempnick],"No more connections allowed in this class"); + char* r = matches_zline(ip); - if (r) + char* e = matches_exception(ip); + if ((r) && (!e)) { char reason[MAXBUF]; snprintf(reason,MAXBUF,"Z-Lined: %s",r); @@ -2375,23 +2377,26 @@ void FullConnectUser(userrec* user) char match_against[MAXBUF]; snprintf(match_against,MAXBUF,"%s@%s",user->ident,user->host); - char* r = matches_gline(match_against); - if (r) - { - char reason[MAXBUF]; - snprintf(reason,MAXBUF,"G-Lined: %s",r); - kill_link_silent(user,reason); - return; - } - - r = matches_kline(user->host); - if (r) - { - char reason[MAXBUF]; - snprintf(reason,MAXBUF,"K-Lined: %s",r); - kill_link_silent(user,reason); - return; - } + char* e = matches_exception(match_against); + if (!e) + { + char* r = matches_gline(match_against); + if (r) + { + char reason[MAXBUF]; + snprintf(reason,MAXBUF,"G-Lined: %s",r); + kill_link_silent(user,reason); + return; + } + r = matches_kline(user->host); + if (r) + { + char reason[MAXBUF]; + snprintf(reason,MAXBUF,"K-Lined: %s",r); + kill_link_silent(user,reason); + return; + } + } WriteServ(user->fd,"NOTICE Auth :Welcome to \002%s\002!",Network); WriteServ(user->fd,"001 %s :Welcome to the %s IRC Network %s!%s@%s",user->nick,Network,user->nick,user->ident,user->host); @@ -2967,6 +2972,7 @@ void SetupCommandTable(void) createcommand("GLINE",handle_gline,'o',1); createcommand("ZLINE",handle_zline,'o',1); createcommand("QLINE",handle_qline,'o',1); + createcommand("ELINE",handle_eline,'o',1); createcommand("SERVER",handle_server,0,0); } -- cgit v1.3.1-10-gc9f91