diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_geoip.cpp | 1 | ||||
-rw-r--r-- | src/modules/extra/m_ldap.cpp | 2 | ||||
-rw-r--r-- | src/modules/extra/m_mysql.cpp | 2 | ||||
-rw-r--r-- | src/modules/extra/m_pgsql.cpp | 1 | ||||
-rw-r--r-- | src/modules/extra/m_regex_pcre.cpp | 1 | ||||
-rw-r--r-- | src/modules/extra/m_sqlite3.cpp | 1 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 1 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 1 | ||||
-rw-r--r-- | src/modules/m_joinflood.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_nickflood.cpp | 15 |
10 files changed, 33 insertions, 5 deletions
diff --git a/src/modules/extra/m_geoip.cpp b/src/modules/extra/m_geoip.cpp index b350ede90..c7b0fd210 100644 --- a/src/modules/extra/m_geoip.cpp +++ b/src/modules/extra/m_geoip.cpp @@ -20,6 +20,7 @@ /// $CompilerFlags: find_compiler_flags("geoip" "") /// $LinkerFlags: find_linker_flags("geoip" "-lGeoIP") +/// $PackageInfo: require_system("centos" "7.0") GeoIP-devel pkgconfig /// $PackageInfo: require_system("darwin") geoip pkg-config /// $PackageInfo: require_system("ubuntu") libgeoip-dev pkg-config diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp index 78cce50bd..fc1bee939 100644 --- a/src/modules/extra/m_ldap.cpp +++ b/src/modules/extra/m_ldap.cpp @@ -18,6 +18,8 @@ */ /// $LinkerFlags: -llber -lldap_r + +/// $PackageInfo: require_system("centos") openldap-devel /// $PackageInfo: require_system("ubuntu") libldap2-dev #include "inspircd.h" diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index d965c88fb..39b0c369d 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -22,6 +22,8 @@ /// $CompilerFlags: execute("mysql_config --include" "MYSQL_CXXFLAGS") /// $LinkerFlags: execute("mysql_config --libs_r" "MYSQL_LDFLAGS" "-lmysqlclient") +/// $PackageInfo: require_system("centos" "6.0" "6.99") mysql-devel +/// $PackageInfo: require_system("centos" "7.0") mariadb-devel /// $PackageInfo: require_system("darwin") mysql-connector-c /// $PackageInfo: require_system("ubuntu") libmysqlclient-dev diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 56455a718..5f6f6e30f 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -24,6 +24,7 @@ /// $CompilerFlags: -Iexecute("pg_config --includedir" "POSTGRESQL_INCLUDE_DIR") /// $LinkerFlags: -Lexecute("pg_config --libdir" "POSTGRESQL_LIBRARY_DIR") -lpq +/// $PackageInfo: require_system("centos") postgresql-devel /// $PackageInfo: require_system("darwin") postgresql /// $PackageInfo: require_system("ubuntu") libpq-dev diff --git a/src/modules/extra/m_regex_pcre.cpp b/src/modules/extra/m_regex_pcre.cpp index 5ad27858f..e270ca039 100644 --- a/src/modules/extra/m_regex_pcre.cpp +++ b/src/modules/extra/m_regex_pcre.cpp @@ -20,6 +20,7 @@ /// $CompilerFlags: execute("pcre-config --cflags" "PCRE_CXXFLAGS") /// $LinkerFlags: execute("pcre-config --libs" "PCRE_LDFLAGS" "-lpcre") +/// $PackageInfo: require_system("centos") pcre-devel pkgconfig /// $PackageInfo: require_system("darwin") pcre pkg-config /// $PackageInfo: require_system("ubuntu") libpcre3-dev pkg-config diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp index fa88cacc3..ac7146e38 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -22,6 +22,7 @@ /// $CompilerFlags: find_compiler_flags("sqlite3") /// $LinkerFlags: find_linker_flags("sqlite3" "-lsqlite3") +/// $PackageInfo: require_system("centos") pkgconfig sqlite-devel /// $PackageInfo: require_system("darwin") pkg-config sqlite3 /// $PackageInfo: require_system("ubuntu") libsqlite3-dev pkg-config diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index a42efa1ab..c1ffdfb4c 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -26,6 +26,7 @@ /// $LinkerFlags: find_linker_flags("gnutls" "-lgnutls") /// $LinkerFlags: require_version("gnutls" "1.0" "2.12") execute("libgcrypt-config --libs" "LIBGCRYPT_LDFLAGS") +/// $PackageInfo: require_system("centos") gnutls-devel pkgconfig /// $PackageInfo: require_system("darwin") gnutls pkg-config /// $PackageInfo: require_system("ubuntu" "1.0" "13.10") libgcrypt11-dev /// $PackageInfo: require_system("ubuntu" "14.04") gnutls-bin libgnutls-dev pkg-config diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 8843c34f6..7cff5da8a 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -24,6 +24,7 @@ /// $CompilerFlags: find_compiler_flags("openssl") /// $LinkerFlags: find_linker_flags("openssl" "-lssl -lcrypto") +/// $PackageInfo: require_system("centos") openssl-devel pkgconfig /// $PackageInfo: require_system("darwin") openssl pkg-config /// $PackageInfo: require_system("ubuntu" "16.04") libssl-dev openssl pkg-config diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp index 56131f0be..077ceff52 100644 --- a/src/modules/m_joinflood.cpp +++ b/src/modules/m_joinflood.cpp @@ -23,6 +23,9 @@ #include "inspircd.h" +// The number of seconds the channel will be closed for. +static unsigned int duration; + /** Holds settings and state associated with channel mode +j */ class joinfloodsettings @@ -71,7 +74,7 @@ class joinfloodsettings void lock() { - unlocktime = ServerInstance->Time() + 60; + unlocktime = ServerInstance->Time() + duration; } bool operator==(const joinfloodsettings& other) const @@ -129,6 +132,12 @@ class ModuleJoinFlood : public Module { } + void ReadConfig(ConfigStatus&) CXX11_OVERRIDE + { + ConfigTag* tag = ServerInstance->Config->ConfValue("joinflood"); + duration = tag->getDuration("duration", 60, 10, 600); + } + ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE { if (chan) @@ -159,7 +168,7 @@ class ModuleJoinFlood : public Module { f->clear(); f->lock(); - memb->chan->WriteNotice(InspIRCd::Format("This channel has been closed to new users for 60 seconds because there have been more than %d joins in %d seconds.", f->joins, f->secs)); + memb->chan->WriteNotice(InspIRCd::Format("This channel has been closed to new users for %u seconds because there have been more than %d joins in %d seconds.", duration, f->joins, f->secs)); } } } diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp index 39e097daa..abb3cdfaf 100644 --- a/src/modules/m_nickflood.cpp +++ b/src/modules/m_nickflood.cpp @@ -20,6 +20,9 @@ #include "inspircd.h" +// The number of seconds nickname changing will be blocked for. +static unsigned int duration; + /** Holds settings and state associated with channel mode +F */ class nickfloodsettings @@ -72,7 +75,7 @@ class nickfloodsettings void lock() { - unlocktime = ServerInstance->Time() + 60; + unlocktime = ServerInstance->Time() + duration; } }; @@ -126,6 +129,12 @@ class ModuleNickFlood : public Module { } + void ReadConfig(ConfigStatus&) CXX11_OVERRIDE + { + ConfigTag* tag = ServerInstance->Config->ConfValue("nickflood"); + duration = tag->getDuration("duration", 60, 10, 600); + } + ModResult OnUserPreNick(LocalUser* user, const std::string& newnick) CXX11_OVERRIDE { for (User::ChanList::iterator i = user->chans.begin(); i != user->chans.end(); i++) @@ -142,7 +151,7 @@ class ModuleNickFlood : public Module if (f->islocked()) { - user->WriteNumeric(ERR_CANTCHANGENICK, InspIRCd::Format("%s has been locked for nickchanges for 60 seconds because there have been more than %u nick changes in %u seconds", channel->name.c_str(), f->nicks, f->secs)); + user->WriteNumeric(ERR_CANTCHANGENICK, InspIRCd::Format("%s has been locked for nickchanges for %u seconds because there have been more than %u nick changes in %u seconds", channel->name.c_str(), duration, f->nicks, f->secs)); return MOD_RES_DENY; } @@ -150,7 +159,7 @@ class ModuleNickFlood : public Module { f->clear(); f->lock(); - channel->WriteNotice(InspIRCd::Format("No nick changes are allowed for 60 seconds because there have been more than %u nick changes in %u seconds.", f->nicks, f->secs)); + channel->WriteNotice(InspIRCd::Format("No nick changes are allowed for %u seconds because there have been more than %u nick changes in %u seconds.", duration, f->nicks, f->secs)); return MOD_RES_DENY; } } |