From c21bdadf547274d58e6b3deb402d0fa702b43355 Mon Sep 17 00:00:00 2001 From: jamie Date: Mon, 16 Oct 2006 03:07:11 +0000 Subject: Add m_dccallow module and detail configuration in inspircd.conf.example git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5468 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/inspircd.conf.example | 21 ++ src/modules/m_dccallow.cpp | 513 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 534 insertions(+) create mode 100644 src/modules/m_dccallow.cpp diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example index 1d34c369c..3945a2ece 100644 --- a/docs/inspircd.conf.example +++ b/docs/inspircd.conf.example @@ -944,6 +944,27 @@ # +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# +# DCCALLOW module: Adds the /DCCALLOW command +# +# +#-#-#-#-#-#-#-#-#-#-#- DCCALLOW CONFIGURATION -#-#-#-#-#-#-#-#-#-#-# +# blockchat - Whether to block DCC CHAT as well as DCC SEND +# length - Default duration of entries in DCCALLOW list +# action - Default action to take if no action is specified +# can be 'block' or 'allow' +# +# File configuration: +# pattern - The glob pattern to match against +# action - Action to take if a user attempts to send a file +# that matches this pattern, can be 'block' or 'allow' +# +# +# +# +# +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# + #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Deny Channels: Deny Channels from being used by users # diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp new file mode 100644 index 000000000..033138a98 --- /dev/null +++ b/src/modules/m_dccallow.cpp @@ -0,0 +1,513 @@ + /* m_dccallow - Jamie Penman-Smithson - September 2006 */ + +using namespace std; + +#include +#include +#include +#include "users.h" +#include "channels.h" +#include "modules.h" +#include "inspircd.h" + +/* $ModDesc: Povides support for the /DCCALLOW command */ + +static ConfigReader *Conf; + +class BannedFileList +{ + public: + std::string filemask; + std::string action; +}; + +class DCCAllow +{ + public: + std::string nickname; + std::string hostmask; + time_t set_on; + long length; + + DCCAllow() { } + + DCCAllow(std::string nick, std::string hm, time_t so, long ln) : nickname(nick), hostmask(hm), set_on(so), length(ln) { } +}; + +typedef std::vector userlist; +userlist ul; +typedef std::vector dccallowlist; +dccallowlist* dl; +typedef std::vector bannedfilelist; +bannedfilelist bfl; + +class cmd_dccallow : public command_t +{ + public: + cmd_dccallow(InspIRCd* Me) : command_t(Me, "DCCALLOW", 0, 0) + { + this->source = "m_dccallow.so"; + syntax = "{[+|-]