diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-21 23:22:04 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-11-21 23:22:04 +0000 |
commit | 06fd57cc35c9d5869ca3a24d349b791963b2acc4 (patch) | |
tree | 14a968c830b6941dd766e9d3ddd71435e82e9e24 /src/modules | |
parent | 97cf2d2384e255d8e77af7b70fdc057461b83c38 (diff) |
fix for bug #175, change OnUserRegister to return int, and if greater than 0 = user was quit and stop propagating to rest of loaded modules. Also bumb the module API version.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5783 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_sqlauth.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_antibear.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_cgiirc.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_conn_waitpong.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_connflood.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_ident.cpp | 3 |
6 files changed, 18 insertions, 12 deletions
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp index 8f9a850ab..3e1162a77 100644 --- a/src/modules/extra/m_sqlauth.cpp +++ b/src/modules/extra/m_sqlauth.cpp @@ -87,18 +87,20 @@ public: } } - virtual void OnUserRegister(userrec* user) + virtual int OnUserRegister(userrec* user) { if ((allowpattern != "") && (Srv->MatchText(user->nick,allowpattern))) { user->Extend("sqlauthed"); - return; + return 0; } if (!CheckCredentials(user)) { userrec::QuitUser(Srv,user,killreason); + return 1; } + return 0; } bool CheckCredentials(userrec* user) diff --git a/src/modules/m_antibear.cpp b/src/modules/m_antibear.cpp index 513f357f9..0f67915ef 100644 --- a/src/modules/m_antibear.cpp +++ b/src/modules/m_antibear.cpp @@ -47,10 +47,11 @@ class ModuleAntiBear : public Module List[I_OnUserRegister] = 1; } - virtual void OnUserRegister(userrec* user) + virtual int OnUserRegister(userrec* user) { user->WriteServ("439 %s :This server has anti-spambot mechanisms enabled.", user->nick); user->WriteServ("931 %s :Malicious bots, spammers, and other automated systems of dubious origin are NOT welcome here.", user->nick); + return 0; } }; diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index ec2ac6129..092677bd2 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -196,7 +196,7 @@ public: } - virtual void OnUserRegister(userrec* user) + virtual int OnUserRegister(userrec* user) { ServerInstance->Log(DEBUG, "m_cgiirc.so: User %s registering, %s %s", user->nick,user->host,user->GetIPString()); @@ -227,10 +227,10 @@ public: // If the ident lookup fails, try the password. CheckPass(user); } - - return; + return 0; } } + return 0; } bool CheckPass(userrec* user) diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp index 1806a988f..8d62357cd 100644 --- a/src/modules/m_conn_waitpong.cpp +++ b/src/modules/m_conn_waitpong.cpp @@ -67,7 +67,7 @@ class ModuleWaitPong : public Module List[I_OnUserRegister] = List[I_OnCheckReady] = List[I_OnPreCommand] = List[I_OnRehash] = List[I_OnUserDisconnect] = List[I_OnCleanup] = 1; } - virtual void OnUserRegister(userrec* user) + virtual int OnUserRegister(userrec* user) { char* pingrpl = RandString(10); @@ -77,6 +77,7 @@ class ModuleWaitPong : public Module user->WriteServ("NOTICE %s :*** If you are having problems connecting due to ping timeouts, please type /quote PONG %s or /raw PONG %s now.", user->nick, pingrpl, pingrpl); user->Extend("waitpong_pingstr", pingrpl); + return 0; } virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec* user, bool validated, const std::string &original_line) diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index 585891f74..a226fa189 100644 --- a/src/modules/m_connflood.cpp +++ b/src/modules/m_connflood.cpp @@ -74,7 +74,7 @@ public: first = ServerInstance->Time(); } - virtual void OnUserRegister(userrec* user) + virtual int OnUserRegister(userrec* user) { time_t next = ServerInstance->Time(); if (!first) @@ -93,10 +93,10 @@ public: /* expire throttle */ throttled = 0; ServerInstance->WriteOpers("*** Connection throttle deactivated"); - return; + return 0; } userrec::QuitUser(ServerInstance, user, quitmsg); - return; + return 1; } if (tdiff <= seconds) @@ -106,7 +106,7 @@ public: throttled = 1; ServerInstance->WriteOpers("*** Connection throttle activated"); userrec::QuitUser(ServerInstance, user, quitmsg); - return; + return 1; } } else @@ -114,6 +114,7 @@ public: conns = 1; first = next; } + return 0; } virtual void OnRehash(const std::string ¶meter) diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index f4ffc0058..dc59adcea 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -208,7 +208,7 @@ class ModuleIdent : public Module ReadSettings(); } - virtual void OnUserRegister(userrec* user) + virtual int OnUserRegister(userrec* user) { /* * when the new user connects, before they authenticate with USER/NICK/PASS, we do @@ -231,6 +231,7 @@ class ModuleIdent : public Module strlcpy(user->ident,newident,IDENTMAX); delete ident; } + return 0; } virtual bool OnCheckReady(userrec* user) |