summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-27 07:22:05 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-27 07:22:05 +0000
commit3ea5a27cd34d16c69dc9e2a480a3791de4db0124 (patch)
tree9e7985f9843b1e7b3419793327d8adcafa25972e
parent90f3d27affadff9b7b2ba6c5d4014c206e0a178e (diff)
remove <filter file> - This is no longer neccessary as we've had includes for quite a while now.
It's still required for m_helpop, because the helpop.conf has tags which clash with the main config's tags (e.g. <server>, <oper>) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5548 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--docs/inspircd.conf.example17
-rw-r--r--src/modules/extra/m_filter_pcre.cpp29
-rw-r--r--src/modules/m_filter.cpp25
3 files changed, 13 insertions, 58 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example
index 3945a2ece..6c402c7a0 100644
--- a/docs/inspircd.conf.example
+++ b/docs/inspircd.conf.example
@@ -465,11 +465,12 @@
#-#-#-#-#-#-#-#-#-#- MISCELLANEOUS CONFIGURATION -#-#-#-#-#-#-#-#-#-#
# #
# These options let you define the path to your motd and rules #
-# files. These should be absolute paths. #
+# files. If these are relative paths, they are relative to the #
+# configurtion directory. #
# #
-<files motd="/home/cc/inspircd/conf/inspircd.motd"
- rules="/home/cc/inspircd/conf/inspircd.rules">
+<files motd="inspircd.motd"
+ rules="inspircd.rules">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-# DNS SERVER -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# #
@@ -515,11 +516,12 @@
# Define the path to the PID file here. The PID file can be used to #
# rehash the ircd from the shell or to terminate the ircd from the #
# shell using shell scripts, perl scripts etc, and to monitor the #
-# ircd's state via cron jobs. This is IMPORTANT and you must define #
-# it or the ircd will refuse to start. #
+# ircd's state via cron jobs. If this is a relative path, it will be #
+# relative to the configuration directory, and if it is not defined, #
+# the default of 'inspircd.pid' is used. #
# #
-<pid file="/path/to/inspircd.pid">
+#<pid file="/path/to/inspircd.pid">
#-#-#-#-#-#-#-#-#-#-#-#-#- BANLIST LIMITS #-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# #
@@ -998,7 +1000,6 @@
# Optional - If you specify to use the m_filter or m_filter_pcre #
# modules, then specfiy below the path to the filter.conf file. #
# #
-#<filter file="/path/to/inspircd/filter.conf">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Foobar module: does nothing - historical relic
@@ -1022,7 +1023,7 @@
# Optional - If you specify to use the m_helpop.so module, then #
# specify below the path to the helpop.conf file. #
# #
-#<helpop file="/path/to/inspircd/helpop.conf">
+#<helpop file="helpop.conf">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Hostchange module: Allows a different style of cloaking
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp
index 03cecffb7..96956e3d8 100644
--- a/src/modules/extra/m_filter_pcre.cpp
+++ b/src/modules/extra/m_filter_pcre.cpp
@@ -26,17 +26,6 @@
#include "modules.h"
#include "inspircd.h"
-/** Thrown by m_filter_pcre
- */
-class FilterPCREException : public ModuleException
-{
- public:
- virtual const char* GetReason()
- {
- return "Could not find <filter file=\"\"> definition in your config file!";
- }
-};
-
/* $ModDesc: m_filter with regexps */
/* $CompileFlags: `pcre-config --cflags` */
/* $LinkerFlags: `pcre-config --libs` `perl extra/pcre_rpath.pl` -lpcre */
@@ -140,25 +129,13 @@ class ModuleFilterPCRE : public Module
* of using a seperate config file is provided.
*/
- ConfigReader Conf(Srv);
-
- std::string filterfile = Conf.ReadValue("filter", "file", 0);
-
- ConfigReader MyConf(Srv, filterfile);
-
- if (filterfile.empty() || !MyConf.Verify())
- {
- FilterPCREException e;
- throw(e);
- }
-
- ServerInstance->Log(DEFAULT,"m_filter_pcre: read configuration from "+filterfile);
+ ConfigReader MyConf(Srv);
for (std::vector<Filter>::iterator i = filters.begin(); i != filters.end(); i++)
pcre_free((*i).regexp);
-
+
filters.clear();
-
+
for (int index = 0; index < MyConf.Enumerate("keyword"); index++)
{
std::string pattern = MyConf.ReadValue("keyword","pattern",index);
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index f4193497d..38cd32ecd 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -42,17 +42,6 @@ class Filter : public classbase
typedef std::map<std::string,Filter*> filter_t;
-/** Thrown by m_filter
- */
-class FilterException : public ModuleException
-{
- public:
- virtual const char* GetReason()
- {
- return "Could not find <filter file=\"\"> definition in your config file!";
- }
-};
-
class ModuleFilter : public Module
{
@@ -127,18 +116,8 @@ class ModuleFilter : public Module
virtual void OnRehash(const std::string &parameter)
{
- // reload our config file on rehash - we must destroy and re-allocate the classes
- // to call the constructor again and re-read our data.
- ConfigReader* Conf = new ConfigReader(ServerInstance);
- std::string filterfile = Conf->ReadValue("filter","file",0);
// this automatically re-reads the configuration file into the class
- ConfigReader* MyConf = new ConfigReader(ServerInstance, filterfile);
- if ((filterfile == "") || (!MyConf->Verify()))
- {
- // bail if the user forgot to create a config file
- FilterException e;
- throw(e);
- }
+ ConfigReader* MyConf = new ConfigReader(ServerInstance);
for (filter_t::iterator n = filters.begin(); n != filters.end(); n++)
{
DELETE(n->second);
@@ -156,8 +135,6 @@ class ModuleFilter : public Module
x->action = do_action;
filters[pattern] = x;
}
- ServerInstance->Log(DEFAULT,"m_filter: read configuration from "+filterfile);
- DELETE(Conf);
DELETE(MyConf);
}