summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/CMakeLists.txt144
-rw-r--r--src/modules/cs_appendtopic.cpp227
-rw-r--r--src/modules/cs_enforce.cpp444
-rw-r--r--src/modules/cs_set_misc.cpp196
-rw-r--r--src/modules/cs_tban.cpp209
-rw-r--r--src/modules/hs_request.cpp835
-rw-r--r--src/modules/m_helpchan.cpp47
-rw-r--r--src/modules/mysql/db_mysql.h212
-rw-r--r--src/modules/mysql/db_mysql_execute.cpp159
-rw-r--r--src/modules/mysql/db_mysql_read.cpp618
-rw-r--r--src/modules/mysql/db_mysql_write.cpp1040
-rw-r--r--src/modules/ns_maxemail.cpp169
-rw-r--r--src/modules/ns_set_misc.cpp213
-rw-r--r--src/modules/ssl/m_ssl.cpp142
14 files changed, 0 insertions, 4655 deletions
diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt
deleted file mode 100644
index a7feab5d0..000000000
--- a/src/modules/CMakeLists.txt
+++ /dev/null
@@ -1,144 +0,0 @@
-# Find all the *.cpp files within the current source directory, and sort the list
-file(GLOB MODULES_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp")
-set(MODULES_SRCS ${MODULES_SRCS_C} ${MODULES_SRCS_CPP})
-sort_list(MODULES_SRCS)
-
-# If using Windows, add the MODULE_COMPILE define
-if(WIN32)
- add_definitions(-DMODULE_COMPILE)
-endif(WIN32)
-
-# Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though)
-set_source_files_properties(${MODULES_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
-
-# Create an empty list to store extra include directories
-set(EXTRA_INCLUDES)
-
-# Iterate through all the source files
-foreach(SRC ${MODULES_SRCS})
- # Convert the source file extension to have a .so extension
- string(REGEX REPLACE "\\.(c|cpp)$" ".so" SO ${SRC})
- # Temporary variable for the current source's include directories
- set(TEMP_INCLUDES)
- # Calculate the header file dependencies for the given source file
- calculate_depends(${SRC} TEMP_INCLUDES)
- # If there were some extra include directories, add them to the list
- if(TEMP_INCLUDES)
- append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES})
- endif(TEMP_INCLUDES)
- # Reset linker flags
- set(TEMP_LDFLAGS)
- # Reset extra dependencies
- set(TEMP_DEPENDENCIES)
- # Calculate the library dependencies for the given source file
- calculate_libraries(${SRC} TEMP_LDFLAGS TEMP_DEPENDENCIES)
- # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators
- if(MSVC)
- set(WIN32_MEMORY win32_memory)
- else(MSVC)
- set(WIN32_MEMORY)
- endif(MSVC)
- # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
- add_library(${SO} MODULE ${SRC})
- set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS}")
- add_dependencies(${SO} ${PROGRAM_NAME})
- # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version
- if(WIN32)
- target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY} ${TEMP_DEPENDENCIES})
- set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
- endif(WIN32)
- # Set the module to be installed to the module directory under the data directory
- install(TARGETS ${SO}
- DESTINATION data/modules
- )
-endforeach(SRC)
-
-# Get a list of ALL files and directories within the current directory
-file(GLOB MODULES_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*")
-remove_item_from_list(MODULES_FILES "CMakeFiles")
-remove_item_from_list(MODULES_FILES "mysql")
-remove_item_from_list(MODULES_FILES "ssl")
-
-# Iterate through this directory searching for subdirectories, and creating modules for those subdirectories
-foreach(FILE ${MODULES_FILES})
- if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}")
- file(GLOB MODULES_SUBDIR_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${FILE}/*.c")
- file(GLOB MODULES_SUBDIR_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${FILE}/*.cpp")
- set(MODULES_SUBDIR_SRCS ${MODULES_SUBDIR_SRCS_C} ${MODULES_SUBDIR_SRCS_CPP})
- sort_list(MODULES_SUBDIR_SRCS)
-
- # Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though)
- set_source_files_properties(${MODULES_SUBDIR_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
-
- # Add .so to the end of the directory name, this will be the module's name
- set(SO "${FILE}.so")
-
- # Temporary linker flags for this subdirectory
- set(SUBDIR_LDFLAGS "${LDFLAGS}")
- # Temporary extra dependencies for this subdirectory
- set(SUBDIR_EXTRA_DEPENDS)
-
- # Iterate through the source files in the subdirectory
- foreach(SRC ${MODULES_SUBDIR_SRCS})
- # Temporary variable for the current source's include directories
- set(TEMP_INCLUDES)
- # Calculate the header file dependencies for the given source file
- calculate_depends(${SRC} TEMP_INCLUDES)
- # If there were some extra include directories, add them to the list
- if(TEMP_INCLUDES)
- append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES})
- endif(TEMP_INCLUDES)
- # Reset linker flags
- set(TEMP_LDFLAGS)
- # Reset extra dependencies
- set(TEMP_DEPENDENCIES)
- # Calculate the library dependencies for the given source file
- calculate_libraries(${SRC} TEMP_LDFLAGS TEMP_DEPENDENCIES)
-
- # Append this source file's linker flags to the subdirectoy's linker flags, if there are any to append
- if(TEMP_LDFLAGS)
- set(SUBDIR_LDFLAGS "${SUBDIR_LDFLAGS} ${TEMP_LDFLAGS}")
- endif(TEMP_LDFLAGS)
- # Append this source file's extra dependencies to the subdirector's extra dependencies, if there are any to append
- if(TEMP_DEPENDENCIES)
- append_to_list(SUBDIR_EXTRA_DEPENDS ${TEMP_DEPENDENCIES})
- endif(TEMP_DEPENDENCIES)
- endforeach(SRC)
-
- # Remove duplicates from the linker flags
- if(SUBDIR_LDFLAGS)
- remove_list_duplicates(SUBDIR_LDFLAGS)
- endif(SUBDIR_LDFLAGS)
- # Remove duplicates from the extra dependencies
- if(SUBDIR_EXTRA_DEPENDS)
- remove_list_duplicates(SUBDIR_EXTRA_DEPENDS)
- endif(SUBDIR_EXTRA_DEPENDS)
-
- # For Visual Studio only, include win32_memory static library, required to override Visual Studio's overrides of the new/delete operators
- if(MSVC)
- set(WIN32_MEMORY win32_memory)
- else(MSVC)
- set(WIN32_MEMORY)
- endif(MSVC)
-
- # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
- add_library(${SO} MODULE ${MODULES_SUBDIR_SRCS})
- set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS}")
- add_dependencies(${SO} ${PROGRAM_NAME})
- # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version
- if(WIN32)
- target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 ${WIN32_MEMORY} ${SUBDIR_EXTRA_DEPENDS})
- set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
- endif(WIN32)
- # Set the module to be installed to the module directory under the data directory
- install(TARGETS ${SO}
- DESTINATION data/modules
- )
- endif(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}")
-endforeach(FILE)
-
-# If there were extra include directories, remove the duplicates and add the directories to the include path
-if(EXTRA_INCLUDES)
- remove_list_duplicates(EXTRA_INCLUDES)
- include_directories(${EXTRA_INCLUDES})
-endif(EXTRA_INCLUDES)
diff --git a/src/modules/cs_appendtopic.cpp b/src/modules/cs_appendtopic.cpp
deleted file mode 100644
index 03f20ba6c..000000000
--- a/src/modules/cs_appendtopic.cpp
+++ /dev/null
@@ -1,227 +0,0 @@
-/* cs_appendtopic.c - Add text to a channels topic
- *
- * (C) 2003-2010 Anope Team
- * Contact us at team@anope.org
- *
- * Based on the original module by SGR <Alex_SGR@ntlworld.com>
- * Included in the Anope module pack since Anope 1.7.9
- * Anope Coder: GeniusDex <geniusdex@anope.org>
- *
- * Please read COPYING and README for further details.
- *
- * Send bug reports to the Anope Coder instead of the module
- * author, because any changes since the inclusion into anope
- * are not supported by the original author.
- */
-
-/*************************************************************************/
-
-#include "module.h"
-
-#define AUTHOR "SGR"
-
-/* ------------------------------------------------------------
- * Name: cs_appendtopic
- * Author: SGR <Alex_SGR@ntlworld.com>
- * Date: 31/08/2003
- * ------------------------------------------------------------
- *
- * This module has no configurable options. For information on
- * this module, load it and refer to /ChanServ APPENDTOPIC HELP
- *
- * Thanks to dengel, Rob and Certus for all there support.
- * Especially Rob, who always manages to show me where I have
- * not allocated any memory. Even if it takes a few weeks of
- * pestering to get him to look at it.
- *
- * ------------------------------------------------------------
- */
-
-/* ---------------------------------------------------------------------- */
-/* DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING */
-/* ---------------------------------------------------------------------- */
-
-enum
-{
- LNG_CHAN_HELP,
- LNG_CHAN_HELP_APPENDTOPIC,
- LNG_APPENDTOPIC_SYNTAX,
- LNG_NUM_STRINGS
-};
-
-static Module *me;
-
-class CommandCSAppendTopic : public Command
-{
- public:
- CommandCSAppendTopic() : Command("APPENDTOPIC", 2, 2)
- {
- }
-
- CommandReturn Execute(User *u, const std::vector<ci::string> &params)
- {
- const char *chan = params[0].c_str();
- const char *newtopic = params[1].c_str();
- char topic[1024];
- Channel *c = findchan(chan);
- ChannelInfo *ci;
-
- if (c)
- ci = c->ci;
-
- if (!c)
- notice_lang(Config.s_ChanServ, u, CHAN_X_NOT_IN_USE, chan);
- else if (!check_access(u, ci, CA_TOPIC))
- notice_lang(Config.s_ChanServ, u, ACCESS_DENIED);
- else
- {
- if (ci->last_topic)
- {
- snprintf(topic, sizeof(topic), "%s %s", ci->last_topic, newtopic);
- delete [] ci->last_topic;
- }
- else
- strscpy(topic, newtopic, sizeof(topic));
-
- ci->last_topic = *topic ? sstrdup(topic) : NULL;
- ci->last_topic_setter = u->nick;
- ci->last_topic_time = time(NULL);
-
- if (c->topic)
- delete [] c->topic;
- c->topic = *topic ? sstrdup(topic) : NULL;
- c->topic_setter = u->nick;
- if (ircd->topictsbackward)
- c->topic_time = c->topic_time - 1;
- else
- c->topic_time = ci->last_topic_time;
-
- if (!check_access(u, ci, CA_TOPIC))
- Alog() << Config.s_ChanServ << ": " << u->GetMask() << " changed topic of " << c->name << " as services admin.";
- if (ircd->join2set && whosends(ci) == ChanServ)
- {
- ChanServ->Join(c);
- ircdproto->SendMode(NULL, c, "+o %s", Config.s_ChanServ); // XXX
- }
- ircdproto->SendTopic(whosends(ci), c, u->nick.c_str(), topic);
- if (ircd->join2set && whosends(ci) == ChanServ)
- ChanServ->Part(c);
- }
- return MOD_CONT;
- }
-
- bool OnHelp(User *u, const ci::string &subcommand)
- {
- me->NoticeLang(Config.s_ChanServ, u, LNG_APPENDTOPIC_SYNTAX);
- u->SendMessage(Config.s_ChanServ, " ");
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_HELP_APPENDTOPIC);
-
- return true;
- }
-
- void OnSyntaxError(User *u, const ci::string &subcommand)
- {
- me->NoticeLang(Config.s_ChanServ, u, LNG_APPENDTOPIC_SYNTAX);
- }
-
- void OnServHelp(User *u)
- {
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_HELP);
- }
-};
-
-class CSAppendTopic : public Module
-{
- public:
- CSAppendTopic(const std::string &modname, const std::string &creator) : Module(modname, creator)
- {
- me = this;
-
- this->SetAuthor(AUTHOR);
- this->SetType(SUPPORTED);
-
- this->AddCommand(ChanServ, new CommandCSAppendTopic());
-
- /* English (US) */
- const char* langtable_en_us[] = {
- /* LNG_CHAN_HELP */
- " APPENDTOPIC Add text to a channels topic",
- /* LNG_CHAN_HELP_APPENDTOPIC */
- "This command allows users to append text to a currently set\n"
- "channel topic. When TOPICLOCK is on, the topic is updated and\n"
- "the new, updated topic is locked.",
- /* LNG_APPENDTOPIC_SYNTAX */
- "Syntax: APPENDTOPIC channel text\n"
- };
-
- /* Dutch (NL) */
- const char* langtable_nl[] = {
- /* LNG_CHAN_HELP */
- " APPENDTOPIC Voeg tekst aan een kanaal onderwerp toe",
- /* LNG_CHAN_HELP_APPENDTOPIC */
- "Dit command stelt gebruikers in staat om text toe te voegen\n"
- "achter het huidige onderwerp van een kanaal. Als TOPICLOCK aan\n"
- "staat, zal het onderwerp worden bijgewerkt en zal het nieuwe,\n"
- "bijgewerkte topic worden geforceerd.",
- /* LNG_APPENDTOPIC_SYNTAX */
- "Gebruik: APPENDTOPIC kanaal tekst\n"
- };
-
- /* German (DE) */
- const char* langtable_de[] = {
- /* LNG_CHAN_HELP */
- " APPENDTOPIC Fьgt einen Text zu einem Channel-Topic hinzu.",
- /* LNG_CHAN_HELP_APPENDTOPIC */
- "Dieser Befehl erlaubt Benutzern, einen Text zu dem vorhandenen Channel-Topic\n"
- "hinzuzufьgen. Wenn TOPICLOCK gesetzt ist, wird das Topic aktualisiert\n"
- "und das neue, aktualisierte Topic wird gesperrt.",
- /* LNG_APPENDTOPIC_SYNTAX */
- "Syntax: APPENDTOPIC Channel Text\n"
- };
-
- /* Portuguese (PT) */
- const char* langtable_pt[] = {
- /* LNG_CHAN_HELP */
- " APPENDTOPIC Adiciona texto ao tуpico de um canal",
- /* LNG_CHAN_HELP_APPENDTOPIC */
- "Este comando permite aos usuбrios anexar texto a um tуpico de canal\n"
- "jб definido. Quando TOPICLOCK estб ativado, o tуpico й atualizado e\n"
- "o novo tуpico й travado.",
- /* LNG_APPENDTOPIC_SYNTAX */
- "Sintaxe: APPENDTOPIC canal texto\n"
- };
-
- /* Russian (RU) */
- const char* langtable_ru[] = {
- /* LNG_CHAN_HELP */
- " APPENDTOPIC Добавляет текст к топику канала",
- /* LNG_CHAN_HELP_APPENDTOPIC */
- "Данная команда позволяет добавить текст к топику, который установлен на указанном\n"
- "канале. Если активирован режим TOPICLOCK, топик будет обновлен и заблокирован.\n"
- "Примечание: текст будет ДОБАВЛЕН к топику, то есть старый топик удален НЕ БУДЕТ.\n",
- /* LNG_APPENDTOPIC_SYNTAX */
- "Синтаксис: APPENDTOPIC #канал текст\n"
- };
-
- /* Italian (IT) */
- const char* langtable_it[] = {
- /* LNG_CHAN_HELP */
- " APPENDTOPIC Aggiunge del testo al topic di un canale",
- /* LNG_CHAN_HELP_APPENDTOPIC */
- "Questo comando permette agli utenti di aggiungere del testo ad un topic di un canale\n"
- "giа impostato. Se TOPICLOCK и attivato, il topic viene aggiornato e il nuovo topic\n"
- "viene bloccato.",
- /* LNG_APPENDTOPIC_SYNTAX */
- "Sintassi: APPENDTOPIC canale testo\n"
- };
-
- this->InsertLanguage(LANG_EN_US, LNG_NUM_STRINGS, langtable_en_us);
- this->InsertLanguage(LANG_NL, LNG_NUM_STRINGS, langtable_nl);
- this->InsertLanguage(LANG_DE, LNG_NUM_STRINGS, langtable_de);
- this->InsertLanguage(LANG_PT, LNG_NUM_STRINGS, langtable_pt);
- this->InsertLanguage(LANG_RU, LNG_NUM_STRINGS, langtable_ru);
- this->InsertLanguage(LANG_IT, LNG_NUM_STRINGS, langtable_it);
- }
-};
-
-MODULE_INIT(CSAppendTopic)
diff --git a/src/modules/cs_enforce.cpp b/src/modules/cs_enforce.cpp
deleted file mode 100644
index c4cfbecc9..000000000
--- a/src/modules/cs_enforce.cpp
+++ /dev/null
@@ -1,444 +0,0 @@
-/* cs_enforce - Add a /cs ENFORCE command to enforce various set
- * options and channelmodes on a channel.
- *
- * (C) 2003-2010 Anope Team
- * Contact us at team@anope.org
- *
- * Included in the Anope module pack since Anope 1.7.9
- * Anope Coder: GeniusDex <geniusdex@anope.org>
- *
- * Please read COPYING and README for further details.
- *
- * Send any bug reports to the Anope Coder, as he will be able
- * to deal with it best.
- */
-
-#include "module.h"
-
-#define AUTHOR "Anope"
-
-enum
-{
- LNG_CHAN_HELP,
- LNG_ENFORCE_SYNTAX,
- LNG_CHAN_HELP_ENFORCE,
- LNG_CHAN_HELP_ENFORCE_R_ENABLED,
- LNG_CHAN_HELP_ENFORCE_R_DISABLED,
- LNG_CHAN_RESPONSE,
- LNG_NUM_STRINGS
-};
-
-static Module *me;
-
-class CommandCSEnforce : public Command
-{
- private:
- void DoSet(Channel *c)
- {
- ChannelInfo *ci;
-
- if (!(ci = c->ci))
- return;
-
- if (ci->HasFlag(CI_SECUREOPS))
- this->DoSecureOps(c);
- if (ci->HasFlag(CI_RESTRICTED))
- this->DoRestricted(c);
- }
-
- void DoModes(Channel *c)
- {
- if (c->HasMode(CMODE_REGISTEREDONLY))
- this->DoCModeR(c);
- }
-
- void DoSecureOps(Channel *c)
- {
- ChannelInfo *ci;
- bool hadsecureops = false;
-
- if (!(ci = c->ci))
- return;
-
- Alog(LOG_DEBUG) << "[cs_enforce] Enforcing SECUREOPS on " << c->name;
-
- /* Dirty hack to allow chan_set_correct_modes to work ok.
- * We pretend like SECUREOPS is on so it doesn't ignore that
- * part of the code. This way we can enforce SECUREOPS even
- * if it's off.
- */
- if (!ci->HasFlag(CI_SECUREOPS))
- {
- ci->SetFlag(CI_SECUREOPS);
- hadsecureops = true;
- }
-
- for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it)
- {
- UserContainer *uc = *it;
-
- chan_set_correct_modes(uc->user, c, 0);
- }
-
- if (hadsecureops)
- ci->UnsetFlag(CI_SECUREOPS);
- }
-
- void DoRestricted(Channel *c)
- {
- ChannelInfo *ci;
- int16 old_nojoin_level;
- char mask[BUFSIZE];
- const char *reason;
-
- if (!(ci = c->ci))
- return;
-
- Alog(LOG_DEBUG) << "[cs_enforce] Enforcing RESTRICTED on " << c->name;
-
- old_nojoin_level = ci->levels[CA_NOJOIN];
- if (ci->levels[CA_NOJOIN] < 0)
- ci->levels[CA_NOJOIN] = 0;
-
- for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; )
- {
- UserContainer *uc = *it++;
-
- if (check_access(uc->user, ci, CA_NOJOIN))
- {
- get_idealban(ci, uc->user, mask, sizeof(mask));
- reason = getstring(uc->user, CHAN_NOT_ALLOWED_TO_JOIN);
- c->SetMode(NULL, CMODE_BAN, mask);
- c->Kick(NULL, uc->user, "%s", reason);
- }
- }
-
- ci->levels[CA_NOJOIN] = old_nojoin_level;
- }
-
- void DoCModeR(Channel *c)
- {
- ChannelInfo *ci;
- char mask[BUFSIZE];
- const char *reason;
-
- if (!(ci = c->ci))
- return;
-
- Alog(LOG_DEBUG) << "[cs_enforce] Enforcing mode +R on " << c->name;
-
- for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; )
- {
- UserContainer *uc = *it++;
-
- if (!uc->user->IsIdentified())
- {
- get_idealban(ci, uc->user, mask, sizeof(mask));
- reason = getstring(uc->user, CHAN_NOT_ALLOWED_TO_JOIN);
- if (!c->HasMode(CMODE_REGISTERED))
- c->SetMode(NULL, CMODE_BAN, mask);
- c->Kick(NULL, uc->user, "%s", reason);
- }
- }
- }
- public:
- CommandCSEnforce() : Command("ENFORCE", 1, 2)
- {
- }
-
- CommandReturn Execute(User *u, const std::vector<ci::string> &params)
- {
- const char *chan = params[0].c_str();
- ci::string what = params.size() > 1 ? params[1] : "";
- Channel *c = findchan(chan);
- ChannelInfo *ci;
-
- if (c)
- ci = c->ci;
-
- if (!c)
- notice_lang(Config.s_ChanServ, u, CHAN_X_NOT_IN_USE, chan);
- else if (!check_access(u, ci, CA_AKICK))
- notice_lang(Config.s_ChanServ, u, ACCESS_DENIED);
- else
- {
- if (what.empty() || what == "SET")
- {
- this->DoSet(c);
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_RESPONSE, !what.empty() ? what.c_str() : "SET");
- }
- else if (what == "MODES")
- {
- this->DoModes(c);
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_RESPONSE, what.c_str());
- }
- else if (what == "SECUREOPS")
- {
- this->DoSecureOps(c);
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_RESPONSE, what.c_str());
- }
- else if (what == "RESTRICTED")
- {
- this->DoRestricted(c);
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_RESPONSE, what.c_str());
- }
- else if (what == "+R")
- {
- this->DoCModeR(c);
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_RESPONSE, what.c_str());
- }
- else
- this->OnSyntaxError(u, "");
- }
-
- return MOD_CONT;
- }
-
- bool OnHelp(User *u, const ci::string &subcommand)
- {
- me->NoticeLang(Config.s_ChanServ, u, LNG_ENFORCE_SYNTAX);
- u->SendMessage(Config.s_ChanServ, " ");
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_HELP_ENFORCE);
- u->SendMessage(Config.s_ChanServ, " ");
- if (ModeManager::FindChannelModeByName(CMODE_REGISTERED))
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_HELP_ENFORCE_R_ENABLED);
- else
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_HELP_ENFORCE_R_DISABLED);
-
- return true;
- }
-
- void OnSyntaxError(User *u, const ci::string &subcommand)
- {
- me->NoticeLang(Config.s_ChanServ, u, LNG_ENFORCE_SYNTAX);
- }
-
- void OnServHelp(User *u)
- {
- me->NoticeLang(Config.s_ChanServ, u, LNG_CHAN_HELP);
- }
-};
-
-class CSEnforce : public Module
-{
- public:
- CSEnforce(const std::string &modname, const std::string &creator) : Module(modname, creator)
- {
- me = this;
-
- this->SetAuthor(AUTHOR);
- this->SetType(SUPPORTED);
-
- this->AddCommand(ChanServ, new CommandCSEnforce());
-
- /* English (US) */
- const char* langtable_en_us[] = {
- /* LNG_CHAN_HELP */
- " ENFORCE Enforce various channel modes and set options",
- /* LNG_ENFORCE_SYNTAX */
- "Syntax: \002ENFORCE \037channel\037 [\037what\037]\002",
- /* LNG_CHAN_HELP_ENFORCE */
- "Enforce various channel modes and set options. The \037channel\037\n"
- "option indicates what channel to enforce the modes and options\n"
- "on. The \037what\037 option indicates what modes and options to\n"
- "enforce, and can be any of SET, SECUREOPS, RESTRICTED, MODES,\n"
- "or +R. When left out, it defaults to SET.\n"
- " \n"
- "If \037what\037 is SET, it will enforce SECUREOPS and RESTRICTED\n"
- "on the users currently in the channel, if they are set. Give\n"
- "SECUREOPS to enforce the SECUREOPS option, even if it is not\n"
- "enabled. Use RESTRICTED to enfore the RESTRICTED option, also\n"
- "if it's not enabled.",
- /* LNG_CHAN_HELP_ENFORCE_R_ENABLED */
- "If \037what\037 is MODES, it will enforce channelmode +R if it is\n"
- "set. If +R is specified for \037what\037, the +R channelmode will\n"
- "also be enforced, but even if it is not set. If it is not set,\n"
- "users will be banned to ensure they don't just rejoin.",
- /* LNG_CHAN_HELP_ENFORCE_R_DISABLED */
- "If \037what\037 is MODES, nothing will be enforced, since it would\n"
- "enforce modes that the current ircd does not support. If +R is\n"
- "specified for \037what\037, an equalivant of channelmode +R on\n"
- "other ircds will be enforced. All users that are in the channel\n"
- "but have not identified for their nickname will be kicked and\n"
- "banned from the channel.",
- /* LNG_CHAN_RESPONSE */
- "Enforced %s"
- };
-
- /* Dutch (NL) */
- const char* langtable_nl[] = {
- /* LNG_CHAN_HELP */
- " ENFORCE Forceer enkele kanaalmodes en set-opties",
- /* LNG_ENFORCE_SYNTAX */
- "Syntax: \002ENFORCE \037kanaal\037 [\037wat\037]\002",
- /* LNG_CHAN_HELP_ENFORCE */
- "Forceer enkele kannalmodes en set-opties. De \037kanaal\037 optie\n"
- "geeft aan op welk kanaal de modes en opties geforceerd moeten\n"
- "worden. De \037wat\037 optie geeft aan welke modes en opties\n"
- "geforceerd moeten worden; dit kan SET, SECUREOPS, RESTRICTED,\n"
- "MODES, of +R zijn. Indien weggelaten is dit standaard SET.\n"
- " \n"
- "Als er voor \037wat\037 SET wordt ingevuld, zullen SECUREOPS en\n"
- "RESTRICTED geforceerd worden op de gebruikers in het kanaal,\n"
- "maar alleen als die opties aangezet zijn voor het kanaal. Als\n"
- "SECUREOPS of RESTRICTED wordt gegeven voor \037wat\037 zal die optie\n"
- "altijd geforceerd worden, ook als die niet is aangezet.",
- /* LNG_CHAN_HELP_ENFORCE_R_ENABLED */
- "Als er voor \037wat\037 MODES wordt ingevuld, zal kanaalmode +R worden\n"
- "geforceerd, als die op het kanaal aan staat. Als +R wordt ingevuld,\n"
- "zal kanaalmode +R worden geforceerd, maar ook als die niet aan"
- "staat voor het kanaal. Als +R niet aan staat, zullen alle ook\n"
- "gebanned worden om te zorgen dat ze niet opnieuw het kanaal binnen\n"
- "kunnen komen.",
- /* LNG_CHAN_HELP_ENFORCE_R_DISABLED */
- "Als er voor \037wat\037 MODES wordt ingevuld, zal er niks gebeuren.\n"
- "Normaal gesproken wordt er een kanaalmode geforceerd die op deze\n"
- "server niet ondersteund wordt. Als +R wordt ingevuld voor \037wat\037\n"
- "zullen alle gebruikers die in het kanaal zitten maar zich niet\n"
- "hebben geidentificeerd voor hun nick uit het kanaal gekicked en\n"
- "verbannen worden.",
- /* LNG_CHAN_RESPONSE */
- "Enforced %s"
- };
-
- /* German (DE) */
- const char* langtable_de[] = {
- /* LNG_CHAN_HELP */
- " ENFORCE Erzwingt verschieden Modes und SET Optionen",
- /* LNG_ENFORCE_SYNTAX */
- "Syntax: \002ENFORCE \037Channel\037 [\037was\037]\002",
- /* LNG_CHAN_HELP_ENFORCE */
- "Erzwingt verschieden Modes und SET Optionen. Die \037Channel\037\n"
- "Option zeigt dir den Channel an, indem Modes und Optionen\n"
- "zu erzwingen sind. Die \037was\037 Option zeigt dir welche Modes\n"
- "und Optionen zu erzwingen sind. Die kцnnen nur SET, SECUREOPS,\n"
- "RESTRICTED, MODES oder +R sein.Default ist SET.\n"
- " \n"
- "Wenn \037was\037 SET ist, wird SECUREOPS und RESTRICTED\n"
- "auf die User die z.Z.in Channel sind erzwungen, wenn sie AN sind.\n"
- "Benutze SECUREOPS oder RESTRICTED , um die Optionen einzeln\n"
- "zu erzwingen, also wenn sie nicht eingeschaltet sind.",
- /* LNG_CHAN_HELP_ENFORCE_R_ENABLED */
- "Wenn \037was\037 MODES ist, wird das ChannelMode +R erzwungen\n"
- "falls an. Wenn \037was\037 +R ist, wird +R erzwungen aber eben\n"
- "wenn noch nicht als Channel-Mode ist. Wenn +R noch nicht als\n"
- "Channel-Mode war werden alle User aus den Channel gebannt um\n"
- "sicher zu sein das sie nicht rejoinen.",
- /* LNG_CHAN_HELP_ENFORCE_R_DISABLED */
- "Wenn \037was\037 MODES ist, wird nichts erzwungen weil es MODES seine\n"
- "kцnnen die dein IRCD nicht unterstьtzt. Wenn \037was\037 +R ist\n"
- "oder ein Modes was auf ein anderen IRCD gleich +R ist, wird es\n"
- "erzwungen. Alle User die nicht fьr deren Nicknamen identifiziert\n"
- "sind werden aus den Channel gekickt und gebannt.",
- /* LNG_CHAN_RESPONSE */
- "Erzwungen %s"
- };
-
- /* Portuguese (PT) */
- const char* langtable_pt[] = {
- /* LNG_CHAN_HELP */
- " ENFORCE Verifica o cumprimento de vбrios modos de canal e opзхes ajustadas",
- /* LNG_ENFORCE_SYNTAX */
- "Sintaxe: \002ENFORCE \037canal\037 [\037opзгo\037]\002",
- /* LNG_CHAN_HELP_ENFORCE */
- "Verifica o cumprimento de vбrios modos de canal e opзхes ajustadas.\n"
- "O campo \037canal\037 indica qual canal deve ter os modos e opзхes verificadas\n"
- "O campo \037opзгo\037 indica quais modos e opзхes devem ser verificadas,\n"
- "e pode ser: SET, SECUREOPS, RESTRICTED, MODES ou +R\n"
- "Quando deixado em branco, o padrгo й SET.\n"
- " \n"
- "Se \037opзгo\037 for SET, serгo verificadas as opзхes SECUREOPS e RESTRICTED\n"
- "para usuбrios que estiverem no canal, caso elas estejam ativadas. Use\n"
- "SECUREOPS para verificar a opзгo SECUREOPS, mesmo que ela nгo esteja ativada\n"
- "Use RESTRICTED para verificar a opзгo RESTRICTED, mesmo que ela nгo esteja\n"
- "ativada.",
- /* LNG_CHAN_HELP_ENFORCE_R_ENABLED */
- "Se \037opзгo\037 for MODES, serб verificado o modo de canal +R caso ele\n"
- "esteja ativado. Se +R for especificado para \037opзгo\037, o modo de canal\n"
- "+R tambйm serб verificado, mesmo que ele nгo esteja ativado. Se ele nгo\n"
- "estiver ativado, os usuбrios serгo banidos para evitar que reentrem no canal.",
- /* LNG_CHAN_HELP_ENFORCE_R_DISABLED */
- "Se \037opзгo\037 for MODES, nada serб verificado, visto que isto poderia\n"
- "verificar modos que o IRCd atual nгo suporta. Se +R for especificado\n"
- "para \037opзгo\037, um equivalente ao modo de canal +R em outros IRCds\n"
- "serб verificado. Todos os usuбrios que estгo no canal, mas nгo estejam\n"
- "identificados para seus nicks serгo kickados e banidos do canal.",
- /* LNG_CHAN_RESPONSE */
- "Verificado %s"
- };
-
- /* Russian (RU) */
- const char* langtable_ru[] = {
- /* LNG_CHAN_HELP */
- " ENFORCE Перепроверка и установка различных режимов и опций канала",
- /* LNG_ENFORCE_SYNTAX */
- "Синтаксис: \002ENFORCE \037#канал\037 \037параметр\037\002",
- /* LNG_CHAN_HELP_ENFORCE */
- "Перепроверка и установка различных режимов и опций канала.\n"
- "\037Параметр\037 указывает какие опции или режимы канала должны быть\n"
- "перепроверены. В качестве параметра могут быть указаны: SET, SECUREOPS,\n"
- "RESTRICTED, MODES, или +R. Если параметр не указан, по-умолчанию будет SET.\n"
- " \n"
- "Если в качестве \037параметра\037 указано SET, будут перепроверены опции\n"
- "SECUREOPS и RESTRICTED относительно пользователей на указанном канале\n"
- "(при условии, что опции включены). Отдельно указанный параметр SECUREOPS\n"
- "применит опцию SECUREOPS (даже если она \037НЕ\037 установлена). Параметр\n"
- "RESTRICTED применит опцию RESTRICTED (даже если она \037НЕ\037 установлена)",
- /* LNG_CHAN_HELP_ENFORCE_R_ENABLED */
- "Если в качестве \037параметра\037 указано MODES, будет перепроверен режим +R\n"
- "(если он установлен). Отдельно указанный параметр \037+R\037 применит\n"
- "канальный режим +R, даже если он не установлен, и забанит всех пользователей,\n"
- "которые не идентифицировались к своему нику или не имеют зарегистрированного ника.",
- /* LNG_CHAN_HELP_ENFORCE_R_DISABLED */
- "Если в качестве \037параметра\037 указано MODES, перепроверка осуществлена\n"
- "НЕ БУДЕТ, так как текущий IRCD не поддерживает необходимые режимы.\n"
- "Отдельно указанный параметр \037+R\037 применит канальный режим, эквивалентный\n"
- "режиму +R и забанит всех пользователей, которые не идентифицировались к своему\n"
- "нику или не имеют зарегистрированного ника.",
- /* LNG_CHAN_RESPONSE */
- "Перепроверено: %s"
- };
-
- /* Italian (IT) */
- const char* langtable_it[] = {
- /* LNG_CHAN_HELP */
- " ENFORCE Forza diversi modi di canale ed opzioni SET",
- /* LNG_ENFORCE_SYNTAX */
- "Sintassi: \002ENFORCE \037canale\037 [\037cosa\037]\002",
- /* LNG_CHAN_HELP_ENFORCE */
- "Forza diversi modi di canale ed opzioni SET. Il parametro \037canale\037\n"
- "indica il canale sul quale forzare i modi e le opzioni. Il parametro\n"
- "\037cosa\037 indica i modi e le opzioni da forzare, e possono essere\n"
- "qualsiasi delle opzioni SET, SECUREOPS, RESTRICTED, MODES, o +R.\n"
- "Se non specificato, viene sottointeso SET.\n"
- " \n"
- "Se \037cosa\037 и SET, forzerа SECUREOPS e RESTRICTED sugli utenti\n"
- "attualmente nel canale, se sono impostati. Specifica SECUREOPS per\n"
- "forzare l'opzione SECUREOPS, anche se non и attivata. Specifica\n"
- "RESTRICTED per forzare l'opzione RESTRICTED, anche se non и\n"
- "attivata.",
- /* LNG_CHAN_HELP_ENFORCE_R_ENABLED */
- "Se \037cosa\037 и MODES, forzerа il modo del canale +R se и impostato.\n"
- "Se +R и specificato per \037cosa\037, il modo del canale +R verrа\n"
- "forzato, anche se non и impostato. Se non и impostato, gli utenti\n"
- "verranno bannati per assicurare che non rientrino semplicemente.",
- /* LNG_CHAN_HELP_ENFORCE_R_DISABLED */
- "Se \037cosa\037 и MODES, niente verrа forzato, siccome forzerebbe\n"
- "dei modi che l'ircd in uso non supporterebbe. Se +R и specificato\n"
- "per \037cosa\037, un modo equivalente a +R sui altri ircd verrа\n"
- "forzato. Tutti gli utenti presenti nel canale ma non identificati\n"
- "per il loro nickname verranno bannati ed espulsi dal canale.\n",
- /* LNG_CHAN_RESPONSE */
- "Forzato %s"
- };
-
- this->InsertLanguage(LANG_EN_US, LNG_NUM_STRINGS, langtable_en_us);
- this->InsertLanguage(LANG_NL, LNG_NUM_STRINGS, langtable_nl);
- this->InsertLanguage(LANG_DE, LNG_NUM_STRINGS, langtable_de);
- this->InsertLanguage(LANG_PT, LNG_NUM_STRINGS, langtable_pt);
- this->InsertLanguage(LANG_RU, LNG_NUM_STRINGS, langtable_ru);
- this->InsertLanguage(LANG_IT, LNG_NUM_STRINGS, langtable_it);
- }
-};
-
-MODULE_INIT(CSEnforce)
diff --git a/src/modules/cs_set_misc.cpp b/src/modules/cs_set_misc.cpp
deleted file mode 100644
index 453e242a3..000000000
--- a/src/modules/cs_set_misc.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- *
- * (C) 2003-2010 Anope Team
- * Contact us at team@anope.org
- *
- * Please read COPYING and README for further details.
- *
- * Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- */
-
-/*************************************************************************/
-
-#include "module.h"
-
-class CommandCSSetMisc : public Command
-{
- std::string Desc;
- public:
- CommandCSSetMisc(const ci::string &cname, const std::string &desc, const ci::string &cpermission = "") : Command(cname, 1, 2, cpermission), Desc(desc)
- {
- }
-
- CommandReturn Execute(User *u, const std::vector<ci::string> &params)
- {
- ChannelInfo *ci = cs_findchan(params[0]);
- assert(ci);
-
- ci->Shrink("chanserv:" + std::string(this->name.c_str()));
- if (params.size() > 1)
- {
- ci->Extend("chanserv:" + std::string(this->name.c_str()), new ExtensibleItemRegular<ci::string>(params[1]));
- notice_lang(Config.s_ChanServ, u, CHAN_SETTING_CHANGED, this->name.c_str(), ci->name.c_str(), params[1].c_str());
- }
- else
- {
- notice_lang(Config.s_ChanServ, u, CHAN_SETTING_UNSET, this->name.c_str(), ci->name.c_str());
- }
-
- return MOD_CONT;
- }
-
- void OnSyntaxError(User *u, const ci::string &)
- {
- syntax_error(Config.s_ChanServ, u, "SET", CHAN_SET_SYNTAX);
- }
-
- void OnServHelp(User *u)
- {
- u->SendMessage(Config.s_ChanServ, " %-10s %s", this->name.c_str(), this->Desc.c_str());
- }
-};
-
-class CommandCSSASetMisc : public CommandCSSetMisc
-{
- public:
- CommandCSSASetMisc(const ci::string &cname, const std::string &desc) : CommandCSSetMisc(cname, desc, "chanserv/saset/" + cname)
- {
- }
-
- void OnSyntaxError(User *u, const ci::string &)
- {
- syntax_error(Config.s_ChanServ, u, "SASET", CHAN_SASET_SYNTAX);
- }
-};
-
-class CSSetMisc : public Module
-{
- struct CommandInfo
- {
- std::string Name;
- std::string Desc;
- bool ShowHidden;
-
- CommandInfo(const std::string &name, const std::string &desc, bool showhidden) : Name(name), Des