1 diff -urN services-dist/src/hash.h services/src/hash.h
2 --- services-dist/src/hash.h Fri Oct 24 20:05:25 2003
3 +++ services/src/hash.h Fri Oct 24 21:35:44 2003
5 #define FLAGS_STAMPED 0x1000 /* for users who have been stamped */
6 #define FLAGS_HIDDEN_HOST 0x2000 /* user's host is masked by their account */
7 #define FLAGS_REGNICK 0x4000 /* user owns their current nick */
8 +#define FLAGS_TRIED2REG 0x8000 /* user has used /msg NickServ@.. register already once this session */
10 #define IsOper(x) ((x)->modes & FLAGS_OPER)
11 #define IsService(x) ((x)->modes & FLAGS_SERVICE)
13 #define IsStamped(x) ((x)->modes & FLAGS_STAMPED)
14 #define IsHiddenHost(x) ((x)->modes & FLAGS_HIDDEN_HOST)
15 #define IsReggedNick(x) ((x)->modes & FLAGS_REGNICK)
16 +#define HasTried2Reg(x) ((x)->modes & FLAGS_TRIED2REG)
17 #define IsLocal(x) ((x)->uplink == self)
20 diff -urN services-dist/src/nickserv.c services/src/nickserv.c
21 --- services-dist/src/nickserv.c Fri Oct 24 20:05:25 2003
22 +++ services/src/nickserv.c Fri Oct 24 21:36:24 2003
24 #define NSMSG_BAD_MAX_LOGINS "MaxLogins must be at most %d."
25 #define NSMSG_MAX_LOGINS "Your account already has its limit of %d user(s) logged in."
26 #define NSMSG_SETTEE_LOGGED_IN "%s is already logged in, so you cannot do that."
27 +#define NSMSG_TRIED2REG "You have already attempted to use $bREGISTER$b once this session, you will have to reconnect to use it again."
29 #define NSMSG_STAMPED_REGISTER "You have already authenticated to an account once this session; you may not register a new account."
30 #define NSMSG_STAMPED_AUTH "You have already authenticated to an account once this session; you may not authenticate to another."
31 @@ -1063,6 +1064,14 @@
35 + if (HasTried2Reg(user)) {
36 + /* On networks with email enabled, it is possible to use this cmd repeatedly, making
37 + * potential damage to services very, very easy. This only allows a user to try once
38 + * per session -akl */
39 + nickserv_notice(user, NSMSG_TRIED2REG);
43 NICKSERV_MIN_PARMS((unsigned)3 + nickserv_conf.email_required);
45 if (!is_valid_handle(argv[1])) {
47 /* If they need to do email verification, tell them. */
49 nickserv_make_cookie(user, hi, ACTIVATION, hi->passwd);
51 + user->modes |= FLAGS_TRIED2REG;
55 diff -urN services-dist/src/opserv.c services/src/opserv.c
56 --- services-dist/src/opserv.c Fri Oct 24 20:05:25 2003
57 +++ services/src/opserv.c Fri Oct 24 21:33:03 2003
59 if (IsDeaf(target)) buffer[bpos++] = 'd';
60 if (IsHiddenHost(target)) buffer[bpos++] = 'x';
61 if (IsGagged(target)) buffer_cat(" (gagged)");
62 + if (HasTried2Reg(target)) buffer_cat(" (registered an account)");
64 if (bpos > 11) opserv_notice(user, buffer);