diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-05-14 16:51:28 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-05-14 16:51:28 +0000 |
commit | 116a4b2bea556911239f735c467c7b6f1415c0a7 (patch) | |
tree | cb36b9ac34057fa86a795d9a5732e740419b0ea5 /src | |
parent | 29619eb2064349091eea29993aea3b9feee9139b (diff) |
Removed ns_noop_convert. The ns_noop module is for stable and almost 4 years old
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2959 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/ns_noop_convert.c | 154 |
1 files changed, 0 insertions, 154 deletions
diff --git a/src/modules/ns_noop_convert.c b/src/modules/ns_noop_convert.c deleted file mode 100644 index 8cc5d69e6..000000000 --- a/src/modules/ns_noop_convert.c +++ /dev/null @@ -1,154 +0,0 @@ -/* ns_noop.c - Allows users to optionaly set autoop to off - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Based on the original module by Rob <rob@anope.org> - * Included in the Anope module pack since Anope 1.7.9 - * Anope Coder: DrStein <drstein@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 "Rob" -#define VERSION "$Id$" - -/* The name of the default database to save info to */ -#define DEFAULT_DB_NAME "autoop.db" - -/* Multi-language stuff */ -#define LANG_NUM_STRINGS 8 - -#define AUTOOP_SYNTAX 0 -#define AUTOOP_STATUS_ON 1 -#define AUTOOP_STATUS_OFF 2 -#define AUTOOP_NO_NICK 3 -#define AUTOOP_ON 4 -#define AUTOOP_OFF 5 -#define AUTOOP_DESC 6 -#define AUTOOP_HELP 7 - -/*************************************************************************/ - -User *currentUser; -int m_isIRCop = 0; - -char *NSAutoOPDBName; - -int noop(User * u); -int mEventJoin(int argc, char **argv); -int setAutoOp(User * u); -int UnsetAutoOp(User * u); - -int mLoadData(); -int mSaveData(int argc, char **argv); -int mLoadConfig(int argc, char **argv); - -void m_AddLanguages(); - -/*************************************************************************/ - -class NSNOOPConvert : public Module -{ - public: - NSNOOPConvert(const std::string &modname, const std::string &creator) : Module(modname, creator) - { - NSAutoOPDBName = NULL; - - this->SetAuthor(AUTHOR); - this->SetVersion(VERSION); - this->SetType(SUPPORTED); - - if (mLoadConfig(0, NULL)) - throw ModuleException("Couldn't load config?"); - - mLoadData(); - - Alog() << "ns_noop_convert: Your auto-op database has been converted and this module will now"; - Alog() << "ns_noop_convert: unload itself. You can now remove this module from your config"; - } - - ~NSNOOPConvert() - { - if (NSAutoOPDBName) - delete [] NSAutoOPDBName; - } -}; - -/*************************************************************************/ - -/** - * Load data from the db file, and populate the autoop setting - * @return 0 for success - **/ -int mLoadData() -{ - int ret = 0; - int len = 0; - - char *name = NULL; - - NickAlias *na = NULL; - FILE *in; - - /* will _never_ be this big thanks to the 512 limit of a message */ - char buffer[2000]; - if ((in = fopen(NSAutoOPDBName, "r")) == NULL) { - Alog() << "ns_noop: WARNING: Can not open database file! (it might not exist, this is not fatal)"; - ret = 1; - } else { - while (fgets(buffer, 1500, in)) { - name = myStrGetToken(buffer, ' ', 0); - if (name) { - len = strlen(name); - /* Take the \n from the end of the line */ - name[len - 1] = '\0'; - if ((na = findnick(name))) { - na->nc->SetFlag(NI_AUTOOP); - } - delete [] name; - } - } - } - return ret; -} - -/*************************************************************************/ - -/** - * Load the configuration directives from Services configuration file. - * @return 0 for success - **/ -int mLoadConfig(int argc, char **argv) -{ - ConfigReader config; - std::string tmp = config.ReadValue("ns_noop_convert", "database", DEFAULT_DB_NAME, 0); - - if (NSAutoOPDBName) - delete [] NSAutoOPDBName; - - NSAutoOPDBName = sstrdup(tmp.c_str()); - - if (tmp.empty()) { - Alog() << "ns_noop: FATAL: Can't read required configuration directives!"; - return MOD_STOP; - } else { - Alog() << "ns_noop: Directive NSAutoOPDBName loaded (" << NSAutoOPDBName << ")..."; - } - - return MOD_CONT; -} - -/*************************************************************************/ - -/* EOF */ - -MODULE_INIT(NSNOOPConvert) |