1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 09:46:40 +02:00

Changed /ns confirm to not assume the user you are confirming owns the nick (have it ask the user for the password now), added nickserv/confirm opertype command value, and changed OnNickRegister event param to be NickAlias* not User*

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2554 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Adam-
2009-10-12 20:56:23 +00:00
parent c79d189e89
commit 5bcb780c6d
3 changed files with 21 additions and 29 deletions
+1
View File
@@ -525,6 +525,7 @@ options
* memoserv/sendall memoserv/staff
*
* nickserv/getpass nickserv/sendpass nickserv/getemail nickserv/suspend
* nickserv/confirm
*
* operserv/global operserv/news operserv/stats operserv/kick
* operserv/mode operserv/session operserv/modlist operserv/ignore
+2 -2
View File
@@ -833,9 +833,9 @@ class CoreExport Module
virtual void OnNickLogout(User *u) { }
/** Called when a nick is registered
* @param The user
* @param The nick
*/
virtual void OnNickRegister(User *u) { }
virtual void OnNickRegister(NickAlias *na) { }
/** Called when a nick is suspended
* @param na The nick alias
+18 -27
View File
@@ -71,21 +71,30 @@ class CommandNSConfirm : public Command
notice_lang(s_NickServ, u, NICK_REGISTERED, u->nick, na->nc->GetAccess(0).c_str());
else
notice_lang(s_NickServ, u, NICK_REGISTERED_NO_MASK, u->nick);
delnickrequest(nr);
ircdproto->SendAccountLogin(u, u->nc);
ircdproto->SetAutoIdentificationToken(u);
FOREACH_MOD(I_OnNickRegister, OnNickRegister(u));
if (enc_decrypt(na->nc->pass, tmp_pass, PASSMAX - 1) == 1)
notice_lang(s_NickServ, u, NICK_PASSWORD_IS, tmp_pass);
u->lastnickreg = time(NULL);
}
else
notice_lang(s_NickServ, u, NICK_FORCE_REG, nr->nick);
delnickrequest(nr); /* remove the nick request */
{
alog("%s: '%s' confirmed by %s!%s@%s (email: %s)", s_NickServ, nr->nick, u->nick, u->GetIdent().c_str(), u->host, nr->email ? nr->email : "none");
notice_lang(s_NickServ, u, NICK_FORCE_REG, nr->nick);
User *user = finduser(nr->nick);
/* Delrequest must be called before validate_user */
delnickrequest(nr);
if (user)
{
validate_user(user);
}
}
return MOD_CONT;
}
@@ -107,38 +116,20 @@ class CommandNSConfirm : public Command
if (!nr)
{
if (u->nc && u->nc->IsServicesOper())
if (u->nc && u->nc->HasCommand("nickserv/confirm"))
{
/* If an admin, their nick is obviously already regged, so look at the passcode to get the nick
of the user they are trying to validate, and push that user through regardless of passcode */
nr = findrequestnick(passcode);
if (nr)
{
User *utmp = finduser(passcode);
if (utmp)
{
ActuallyConfirmNick(utmp, nr, false);
notice_lang(s_NickServ, u, NICK_FORCE_REG, utmp->nick);
return MOD_CONT;
}
else
{
passcode = nr->passcode;
ActuallyConfirmNick(u, nr, true);
return MOD_CONT;
}
}
else
{
notice_lang(s_NickServ, u, NICK_CONFIRM_NOT_FOUND, s_NickServ);
ActuallyConfirmNick(u, nr, true);
return MOD_CONT;
}
}
else
{
notice_lang(s_NickServ, u, NICK_CONFIRM_NOT_FOUND, s_NickServ);
return MOD_CONT;
}
notice_lang(s_NickServ, u, NICK_CONFIRM_NOT_FOUND, s_NickServ);
return MOD_CONT;
}
if (stricmp(nr->passcode, passcode))