1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 03:33:12 +02:00

Allow identifying to other accounts using /nickserv id account pass

This commit is contained in:
Adam
2010-09-11 22:47:36 -04:00
parent 89c5b203c3
commit e30370af10
22 changed files with 28 additions and 42 deletions
+1
View File
@@ -118,6 +118,7 @@ class CommandNSGroup : public Command
u->Login(na->nc);
FOREACH_MOD(I_OnNickGroup, OnNickGroup(u, target));
ircdproto->SetAutoIdentificationToken(u);
u->SetMode(NickServ, UMODE_REGISTERED);
Log(LOG_COMMAND, u, this) << "makes " << u->nick << " join group of " << target->nick << " (" << target->nc->display << ") (email: " << (!target->nc->email.empty() ? target->nc->email : "none") << ")";
notice_lang(Config->s_NickServ, u, NICK_GROUP_JOINED, target->nick.c_str());
+11 -8
View File
@@ -16,21 +16,21 @@
class CommandNSIdentify : public Command
{
public:
CommandNSIdentify(const Anope::string &cname) : Command(cname, 1, 1)
CommandNSIdentify(const Anope::string &cname) : Command(cname, 1, 2)
{
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
CommandReturn Execute(User *u, const std::vector<Anope::string> &params)
{
Anope::string pass = params[0];
NickAlias *na;
NickRequest *nr;
int res;
Anope::string nick = params.size() == 2 ? params[0] : u->nick;
Anope::string pass = params[params.size() - 1];
if (!(na = findnick(u->nick)))
NickAlias *na = findnick(nick), *this_na = findnick(u->nick);
if (!na)
{
if ((nr = findrequestnick(u->nick)))
NickRequest *nr = findrequestnick(nick);
if (nr)
notice_lang(Config->s_NickServ, u, NICK_IS_PREREG);
else
notice_lang(Config->s_NickServ, u, NICK_NOT_REGISTERED);
@@ -47,7 +47,7 @@ class CommandNSIdentify : public Command
notice_lang(Config->s_NickServ, u, NICK_ALREADY_IDENTIFIED);
else
{
res = enc_check_password(pass, na->nc->pass);
int res = enc_check_password(pass, na->nc->pass);
if (!res)
{
Log(LOG_COMMAND, u, this) << "and failed to identify";
@@ -69,6 +69,9 @@ class CommandNSIdentify : public Command
ircdproto->SendAccountLogin(u, u->Account());
ircdproto->SetAutoIdentificationToken(u);
if (this_na && this_na->nc == na->nc)
u->SetMode(NickServ, UMODE_REGISTERED);
u->UpdateHost();
FOREACH_MOD(I_OnNickIdentify, OnNickIdentify(u));
+1
View File
@@ -110,6 +110,7 @@ class NSResetPass : public Module
u->Login(na->nc);
ircdproto->SendAccountLogin(u, u->Account());
ircdproto->SetAutoIdentificationToken(u);
u->SetMode(NickServ, UMODE_REGISTERED);
FOREACH_MOD(I_OnNickIdentify, OnNickIdentify(u));
Log(LOG_COMMAND, u, &commandnsresetpass) << "confirmed RESETPASS to forcefully identify to " << na->nick;