{ "NSMSG_MUST_TIME_OUT", "You must wait for cookies of that type to time out." },
{ "NSMSG_ATE_COOKIE", "I ate the cookie for your account. You may now have another." },
{ "NSMSG_USE_RENAME", "You are already authenticated to account $b%s$b -- contact the support staff to rename your account." },
+ { "NSMSG_ALREADY_REGISTERING", "You have already used $bREGISTER$b once this session; you may not use it again." },
{ "NSMSG_REGISTER_BAD_NICKMASK", "Could not recognize $b%s$b as either a current nick or a hostmask." },
{ "NSMSG_NICK_NOT_REGISTERED", "Nick $b%s$b has not been registered to any account." },
{ "NSMSG_HANDLE_NOT_FOUND", "Could not find your account -- did you register yet?" },
{ "NSMSG_SET_LEVEL", "$bLEVEL: $b%d" },
{ "NSMSG_SET_EPITHET", "$bEPITHET: $b%s" },
{ "NSEMAIL_ACTIVATION_SUBJECT", "Account verification for %s" },
- { "NSEMAIL_ACTIVATION_BODY", "This email has been sent to verify that this email address belongs to the person who tried to register an account on %1$s. Your cookie is:\n %2$s\nTo verify your email address and complete the account registration, log on to %1$s and type the following command:\n /msg %3$s@%4$s COOKIE %5$s %2$s\nIf you did NOT request this account, you do not need to do anything. Please contact the %1$s staff if you have questions." },
+ { "NSEMAIL_ACTIVATION_BODY", "This email has been sent to verify that this email address belongs to the person who tried to register an account on %1$s. Your cookie is:\n %2$s\nTo verify your email address and complete the account registration, log on to %1$s and type the following command:\n /msg %3$s@%4$s COOKIE %5$s %2$s\nThis command is only used once to complete your account registration, and never again. Once you have run this command, you will need to authenticate everytime you reconnect to the network. To do this, you will have to type this command every time you reconnect:\n /msg %3$s@%4$s AUTH %5$s your-password\n Please remember to fill in 'your-password' with the actual password you gave to us when you registered.\n\nIf you did NOT request this account, you do not need to do anything. Please contact the %1$s staff if you have questions, and be sure to check our website." },
{ "NSEMAIL_PASSWORD_CHANGE_SUBJECT", "Password change verification on %s" },
{ "NSEMAIL_PASSWORD_CHANGE_BODY", "This email has been sent to verify that you wish to change the password on your account %5$s. Your cookie is %2$s.\nTo complete the password change, log on to %1$s and type the following command:\n /msg %3$s@%4$s COOKIE %5$s %2$s\nIf you did NOT request your password to be changed, you do not need to do anything. Please contact the %1$s staff if you have questions." },
{ "NSEMAIL_EMAIL_CHANGE_SUBJECT", "Email address change verification for %s" },
{ "NSEMAIL_EMAIL_VERIFY_SUBJECT", "Email address verification for %s" },
{ "NSEMAIL_EMAIL_VERIFY_BODY", "This email has been sent to verify that this address belongs to the same person as %5$s on %1$s. Your cookie is %2$s.\nTo verify your address as associated with this account, log on to %1$s and type the following command:\n /msg %3$s@%4$s COOKIE %5$s %2$s\nIf you did NOT request this email address to be associated with this account, you do not need to do anything. Please contact the %1$s staff if you have questions." },
{ "NSEMAIL_ALLOWAUTH_SUBJECT", "Authentication allowed for %s" },
- { "NSEMAIL_ALLOWAUTH_BODY", "This email has been sent to let you authenticate (auth) to account %5$s on %1$s. Your cookie is %2$s.\nTo auth to that account, log on to %1$s and type the following command:\n /msg %3$s@%4$s COOKIE %5$s %1$s\nIf you did NOT request this authorization, you do not need to do anything. Please contact the %1$s staff if you have questions." },
+ { "NSEMAIL_ALLOWAUTH_BODY", "This email has been sent to let you authenticate (auth) to account %5$s on %1$s. Your cookie is %2$s.\nTo auth to that account, log on to %1$s and type the following command:\n /msg %3$s@%4$s COOKIE %5$s %2$s\nIf you did NOT request this authorization, you do not need to do anything. Please contact the %1$s staff if you have questions." },
{ "CHECKPASS_YES", "Yes." },
{ "CHECKPASS_NO", "No." },
{ NULL, NULL }
return 0;
}
if (IsLocal(target)) {
- send_message(user, service, "NSMSG_USER_IS_SERVICE", target->nick);
+ if (IsService(target))
+ send_message(user, service, "NSMSG_USER_IS_SERVICE", target->nick);
+ else
+ send_message(user, service, "MSG_USER_AUTHENTICATE", target->nick);
return 0;
}
if (!(hi = target->handle_info)) {
return 0;
}
+ if (IsRegistering(user)) {
+ reply("NSMSG_ALREADY_REGISTERING");
+ return 0;
+ }
+
if (IsStamped(user)) {
/* Unauthenticated users might still have been stamped
previously and could therefore have a hidden host;
if (no_auth)
nickserv_make_cookie(user, hi, ACTIVATION, hi->passwd);
+ /* Set registering flag.. */
+ user->modes |= FLAGS_REGISTERING;
+
return 1;
}
static OPTION_FUNC(opt_width)
{
- if (argc > 1) {
- unsigned int new_width = strtoul(argv[1], NULL, 0);
- hi->screen_width = new_width;
- }
+ if (argc > 1)
+ hi->screen_width = strtoul(argv[1], NULL, 0);
if ((hi->screen_width > 0) && (hi->screen_width < MIN_LINE_SIZE))
hi->screen_width = MIN_LINE_SIZE;
static OPTION_FUNC(opt_tablewidth)
{
- if (argc > 1) {
- unsigned int new_width = strtoul(argv[1], NULL, 0);
- hi->table_width = new_width;
- }
+ if (argc > 1)
+ hi->table_width = strtoul(argv[1], NULL, 0);
if ((hi->table_width > 0) && (hi->table_width < MIN_LINE_SIZE))
hi->table_width = MIN_LINE_SIZE;
static OPTION_FUNC(opt_maxlogins)
{
- char maxlogins;
+ unsigned char maxlogins;
if (argc > 1) {
maxlogins = strtoul(argv[1], NULL, 0);
if ((maxlogins > nickserv_conf.hard_maxlogins) && !override) {
for (cList2=hi_to->channels; cList2; cList2=cList2->u_next)
if (cList->channel == cList2->channel)
break;
- log_module(NS_LOG, LOG_DEBUG, "Merging %s->%s@%s: before %p->%p->%-p, %p->%p->%p",
- hi_from->handle, hi_to->handle, cList->channel->channel->name,
- cList->u_prev, cList, cList->u_next,
- (cList2?cList2->u_prev:0), cList2, (cList2?cList2->u_next:0));
if (cList2 && (cList2->access >= cList->access)) {
+ log_module(NS_LOG, LOG_INFO, "Merge: %s had only %d access in %s (versus %d for %s)", hi_from->handle, cList->access, cList->channel->channel->name, cList2->access, hi_to->handle);
/* keep cList2 in hi_to; remove cList from hi_from */
- log_module(NS_LOG, LOG_DEBUG, "Deleting %p", cList);
del_channel_user(cList, 1);
} else {
if (cList2) {
+ log_module(NS_LOG, LOG_INFO, "Merge: %s had only %d access in %s (versus %d for %s)", hi_to->handle, cList2->access, cList->channel->channel->name, cList->access, hi_from->handle);
/* remove the lower-ranking cList2 from hi_to */
- log_module(NS_LOG, LOG_DEBUG, "Deleting %p", cList2);
del_channel_user(cList2, 1);
+ } else {
+ log_module(NS_LOG, LOG_INFO, "Merge: %s had no access in %s", hi_to->handle, cList->channel->channel->name);
}
/* cList needs to be moved from hi_from to hi_to */
cList->handle = hi_to;
if (hi_to->channels)
hi_to->channels->u_prev = cList;
hi_to->channels = cList;
- log_module(NS_LOG, LOG_DEBUG, "Now %p->%p->%p",
- cList->u_prev, cList, cList->u_next);
}
}
goto fail;
}
if (!irccasecmp(argv[i], "limit")) {
- discrim->limit = atoi(argv[++i]);
+ discrim->limit = strtoul(argv[++i], NULL, 0);
} else if (!irccasecmp(argv[i], "flags")) {
nickserv_modify_handle_flags(user, nickserv, argv[++i], &discrim->flags_on, &discrim->flags_off);
} else if (!irccasecmp(argv[i], "registered")) {
static void
nickserv_reclaim(struct userNode *user, struct nick_info *ni, enum reclaim_action action) {
+ const char *msg;
char newnick[NICKLEN+1];
assert(user);
irc_svsnick(nickserv, user, newnick);
break;
case RECLAIM_KILL:
- irc_kill(nickserv, user, "NSMSG_RECLAIM_KILL");
+ msg = user_find_message(user, "NSMSG_RECLAIM_KILL");
+ irc_kill(nickserv, user, msg);
break;
}
}
userList_init(&curr_helpers);
if (nick) {
- nickserv = AddService(nick, "Nick Services");
- nickserv_service = service_register(nickserv, 0);
+ nickserv = AddService(nick, "Nick Services", NULL);
+ nickserv_service = service_register(nickserv);
}
saxdb_register("NickServ", nickserv_saxdb_read, nickserv_saxdb_write);
reg_exit_func(nickserv_db_cleanup);