diff options
author | Adam <Adam@anope.org> | 2010-09-11 22:47:36 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-09-11 22:47:36 -0400 |
commit | e30370af107e4ae46c5287c7cfa01b679bcc25b3 (patch) | |
tree | 6953bbe0110abd2cfe1baa0158fda5d74d477a57 | |
parent | 89c5b203c331ab7c2986c93fd77fcc39c04d1d07 (diff) |
Allow identifying to other accounts using /nickserv id account pass
-rw-r--r-- | lang/cat.l | 2 | ||||
-rw-r--r-- | lang/de.l | 2 | ||||
-rw-r--r-- | lang/en_us.l | 4 | ||||
-rw-r--r-- | lang/es.l | 2 | ||||
-rw-r--r-- | lang/fr.l | 2 | ||||
-rw-r--r-- | lang/gr.l | 2 | ||||
-rw-r--r-- | lang/hun.l | 2 | ||||
-rw-r--r-- | lang/it.l | 2 | ||||
-rw-r--r-- | lang/nl.l | 2 | ||||
-rw-r--r-- | lang/pl.l | 2 | ||||
-rw-r--r-- | lang/pt.l | 2 | ||||
-rw-r--r-- | lang/ru.l | 2 | ||||
-rw-r--r-- | lang/tr.l | 2 | ||||
-rw-r--r-- | modules/core/ns_group.cpp | 1 | ||||
-rw-r--r-- | modules/core/ns_identify.cpp | 19 | ||||
-rw-r--r-- | modules/core/ns_resetpass.cpp | 1 | ||||
-rw-r--r-- | modules/protocol/bahamut.cpp | 1 | ||||
-rw-r--r-- | modules/protocol/inspircd11.cpp | 2 | ||||
-rw-r--r-- | modules/protocol/inspircd12.cpp | 8 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 8 | ||||
-rw-r--r-- | modules/protocol/unreal32.cpp | 1 | ||||
-rw-r--r-- | src/users.cpp | 1 |
22 files changed, 28 insertions, 42 deletions
diff --git a/lang/cat.l b/lang/cat.l index 9a98ad922..e02f91061 100644 --- a/lang/cat.l +++ b/lang/cat.l @@ -3455,7 +3455,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Sintaxis: IDENTIFY clau + Sintaxis: IDENTIFY [account] clau Informa a %S que tu ets realment el propietari del teu nick. Moltes comandes requereixen que t'identifiquis amb aquesta @@ -3536,7 +3536,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Syntax: IDENTIFY Passwort + Syntax: IDENTIFY [account] Passwort Beweist %S, dass du wirklich der Besitzer dieses Nicknamens bist. Viele Befehle erzwingen, dass diff --git a/lang/en_us.l b/lang/en_us.l index 8dcdb47a8..352d3cec2 100644 --- a/lang/en_us.l +++ b/lang/en_us.l @@ -373,7 +373,7 @@ NICK_UNGROUP_SUCCESSFUL # IDENTIFY responses NICK_IDENTIFY_SYNTAX - IDENTIFY password + IDENTIFY [account] password NICK_IDENTIFY_FAILED Sorry, identification failed. NICK_IDENTIFY_SUCCEEDED @@ -3430,7 +3430,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Syntax: IDENTIFY password + Syntax: IDENTIFY [account] password Tells %S that you are really the owner of this nick. Many commands require you to authenticate yourself @@ -3537,7 +3537,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Sintaxis: IDENTIFY clave + Sintaxis: IDENTIFY [account] clave Informa a %S que tu eres realmente el dueño de tu nick. Muchos comandos requieren que te autentifiques con este @@ -3580,7 +3580,7 @@ NICK_HELP_GROUP Note: tous les pseudos du groupe ont le même mot de passe. NICK_HELP_IDENTIFY - Syntaxe: IDENTIFY motdepasse + Syntaxe: IDENTIFY [account] motdepasse Informe %S que vous êtes vraiment le propriétaire de ce pseudo. Beaucoup de commandes nécessitent que vous soyez @@ -3563,7 +3563,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Óýíôáîç: IDENTIFY êùäéêü + Óýíôáîç: IDENTIFY [account] êùäéêü ËÝåé óôïí %S áí åßóáé üíôïò ï êÜôï÷ïò áõôïý ôïõ øåõäþíõìïõ. ÐïëëÝò åíôïëÝò áðáéôïýí íá êÜíåéò åíôïëÞ áíáãíþñéóçò, äçë ìå ôçí åíôïëÞ diff --git a/lang/hun.l b/lang/hun.l index a2e4ba2eb..bf9dd3e30 100644 --- a/lang/hun.l +++ b/lang/hun.l @@ -3482,7 +3482,7 @@ NICK_HELP_GROUP a jelszava. NICK_HELP_IDENTIFY - Syntax: IDENTIFY jelszó + Syntax: IDENTIFY [account] jelszó Tudatja a %S-vel, hogy te vagy a tulajdonosa ennek a nicknek. Jelszónak ugyanannak kell lennie amit a @@ -3444,7 +3444,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Sintassi: IDENTIFY password + Sintassi: IDENTIFY [account] password Indica a %S che sei davvero il proprietario del nick. Molti comandi richiedono che tu ti sia autentificato @@ -3519,7 +3519,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Gebruik: IDENTIFY wachtwoord + Gebruik: IDENTIFY [account] wachtwoord Vertelt %S dat je echt de eigenaar van deze nick bent. Veel commandos vereisen dat je jezelf identificeert met dit commando @@ -4499,7 +4499,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Sk³adnia: IDENTIFY has³o + Sk³adnia: IDENTIFY [account] has³o Informuje %S, ¿e nick którego w³a¶nie u¿ywasz nale¿y do Ciebie. Wiele komend wymaga identyfikacji @@ -3464,7 +3464,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Sintaxe: IDENTIFY senha + Sintaxe: IDENTIFY [account] senha Identifica você ao %S como sendo dono do nick. Muitos comandos exigem que você se identifique com este @@ -3459,7 +3459,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Ñèíòàêñèñ: IDENTIFY ïàðîëü + Ñèíòàêñèñ: IDENTIFY [account] ïàðîëü Ïîçâîëÿåò âàì èäåíòèôèöèðîâàòüñÿ íà %S ê çàðåãèñòðèðîâàííîìó ðàíåå íèêó. Áîëüøèíñòâî ñåðâèñíûõ êîìàíä, òàêèå êàê SET, OP, BAN @@ -3560,7 +3560,7 @@ NICK_HELP_UNGROUP nick in your group. NICK_HELP_IDENTIFY - Kullanýmý: IDENTIFY þifreniz + Kullanýmý: IDENTIFY [account] þifreniz %S 'e kullandýðýnýz nickin gerçek sahibinin siz olduðunu belirtir. Çoðu komut kullanýlmadan önce bu komutla diff --git a/modules/core/ns_group.cpp b/modules/core/ns_group.cpp index 6bb187908..7c0802e37 100644 --- a/modules/core/ns_group.cpp +++ b/modules/core/ns_group.cpp @@ -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()); diff --git a/modules/core/ns_identify.cpp b/modules/core/ns_identify.cpp index e87d13d22..943847355 100644 --- a/modules/core/ns_identify.cpp +++ b/modules/core/ns_identify.cpp @@ -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)); diff --git a/modules/core/ns_resetpass.cpp b/modules/core/ns_resetpass.cpp index a0efa373c..63c58d5ed 100644 --- a/modules/core/ns_resetpass.cpp +++ b/modules/core/ns_resetpass.cpp @@ -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; diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index 8e54de704..65924c97f 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -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); } diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index 4b92a694c..557fe7389 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -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; diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index ffc696d94..9532e7669 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -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) diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 51784d071..47413da23 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -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) diff --git a/modules/protocol/unreal32.cpp b/modules/protocol/unreal32.cpp index 249da63b5..0b5b56b08 100644 --- a/modules/protocol/unreal32.cpp +++ b/modules/protocol/unreal32.cpp @@ -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); } diff --git a/src/users.cpp b/src/users.cpp index e5fe7ee04..362ad1717 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -753,6 +753,7 @@ User *do_nick(const Anope::string &source, const Anope::string &nick, const Anop user->UpdateHost(); do_on_id(user); ircdproto->SetAutoIdentificationToken(user); + user->SetMode(NickServ, UMODE_REGISTERED); Log() << Config->s_NickServ << ": " << user->GetMask() << " automatically identified for group " << user->Account()->display; } |