From b8bcad048e7a87594e15bb0b42317fb3a4f64b83 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 6 Jan 2022 23:15:44 +0000 Subject: Update the copyright headers for 2022. --- modules/extra/m_ldap.cpp | 2 +- modules/extra/m_ldap_authentication.cpp | 2 +- modules/extra/m_ldap_oper.cpp | 2 +- modules/extra/m_mysql.cpp | 2 +- modules/extra/m_regex_pcre.cpp | 2 +- modules/extra/m_regex_posix.cpp | 2 +- modules/extra/m_regex_tre.cpp | 2 +- modules/extra/m_sql_authentication.cpp | 2 +- modules/extra/m_sql_log.cpp | 2 +- modules/extra/m_sql_oper.cpp | 2 +- modules/extra/m_sqlite.cpp | 2 +- modules/extra/m_ssl_gnutls.cpp | 2 +- modules/extra/m_ssl_openssl.cpp | 2 +- modules/extra/stats/cs_fantasy_stats.cpp | 2 +- modules/extra/stats/cs_fantasy_top.cpp | 2 +- modules/extra/stats/irc2sql/irc2sql.cpp | 2 +- modules/extra/stats/irc2sql/irc2sql.h | 2 +- modules/extra/stats/irc2sql/tables.cpp | 2 +- modules/extra/stats/irc2sql/utils.cpp | 2 +- modules/extra/stats/m_chanstats.cpp | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) (limited to 'modules/extra') diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index 1005d2efe..43ef0585f 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2011-2021 Anope Team + * (C) 2011-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index d3ee026d1..4fd543649 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2011-2021 Anope Team + * (C) 2011-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_ldap_oper.cpp b/modules/extra/m_ldap_oper.cpp index ad369ca1d..2c4b7609b 100644 --- a/modules/extra/m_ldap_oper.cpp +++ b/modules/extra/m_ldap_oper.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2011-2021 Anope Team + * (C) 2011-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index dcac30ebd..c94a443c4 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2010-2021 Anope Team + * (C) 2010-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_regex_pcre.cpp b/modules/extra/m_regex_pcre.cpp index 7248888d4..e52c16404 100644 --- a/modules/extra/m_regex_pcre.cpp +++ b/modules/extra/m_regex_pcre.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2012-2021 Anope Team + * (C) 2012-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_regex_posix.cpp b/modules/extra/m_regex_posix.cpp index 0f0e15c7c..e955f67c3 100644 --- a/modules/extra/m_regex_posix.cpp +++ b/modules/extra/m_regex_posix.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2012-2021 Anope Team + * (C) 2012-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_regex_tre.cpp b/modules/extra/m_regex_tre.cpp index 8e633b1ad..1df73dbe3 100644 --- a/modules/extra/m_regex_tre.cpp +++ b/modules/extra/m_regex_tre.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2012-2021 Anope Team + * (C) 2012-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp index 7569219e7..a19931b6b 100644 --- a/modules/extra/m_sql_authentication.cpp +++ b/modules/extra/m_sql_authentication.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2012-2021 Anope Team + * (C) 2012-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_sql_log.cpp b/modules/extra/m_sql_log.cpp index b3003703b..15d071ee2 100644 --- a/modules/extra/m_sql_log.cpp +++ b/modules/extra/m_sql_log.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2003-2021 Anope Team + * (C) 2003-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_sql_oper.cpp b/modules/extra/m_sql_oper.cpp index df14da8e4..925cd213b 100644 --- a/modules/extra/m_sql_oper.cpp +++ b/modules/extra/m_sql_oper.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2012-2021 Anope Team + * (C) 2012-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp index c1cf2b9cb..5e28d5a61 100644 --- a/modules/extra/m_sqlite.cpp +++ b/modules/extra/m_sqlite.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2011-2021 Anope Team + * (C) 2011-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_ssl_gnutls.cpp b/modules/extra/m_ssl_gnutls.cpp index f01d92a3b..1e834fc02 100644 --- a/modules/extra/m_ssl_gnutls.cpp +++ b/modules/extra/m_ssl_gnutls.cpp @@ -1,7 +1,7 @@ /* * * (C) 2014 Attila Molnar - * (C) 2014-2021 Anope Team + * (C) 2014-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/m_ssl_openssl.cpp b/modules/extra/m_ssl_openssl.cpp index c457c82af..59b949262 100644 --- a/modules/extra/m_ssl_openssl.cpp +++ b/modules/extra/m_ssl_openssl.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2010-2021 Anope Team + * (C) 2010-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/stats/cs_fantasy_stats.cpp b/modules/extra/stats/cs_fantasy_stats.cpp index 4c6ad95ff..0b7dda75e 100644 --- a/modules/extra/stats/cs_fantasy_stats.cpp +++ b/modules/extra/stats/cs_fantasy_stats.cpp @@ -1,6 +1,6 @@ /* Chanstats core functions * - * (C) 2003-2021 Anope Team + * (C) 2003-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/stats/cs_fantasy_top.cpp b/modules/extra/stats/cs_fantasy_top.cpp index b629cb132..88a10a3a1 100644 --- a/modules/extra/stats/cs_fantasy_top.cpp +++ b/modules/extra/stats/cs_fantasy_top.cpp @@ -1,6 +1,6 @@ /* Chanstats core functions * - * (C) 2003-2021 Anope Team + * (C) 2003-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/stats/irc2sql/irc2sql.cpp b/modules/extra/stats/irc2sql/irc2sql.cpp index 0d2d48d25..6c14ec00a 100644 --- a/modules/extra/stats/irc2sql/irc2sql.cpp +++ b/modules/extra/stats/irc2sql/irc2sql.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2013-2021 Anope Team + * (C) 2013-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/stats/irc2sql/irc2sql.h b/modules/extra/stats/irc2sql/irc2sql.h index 3caec03ba..bb385c672 100644 --- a/modules/extra/stats/irc2sql/irc2sql.h +++ b/modules/extra/stats/irc2sql/irc2sql.h @@ -1,6 +1,6 @@ /* * - * (C) 2013-2021 Anope Team + * (C) 2013-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/stats/irc2sql/tables.cpp b/modules/extra/stats/irc2sql/tables.cpp index 28110fa9e..e29a6d132 100644 --- a/modules/extra/stats/irc2sql/tables.cpp +++ b/modules/extra/stats/irc2sql/tables.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2013-2021 Anope Team + * (C) 2013-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/stats/irc2sql/utils.cpp b/modules/extra/stats/irc2sql/utils.cpp index c04b55960..888fc0cb0 100644 --- a/modules/extra/stats/irc2sql/utils.cpp +++ b/modules/extra/stats/irc2sql/utils.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2013-2021 Anope Team + * (C) 2013-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index 403174e6a..60ecd6bfe 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -1,6 +1,6 @@ /* * - * (C) 2012-2021 Anope Team + * (C) 2012-2022 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. -- cgit From 0e6f8488d3a1552f41ec7c0ab57899040d739ea2 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 9 Jan 2022 19:33:29 +0000 Subject: Avoid duplicate checks in irc2sql. --- modules/extra/stats/irc2sql/tables.cpp | 91 ++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 43 deletions(-) (limited to 'modules/extra') diff --git a/modules/extra/stats/irc2sql/tables.cpp b/modules/extra/stats/irc2sql/tables.cpp index e29a6d132..45fa301dd 100644 --- a/modules/extra/stats/irc2sql/tables.cpp +++ b/modules/extra/stats/irc2sql/tables.cpp @@ -25,52 +25,57 @@ void IRC2SQL::CheckTables() this->GetTables(); - if (GeoIPDB.equals_ci("country") && !this->HasTable(prefix + "geoip_country")) - { - query = "CREATE TABLE `" + prefix + "geoip_country` (" - "`start` INT UNSIGNED NOT NULL," - "`end` INT UNSIGNED NOT NULL," - "`countrycode` varchar(2)," - "`countryname` varchar(50)," - "PRIMARY KEY `end` (`end`)," - "KEY `start` (`start`)" - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; - this->RunQuery(query); - } - if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_blocks")) + if (GeoIPDB.equals_ci("country")) { - query = "CREATE TABLE `" + prefix + "geoip_city_blocks` (" - "`start` INT UNSIGNED NOT NULL," - "`end` INT UNSIGNED NOT NULL," - "`locId` INT UNSIGNED NOT NULL," - "PRIMARY KEY `end` (`end`)," - "KEY `start` (`start`)" - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; - this->RunQuery(query); - + if (!this->HasTable(prefix + "geoip_country")) + { + query = "CREATE TABLE `" + prefix + "geoip_country` (" + "`start` INT UNSIGNED NOT NULL," + "`end` INT UNSIGNED NOT NULL," + "`countrycode` varchar(2)," + "`countryname` varchar(50)," + "PRIMARY KEY `end` (`end`)," + "KEY `start` (`start`)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; + this->RunQuery(query); + } } - if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_location")) + else if (GeoIPDB.equals_ci("city")) { - query = "CREATE TABLE `" + prefix + "geoip_city_location` (" - "`locId` INT UNSIGNED NOT NULL," - "`country` CHAR(2) NOT NULL," - "`region` CHAR(2) NOT NULL," - "`city` VARCHAR(50)," - "`latitude` FLOAT," - "`longitude` FLOAT," - "`areaCode` INT," - "PRIMARY KEY (`locId`)" - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; - this->RunQuery(query); - } - if (GeoIPDB.equals_ci("city") && !this->HasTable(prefix + "geoip_city_region")) - { query = "CREATE TABLE `" + prefix + "geoip_city_region` (" - "`country` CHAR(2) NOT NULL," - "`region` CHAR(2) NOT NULL," - "`regionname` VARCHAR(100) NOT NULL," - "PRIMARY KEY (`country`,`region`)" - ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; - this->RunQuery(query); + if (!this->HasTable(prefix + "geoip_city_blocks")) + { + query = "CREATE TABLE `" + prefix + "geoip_city_blocks` (" + "`start` INT UNSIGNED NOT NULL," + "`end` INT UNSIGNED NOT NULL," + "`locId` INT UNSIGNED NOT NULL," + "PRIMARY KEY `end` (`end`)," + "KEY `start` (`start`)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; + this->RunQuery(query); + } + if (!this->HasTable(prefix + "geoip_city_location")) + { + query = "CREATE TABLE `" + prefix + "geoip_city_location` (" + "`locId` INT UNSIGNED NOT NULL," + "`country` CHAR(2) NOT NULL," + "`region` CHAR(2) NOT NULL," + "`city` VARCHAR(50)," + "`latitude` FLOAT," + "`longitude` FLOAT," + "`areaCode` INT," + "PRIMARY KEY (`locId`)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; + this->RunQuery(query); + } + if (!this->HasTable(prefix + "geoip_city_region")) + { query = "CREATE TABLE `" + prefix + "geoip_city_region` (" + "`country` CHAR(2) NOT NULL," + "`region` CHAR(2) NOT NULL," + "`regionname` VARCHAR(100) NOT NULL," + "PRIMARY KEY (`country`,`region`)" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; + this->RunQuery(query); + } } if (!this->HasTable(prefix + "server")) { -- cgit