mirror of
https://github.com/anope/anope.git
synced 2026-07-02 08:06:37 +02:00
Allow identifying to other accounts using /nickserv id account pass
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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> ¶ms)
|
||||
{
|
||||
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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -291,7 +291,6 @@ class BahamutIRCdProto : public IRCDProto
|
||||
if (!u->Account())
|
||||
return;
|
||||
|
||||
u->SetMode(NickServ, UMODE_REGISTERED);
|
||||
ircdproto->SendMode(NickServ, u, "+d %d", u->timestamp);
|
||||
}
|
||||
|
||||
|
||||
@@ -296,8 +296,6 @@ class InspIRCdProto : public IRCDProto
|
||||
|
||||
u->Account()->Shrink("authenticationtoken");
|
||||
u->Account()->Extend("authenticationtoken", new ExtensibleItemRegular<Anope::string>(svidbuf));
|
||||
|
||||
u->SetMode(NickServ, UMODE_REGISTERED);
|
||||
}
|
||||
|
||||
} ircd_proto;
|
||||
|
||||
@@ -308,14 +308,6 @@ class InspIRCdProto : public IRCDProto
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetAutoIdentificationToken(User *u)
|
||||
{
|
||||
if (!u->Account())
|
||||
return;
|
||||
|
||||
u->SetMode(NickServ, UMODE_REGISTERED);
|
||||
}
|
||||
} ircd_proto;
|
||||
|
||||
int anope_event_ftopic(const Anope::string &source, int ac, const char **av)
|
||||
|
||||
@@ -306,14 +306,6 @@ class InspIRCdProto : public IRCDProto
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetAutoIdentificationToken(User *u)
|
||||
{
|
||||
if (!u->Account())
|
||||
return;
|
||||
|
||||
u->SetMode(NickServ, UMODE_REGISTERED);
|
||||
}
|
||||
} ircd_proto;
|
||||
|
||||
int anope_event_ftopic(const Anope::string &source, int ac, const char **av)
|
||||
|
||||
@@ -387,7 +387,6 @@ class UnrealIRCdProto : public IRCDProto
|
||||
if (!u->Account())
|
||||
return;
|
||||
|
||||
u->SetMode(NickServ, UMODE_REGISTERED);
|
||||
ircdproto->SendMode(NickServ, u, "+d %d", u->timestamp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user