summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-02 15:02:33 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-02 15:02:33 +0000
commit8e34d66ef3bef802e5758ad73ff29e1b75aaba7f (patch)
tree2cecf2f520559630b1f6b1cac8e5654d2745b515 /include
parent0ca1aa58d74ee743423602467cedda686e311bc1 (diff)
Add OnSetConnectClass hook for use in adding requirements to connect classes (such as requiressl)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12352 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/modules.h10
-rw-r--r--include/users.h15
2 files changed, 8 insertions, 17 deletions
diff --git a/include/modules.h b/include/modules.h
index bb9a55dbf..25c57cb61 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -97,7 +97,7 @@ struct ModResult {
/** If you change the module API in any way, increment this value.
* This MUST be a pure integer, with no parenthesis
*/
-#define API_VERSION 137
+#define API_VERSION 138
/**
* This #define allows us to call a method in all
@@ -325,7 +325,7 @@ enum Implementation
I_OnPostTopicChange, I_OnEvent, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan,
I_OnDelBan, I_OnChangeLocalUserGECOS, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete,
I_OnPostOper, I_OnSyncNetwork, I_OnSetAway, I_OnUserList, I_OnPostCommand, I_OnPostJoin,
- I_OnWhoisLine, I_OnBuildNeighborList, I_OnGarbageCollect,
+ I_OnWhoisLine, I_OnBuildNeighborList, I_OnGarbageCollect, I_OnSetConnectClass,
I_OnText, I_OnPassCompare, I_OnRunTestSuite, I_OnNamesListItem, I_OnNumeric, I_OnHookIO,
I_OnPreRehash, I_OnModuleRehash, I_OnSendWhoLine, I_OnChangeIdent, I_OnChannelRestrictionApply,
I_END
@@ -1255,6 +1255,12 @@ class CoreExport Module : public classbase, public usecountbase
*/
virtual void OnGarbageCollect();
+ /** Called when a user's connect class is being matched
+ * @return MOD_RES_ALLOW to force the class to match, MOD_RES_DENY to forbid it, or
+ * MOD_RES_PASSTHRU to allow normal matching (by host/port).
+ */
+ virtual ModResult OnSetConnectClass(LocalUser* user, ConnectClass* myclass);
+
/** Add test suite hooks here. These are used for testing functionality of a module
* via the --testsuite debugging parameter.
*/
diff --git a/include/users.h b/include/users.h
index 5c3fd9a43..6b891d7da 100644
--- a/include/users.h
+++ b/include/users.h
@@ -92,14 +92,6 @@ struct CoreExport ConnectClass : public refcountbase
*/
unsigned int pingtime;
- /** (Optional) Password for this line
- */
- std::string pass;
-
- /** (Optional) Hash Method for this line
- */
- std::string hash;
-
/** Maximum size of sendq for users in this class (bytes)
* Users cannot send commands if they go over this limit
*/
@@ -133,10 +125,6 @@ struct CoreExport ConnectClass : public refcountbase
*/
unsigned int maxchans;
- /** Port number this connect class applies to
- */
- int port;
-
/** How many users may be in this connect class before they are refused?
* (0 = no limit = default)
*/
@@ -152,11 +140,8 @@ struct CoreExport ConnectClass : public refcountbase
/** Update the settings in this block to match the given block */
void Update(const ConnectClass* newSettings);
-
const std::string& GetName() { return name; }
- const std::string& GetPass() { return pass; }
const std::string& GetHost() { return host; }
- const int GetPort() { return port; }
/** Returns the registration timeout
*/