summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-01 20:26:12 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-01 20:26:12 +0000
commitfa923bb5549eba6807ebd1274d0b5cbfa503667a (patch)
tree9ecf858b1c557b5e4f6772461f6f6d206dcc49a9 /src/modules
parent685861f2bd0e30d7dcf74ff4cb97fd77e73d8463 (diff)
Add <securelist:exception> to allow certain masks to get around securelist.
By default add two lines to the config which allow searchirc and netsplit.de. (bwahaha) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6475 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_securelist.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp
index b9d7363a5..efa448290 100644
--- a/src/modules/m_securelist.cpp
+++ b/src/modules/m_securelist.cpp
@@ -23,11 +23,11 @@
class ModuleSecureList : public Module
{
private:
-
+ std::vector<std::string> allowlist;
public:
ModuleSecureList(InspIRCd* Me) : Module::Module(Me)
{
-
+ OnRehash(NULL,"");
}
virtual ~ModuleSecureList()
@@ -38,10 +38,19 @@ class ModuleSecureList : public Module
{
return Version(1,1,0,0,VF_VENDOR,API_VERSION);
}
+
+ void OnRehash(userrec* user, const std::string &parameter)
+ {
+ ConfigReader* MyConf = new ConfigReader(ServerInstance);
+ allowlist.clear();
+ for (int i = 0; i < MyConf->Enumerate("securelist"); i++)
+ allowlist.push_back(MyConf->ReadValue("securelist", "exception", i));
+ DELETE(MyConf);
+ }
void Implements(char* List)
{
- List[I_OnPreCommand] = List[I_On005Numeric] = 1;
+ List[I_OnRehash] = List[I_OnPreCommand] = List[I_On005Numeric] = 1;
}
/*
@@ -56,6 +65,12 @@ class ModuleSecureList : public Module
if ((command == "LIST") && (ServerInstance->Time() < (user->signon+60)) && (!*user->oper))
{
+ /* Normally wouldnt be allowed here, are they exempt? */
+ for (std::vector<std::string>::iterator x = allowlist.begin(); x != allowlist.end(); x++)
+ if (ServerInstance->MatchText(user->MakeHost(), *x))
+ return 0;
+
+ /* Not exempt, BOOK EM DANNO! */
user->WriteServ("NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick);
/* Some crap clients (read: mIRC, various java chat applets) muck up if they don't
* receive these numerics whenever they send LIST, so give them an empty LIST to mull over.