summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-12 20:56:23 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-12 20:56:23 +0000
commit5bcb780c6d486b603856016dc566b3a403548545 (patch)
treec49d832047c23d2ae12b83cf4d53554c3e0fe0fe /src
parentc79d189e89884d983c374704eadf822620095deb (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/core/ns_register.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/src/core/ns_register.c b/src/core/ns_register.c
index ddaa2516e..359ca3912 100644
--- a/src/core/ns_register.c
+++ b/src/core/ns_register.c
@@ -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
+ {
+ 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);
- delnickrequest(nr); /* remove the nick request */
+ 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))