]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add options:moronbanner. Yes really, thats what its called. See the example config.
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 4 Jun 2007 19:10:25 +0000 (19:10 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 4 Jun 2007 19:10:25 +0000 (19:10 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7232 e03df62e-2008-0410-955e-edbf42e46eb7

docs/inspircd.conf.example
include/configreader.h
src/configreader.cpp
src/users.cpp
src/xline.cpp

index f418afabb742d607d6bcf607dfb4e5c9f76de7ee..2632f8f60559b368dc5441764ef0d07c366367ef 100644 (file)
 #                                                                     #
 #     <server name="server.name"                                      #
 #      description="Server Description"                               #
+#      networkemail="Email address shown on g/k/z/q lines"            #
 #      network="MyNetwork">                                           #
 #                                                                     #
 
 <server name="penguin.omega.org.za"
         description="Waddle World"
-        network="Omega">
+       network="Omega">
 
 
 #-#-#-#-#-#-#-#-#-#-#-#-   ADMIN INFORMATION   -#-#-#-#-#-#-#-#-#-#-#-#
 #                  they will be ignored. You may add parameters for   #
 #                  parameterised modes.                               #
 #                                                                     #
+#  moronbanner   - The NOTICE to show to users who are glined, zlined #
+#                  klined or qlined when they are disconnected. This  #
+#                  is totally freeform, you may place any text here   #
+#                  you wish.                                          #
+#                                                                     #
 
 <options prefixquit="Quit: "
          loglevel="default"
          pingwarning="15"
          allowhalfop="yes"
         defaultmodes="nt"
+        moronbanner="You're banned! Email haha@abuse.com with the ERROR line below for help."
         exemptchanops="">
 
 #-#-#-#-#-#-#-#-#-#-#-#-#-#- TIME SYNC OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#
index e596e409daad09e9e7b76174eb5fb378630fd356..4d5435b1ca43de55f5a4314c34083d0301678849 100644 (file)
@@ -234,6 +234,10 @@ class CoreExport ServerConfig : public Extensible
         * as defined by the administrator.
         */
        char ServerName[MAXBUF];
+
+       /** Notice to give to users when they are Xlined
+        */
+       char MoronBanner[MAXBUF];
        
        /* Holds the network name the local server
         * belongs to. This is an arbitary field defined
index 76aec8ee5aae074177344e14230a4b08401dba81..2d62f354a6bc5d0496ef2fdca9ccded273a2ccd3 100644 (file)
@@ -593,6 +593,7 @@ void ServerConfig::Read(bool bail, userrec* user)
        InitialConfig Values[] = {
                {"options",     "softlimit",    MAXCLIENTS_S,           new ValueContainerUInt (&this->SoftLimit),              DT_INTEGER, ValidateSoftLimit},
                {"options",     "somaxconn",    SOMAXCONN_S,            new ValueContainerInt  (&this->MaxConn),                DT_INTEGER, ValidateMaxConn},
+               {"options",     "moronbanner",  "Youre banned!",        new ValueContainerChar (this->MoronBanner),             DT_CHARPTR, NoValidation},
                {"server",      "name",         "",                     new ValueContainerChar (this->ServerName),              DT_CHARPTR, ValidateServerName},
                {"server",      "description",  "Configure Me",         new ValueContainerChar (this->ServerDesc),              DT_CHARPTR, NoValidation},
                {"server",      "network",      "Network",              new ValueContainerChar (this->Network),                 DT_CHARPTR, NoValidation},
index 196be89e98d8d6bf334c306fba0f207eea243699..2e3bc83d5cf5fccfe4db50b018d94f8a983864ce 100644 (file)
@@ -962,6 +962,8 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
                if (r)
                {
                        char reason[MAXBUF];
+                       if (*Instance->Config->MoronBanner)
+                               New->WriteServ("NOTICE %s :*** %s", New->nick, Instance->Config->MoronBanner);
                        snprintf(reason,MAXBUF,"Z-Lined: %s",r->reason);
                        userrec::QuitUser(Instance, New, reason);
                        return;
@@ -1053,6 +1055,8 @@ void userrec::FullConnect()
                {
                        this->muted = true;
                        char reason[MAXBUF];
+                       if (*ServerInstance->Config->MoronBanner)
+                               this->WriteServ("NOTICE %s :*** %s", this->nick, ServerInstance->Config->MoronBanner);
                        snprintf(reason,MAXBUF,"G-Lined: %s",r->reason);
                        ServerInstance->GlobalCulls.AddItem(this, reason);
                        return;
@@ -1064,11 +1068,12 @@ void userrec::FullConnect()
                {
                        this->muted = true;
                        char reason[MAXBUF];
+                       if (*ServerInstance->Config->MoronBanner)
+                               this->WriteServ("NOTICE %s :*** %s", this, ServerInstance->Config->MoronBanner);
                        snprintf(reason,MAXBUF,"K-Lined: %s",n->reason);
                        ServerInstance->GlobalCulls.AddItem(this, reason);
                        return;
                }
-
        }
 
        this->WriteServ("NOTICE Auth :Welcome to \002%s\002!",ServerInstance->Config->Network);
index b6721de09cbcafc37d244975740320d1b3e15e41..7a1b4a8aa9fcf2cd966a7fdbef4ac210450b9928 100644 (file)
@@ -684,6 +684,8 @@ void XLineManager::apply_lines(const int What)
                                if ((check = matches_gline(u,true)))
                                {
                                        snprintf(reason,MAXBUF,"G-Lined: %s",check->reason);
+                                       if (*ServerInstance->Config->MoronBanner)
+                                               u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
                                        if (ServerInstance->Config->HideBans)
                                                ServerInstance->GlobalCulls.AddItem(u, "G-Lined", reason);
                                        else
@@ -696,6 +698,8 @@ void XLineManager::apply_lines(const int What)
                                if ((check = matches_kline(u,true)))
                                {
                                        snprintf(reason,MAXBUF,"K-Lined: %s",check->reason);
+                                       if (*ServerInstance->Config->MoronBanner)
+                                               u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
                                        if (ServerInstance->Config->HideBans)
                                                ServerInstance->GlobalCulls.AddItem(u, "K-Lined", reason);
                                        else
@@ -708,6 +712,8 @@ void XLineManager::apply_lines(const int What)
                                if ((check = matches_qline(u->nick,true)))
                                {
                                        snprintf(reason,MAXBUF,"Q-Lined: %s",check->reason);
+                                       if (*ServerInstance->Config->MoronBanner)
+                                               u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
                                        if (ServerInstance->Config->HideBans)
                                                ServerInstance->GlobalCulls.AddItem(u, "Q-Lined", reason);
                                        else
@@ -720,6 +726,8 @@ void XLineManager::apply_lines(const int What)
                                if ((check = matches_zline(u->GetIPString(),true)))
                                {
                                        snprintf(reason,MAXBUF,"Z-Lined: %s",check->reason);
+                                       if (*ServerInstance->Config->MoronBanner)
+                                               u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
                                        if (ServerInstance->Config->HideBans)
                                                ServerInstance->GlobalCulls.AddItem(u, "Z-Lined", reason);
                                        else
@@ -752,6 +760,8 @@ void XLineManager::apply_lines(const int What)
                                if ((check = matches_gline(u)))
                                {
                                        snprintf(reason,MAXBUF,"G-Lined: %s",check->reason);
+                                       if (*ServerInstance->Config->MoronBanner)
+                                               u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
                                        if (ServerInstance->Config->HideBans)
                                                ServerInstance->GlobalCulls.AddItem(u, "G-Lined", reason);
                                        else
@@ -763,6 +773,8 @@ void XLineManager::apply_lines(const int What)
                                if ((check = matches_kline(u)))
                                {
                                        snprintf(reason,MAXBUF,"K-Lined: %s",check->reason);
+                                       if (*ServerInstance->Config->MoronBanner)
+                                               u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
                                        if (ServerInstance->Config->HideBans)
                                                ServerInstance->GlobalCulls.AddItem(u, "K-Lined", reason);
                                        else
@@ -774,6 +786,8 @@ void XLineManager::apply_lines(const int What)
                                if ((check = matches_qline(u->nick)))
                                {
                                        snprintf(reason,MAXBUF,"Q-Lined: %s",check->reason);
+                                       if (*ServerInstance->Config->MoronBanner)
+                                               u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
                                        if (ServerInstance->Config->HideBans)
                                                ServerInstance->GlobalCulls.AddItem(u, "Q-Lined", reason);
                                        else
@@ -785,6 +799,8 @@ void XLineManager::apply_lines(const int What)
                                if ((check = matches_zline(u->GetIPString())))
                                {
                                        snprintf(reason,MAXBUF,"Z-Lined: %s", check->reason);
+                                       if (*ServerInstance->Config->MoronBanner)
+                                               u->WriteServ("NOTICE %s :*** %s", u->nick, ServerInstance->Config->MoronBanner);
                                        if (ServerInstance->Config->HideBans)
                                                ServerInstance->GlobalCulls.AddItem(u, "Z-Lined", reason);
                                        else