Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "module.h"
00019
00020 class CommandNSGetEMail : public Command
00021 {
00022 public:
00023 CommandNSGetEMail(Module *creator) : Command(creator, "nickserv/getemail", 1, 1)
00024 {
00025 this->SetDesc(_("Matches and returns all users that registered using given email"));
00026 this->SetSyntax(_("\037email\037"));
00027 }
00028
00029 void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
00030 {
00031 const Anope::string &email = params[0];
00032 int j = 0;
00033
00034 Log(LOG_ADMIN, source, this) << "on " << email;
00035
00036 for (nickcore_map::const_iterator it = NickCoreList->begin(), it_end = NickCoreList->end(); it != it_end; ++it)
00037 {
00038 const NickCore *nc = it->second;
00039
00040 if (!nc->email.empty() && nc->email.equals_ci(email))
00041 {
00042 ++j;
00043 source.Reply(_("Email matched: \002%s\002 to \002%s\002."), nc->display.c_str(), email.c_str());
00044 }
00045 }
00046
00047 if (j <= 0)
00048 {
00049 source.Reply(_("No nick registrations matching \002%s\002 found."), email.c_str());
00050 return;
00051 }
00052
00053 return;
00054 }
00055
00056 bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
00057 {
00058 this->SendSyntax(source);
00059 source.Reply(" ");
00060 source.Reply(_("Returns the matching nicks that used given email. \002Note\002 that\n"
00061 "you can not use wildcards. Whenever this command is used, a message\n"
00062 "including the person who issued the command and the email it was used\n"
00063 "on will be logged."));
00064 return true;
00065 }
00066 };
00067
00068 class NSGetEMail : public Module
00069 {
00070 CommandNSGetEMail commandnsgetemail;
00071 public:
00072 NSGetEMail(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
00073 commandnsgetemail(this)
00074 {
00075 this->SetAuthor("Anope");
00076
00077 }
00078 };
00079
00080 MODULE_INIT(NSGetEMail)