summaryrefslogtreecommitdiff
path: root/modules/core/ns_getpass.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-08-17 19:27:37 -0400
committerAdam <Adam@anope.org>2010-08-17 19:27:37 -0400
commite65d8b2f3dfdb40858259b3bb48ef6998c31e62f (patch)
treefd845bdef5664d025ab19c262ae2c5e9d23d7bb2 /modules/core/ns_getpass.cpp
parent2575008baa5c9d0ca789680da1a3b81dc74786f7 (diff)
Rewrote the config reader to better handle invalid configs.
This prevents Anope from exploding when /os reload has errors.
Diffstat (limited to 'modules/core/ns_getpass.cpp')
-rw-r--r--modules/core/ns_getpass.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/modules/core/ns_getpass.cpp b/modules/core/ns_getpass.cpp
index e1e16d96b..e4f196d23 100644
--- a/modules/core/ns_getpass.cpp
+++ b/modules/core/ns_getpass.cpp
@@ -31,47 +31,47 @@ class CommandNSGetPass : public Command
{
if ((nr = findrequestnick(nick)))
{
- Alog() << Config.s_NickServ << ": " << u->GetMask() << " used GETPASS on " << nick;
- if (Config.WallGetpass)
+ Alog() << Config->s_NickServ << ": " << u->GetMask() << " used GETPASS on " << nick;
+ if (Config->WallGetpass)
ircdproto->SendGlobops(NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick.c_str(), nick.c_str());
- notice_lang(Config.s_NickServ, u, NICK_GETPASS_PASSCODE_IS, nick.c_str(), nr->passcode.c_str());
+ notice_lang(Config->s_NickServ, u, NICK_GETPASS_PASSCODE_IS, nick.c_str(), nr->passcode.c_str());
}
else
- notice_lang(Config.s_NickServ, u, NICK_X_NOT_REGISTERED, nick.c_str());
+ notice_lang(Config->s_NickServ, u, NICK_X_NOT_REGISTERED, nick.c_str());
}
else if (na->HasFlag(NS_FORBIDDEN))
- notice_lang(Config.s_NickServ, u, NICK_X_FORBIDDEN, na->nick.c_str());
- else if (Config.NSSecureAdmins && na->nc->IsServicesOper())
- notice_lang(Config.s_NickServ, u, ACCESS_DENIED);
+ notice_lang(Config->s_NickServ, u, NICK_X_FORBIDDEN, na->nick.c_str());
+ else if (Config->NSSecureAdmins && na->nc->IsServicesOper())
+ notice_lang(Config->s_NickServ, u, ACCESS_DENIED);
else
{
if (enc_decrypt(na->nc->pass, tmp_pass) == 1)
{
- Alog() << Config.s_NickServ << ": " << u->GetMask() << " used GETPASS on " << nick;
- if (Config.WallGetpass)
+ Alog() << Config->s_NickServ << ": " << u->GetMask() << " used GETPASS on " << nick;
+ if (Config->WallGetpass)
ircdproto->SendGlobops(NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick.c_str(), nick.c_str());
- notice_lang(Config.s_NickServ, u, NICK_GETPASS_PASSWORD_IS, nick.c_str(), tmp_pass.c_str());
+ notice_lang(Config->s_NickServ, u, NICK_GETPASS_PASSWORD_IS, nick.c_str(), tmp_pass.c_str());
}
else
- notice_lang(Config.s_NickServ, u, NICK_GETPASS_UNAVAILABLE);
+ notice_lang(Config->s_NickServ, u, NICK_GETPASS_UNAVAILABLE);
}
return MOD_CONT;
}
bool OnHelp(User *u, const Anope::string &subcommand)
{
- notice_help(Config.s_NickServ, u, NICK_SERVADMIN_HELP_GETPASS);
+ notice_help(Config->s_NickServ, u, NICK_SERVADMIN_HELP_GETPASS);
return true;
}
void OnSyntaxError(User *u, const Anope::string &subcommand)
{
- syntax_error(Config.s_NickServ, u, "GETPASS", NICK_GETPASS_SYNTAX);
+ syntax_error(Config->s_NickServ, u, "GETPASS", NICK_GETPASS_SYNTAX);
}
void OnServHelp(User *u)
{
- notice_lang(Config.s_NickServ, u, NICK_HELP_CMD_GETPASS);
+ notice_lang(Config->s_NickServ, u, NICK_HELP_CMD_GETPASS);
}
};