struct userNode *settee;
struct handle_info *hi;
- NICKSERV_MIN_PARMS(4);
+ NICKSERV_MIN_PARMS(nickserv_conf.email_required ? 5 : 4);
if (!is_valid_handle(argv[1])) {
reply("NSMSG_BAD_HANDLE", argv[1]);
return 0;
}
+ if (nickserv_conf.email_required) {
+ if (!is_valid_email_addr(argv[4])) {
+ reply("NSMSG_BAD_EMAIL_ADDR");
+ return 0;
+ }
+ }
+
if (strchr(argv[3], '@')) {
mask = canonicalize_hostmask(strdup(argv[3]));
if (argc > 4) {
- settee = GetUserH(argv[4]);
+ settee = GetUserH(nickserv_conf.email_required ? argv[5] : argv[4]);
if (!settee) {
- reply("MSG_NICK_UNKNOWN", argv[4]);
+ reply("MSG_NICK_UNKNOWN", nickserv_conf.email_required ? argv[5] : argv[4]);
free(mask);
return 0;
}
return 0;
}
if (!(hi = nickserv_register(user, settee, argv[1], argv[2], 0))) {
+ if (nickserv_conf.email_required) {
+ nickserv_set_email_addr(hi, argv[4]);
+ if (nickserv_conf.sync_log)
+ SyncLog("REGISTER %s %s %s %s", hi->handle, hi->passwd, argv[4], user->info);
+ }
free(mask);
return 0;
}
* This should only happen if an OREGISTER was sent. Require
* email must be enabled! - SiRVulcaN
*/
- SyncLog("REGISTER %s %s %s %s", hi->handle, hi->passwd, hi->cookie->data, user->info);
+ if (nickserv_conf.sync_log)
+ SyncLog("REGISTER %s %s %s %s", hi->handle, hi->passwd, hi->cookie->data, user->info);
}
nickserv_set_email_addr(hi, hi->cookie->data);
reply("NSMSG_EMAIL_CHANGED");
"You may use *Account instead of Nick as the name argument; the * makes $N use the name of an account directly (useful if the user is not online).",
"$uSee Also:$u oaddmask");
"OREGISTER" {
- "/services/nickserv/disable_nicks" (
- "/msg $N@$s OREGISTER <account> <password> <user@host|nick>",
- "Registers an account with $b$N$b using the specified account, password, and user@host. If the nick of an online user is specified, then that user's user@host is used. If no nickname or hostmask is used, it uses a default hostmask the first time the user authenticates.",
- "$uSee Also:$u ounregister"
- );
- "!/services/nickserv/disable_nicks" (
- "/msg $N@$s OREGISTER <account> <password> <user@host|nick>",
- "Registers an account with $b$N$b using the specified account, password, and user@host. If the nick of an online user is specified, then that user's user@host is used. If no nickname or hostmask is used, it uses a default hostmask the first time the user authenticates.",
- "$uSee Also:$u oregnick, ounregister, ounregnick"
- );
+ "/services/nickserv/disable_nicks" {
+ "/services/nickserv/email_enabled" (
+ "/msg $N@$s OREGISTER <account> <password> <email> <user@host|nick>",
+ "Registers an account with $b$N$b using the specified account, password, email address and user@host. If the nick of an online user is specified, then that user's user@host is used. If no nickname or hostmask is used, it uses a default hostmask the first time the user authenticates.",
+ "$uSee Also:$u ounregister"
+ );
+ "!/services/nickserv/email_enabled" (
+ "/msg $N@$s OREGISTER <account> <password> <user@host|nick>",
+ "Registers an account with $b$N$b using the specified account, password and user@host. If the nick of an online user is specified, then that user's user@host is used. If no nickname or hostmask is used, it uses a default hostmask the first time the user authenticates.",
+ "$uSee Also:$u ounregister"
+ );
+ };
+ "!/services/nickserv/disable_nicks" {
+ "/services/nickserv/email_enabled" (
+ "/msg $N@$s OREGISTER <account> <password> <email> <user@host|nick>",
+ "Registers an account with $b$N$b using the specified account, password, email address and user@host. If the nick of an online user is specified, then that user's user@host is used. If no nickname or hostmask is used, it uses a default hostmask the first time the user authenticates.",
+ "$uSee Also:$u oregnick, ounregister, ounregnick"
+ );
+ "!/services/nickserv/email_enabled" (
+ "/msg $N@$s OREGISTER <account> <password> <user@host|nick>",
+ "Registers an account with $b$N$b using the specified account, password and user@host. If the nick of an online user is specified, then that user's user@host is used. If no nickname or hostmask is used, it uses a default hostmask the first time the user authenticates.",
+ "$uSee Also:$u oregnick, ounregister, ounregnick"
+ );
+ };
};
"OSET" (
"/msg $N OSET <nick|*account> [<setting> <value>]",