From: adam Date: Fri, 14 May 2004 05:37:38 +0000 (+0000) Subject: rearrange chanserv-level ban/kick messages; change wording on authentication cookie... X-Git-Tag: v1.4.0-rc1~215 X-Git-Url: http://git.pk910.de/?p=srvx.git;a=commitdiff_plain;h=b291dd8594acb24d9f92c8ef9595543ca4aa5e8b rearrange chanserv-level ban/kick messages; change wording on authentication cookie email, implement old tried2reg patch * chanserv ban/kick messages are now displayed as "(name) message" as opposed to what they were, which was "message (name)"; this was done to remove irregularity with how it was in some parts of the code. * at semi-popular request, wording in initial registration emails has been changed to explain that COOKIE should not be used more than once * implemented old 'tried2reg' patch - you may only use /msg authserv register once per session (this was not the case before, which was apparent with email registrations) git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-61 --- diff --git a/ChangeLog b/ChangeLog index a188466..773002b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,29 @@ # arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3 # +2004-05-14 05:37:38 GMT adam patch-61 + + Summary: + rearrange chanserv-level ban/kick messages; change wording on authentication cookie email, implement old tried2reg patch + Revision: + srvx--devo--1.3--patch-61 + + * chanserv ban/kick messages are now displayed as "(name) message" as opposed to what they were, which was "message (name)"; this was done to remove irregularity with how it was in some parts of the code. + + * at semi-popular request, wording in initial registration emails has been changed to explain that COOKIE should not be used more than once + + * implemented old 'tried2reg' patch - you may only use /msg authserv register once per session (this was not the case before, which was apparent with email registrations) + + + removed files: + patches/.arch-ids/ns_tried2reg102403.diff.id + patches/ns_tried2reg102403.diff + + modified files: + ChangeLog src/chanserv.c src/hash.h src/nickserv.c + src/opserv.c + + 2004-05-09 03:05:48 GMT Michael Poole patch-60 Summary: diff --git a/patches/ns_tried2reg102403.diff b/patches/ns_tried2reg102403.diff deleted file mode 100644 index da2c7b9..0000000 --- a/patches/ns_tried2reg102403.diff +++ /dev/null @@ -1,65 +0,0 @@ -diff -urN services-dist/src/hash.h services/src/hash.h ---- services-dist/src/hash.h Fri Oct 24 20:05:25 2003 -+++ services/src/hash.h Fri Oct 24 21:35:44 2003 -@@ -56,6 +56,7 @@ - #define FLAGS_STAMPED 0x1000 /* for users who have been stamped */ - #define FLAGS_HIDDEN_HOST 0x2000 /* user's host is masked by their account */ - #define FLAGS_REGNICK 0x4000 /* user owns their current nick */ -+#define FLAGS_TRIED2REG 0x8000 /* user has used /msg NickServ@.. register already once this session */ - - #define IsOper(x) ((x)->modes & FLAGS_OPER) - #define IsService(x) ((x)->modes & FLAGS_SERVICE) -@@ -71,6 +72,7 @@ - #define IsStamped(x) ((x)->modes & FLAGS_STAMPED) - #define IsHiddenHost(x) ((x)->modes & FLAGS_HIDDEN_HOST) - #define IsReggedNick(x) ((x)->modes & FLAGS_REGNICK) -+#define HasTried2Reg(x) ((x)->modes & FLAGS_TRIED2REG) - #define IsLocal(x) ((x)->uplink == self) - - #define NICKLEN 30 -diff -urN services-dist/src/nickserv.c services/src/nickserv.c ---- services-dist/src/nickserv.c Fri Oct 24 20:05:25 2003 -+++ services/src/nickserv.c Fri Oct 24 21:36:24 2003 -@@ -141,6 +141,7 @@ - #define NSMSG_BAD_MAX_LOGINS "MaxLogins must be at most %d." - #define NSMSG_MAX_LOGINS "Your account already has its limit of %d user(s) logged in." - #define NSMSG_SETTEE_LOGGED_IN "%s is already logged in, so you cannot do that." -+#define NSMSG_TRIED2REG "You have already attempted to use $bREGISTER$b once this session, you will have to reconnect to use it again." - - #define NSMSG_STAMPED_REGISTER "You have already authenticated to an account once this session; you may not register a new account." - #define NSMSG_STAMPED_AUTH "You have already authenticated to an account once this session; you may not authenticate to another." -@@ -1063,6 +1064,14 @@ - return 0; - } - -+ if (HasTried2Reg(user)) { -+ /* On networks with email enabled, it is possible to use this cmd repeatedly, making -+ * potential damage to services very, very easy. This only allows a user to try once -+ * per session -akl */ -+ nickserv_notice(user, NSMSG_TRIED2REG); -+ return 0; -+ } -+ - NICKSERV_MIN_PARMS((unsigned)3 + nickserv_conf.email_required); - - if (!is_valid_handle(argv[1])) { -@@ -1136,6 +1145,8 @@ - /* If they need to do email verification, tell them. */ - if (no_auth) - nickserv_make_cookie(user, hi, ACTIVATION, hi->passwd); -+ -+ user->modes |= FLAGS_TRIED2REG; - - return 1; - } -diff -urN services-dist/src/opserv.c services/src/opserv.c ---- services-dist/src/opserv.c Fri Oct 24 20:05:25 2003 -+++ services/src/opserv.c Fri Oct 24 21:33:03 2003 -@@ -1195,6 +1195,7 @@ - if (IsDeaf(target)) buffer[bpos++] = 'd'; - if (IsHiddenHost(target)) buffer[bpos++] = 'x'; - if (IsGagged(target)) buffer_cat(" (gagged)"); -+ if (HasTried2Reg(target)) buffer_cat(" (registered an account)"); - buffer[bpos] = 0; - if (bpos > 11) opserv_notice(user, buffer); - } diff --git a/src/chanserv.c b/src/chanserv.c index dea2ad2..49eb75c 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -2940,7 +2940,7 @@ eject_user(struct userNode *user, struct chanNode *channel, unsigned int argc, c if(action & ACTION_KICK) { char kick_reason[MAXLEN]; - sprintf(kick_reason, "%s (%s)", reason, user->nick); + sprintf(kick_reason, "(%s) %s", user->nick, reason); for(n = 0; n < victimCount; n++) KickChannelUser(victims[n]->user, channel, chanserv, kick_reason); @@ -5831,7 +5831,7 @@ handle_join(struct modeNode *mNode) if(bData) { char kick_reason[MAXLEN]; - sprintf(kick_reason, "%s (%s)", bData->reason, bData->owner); + sprintf(kick_reason, "(%s) %s", bData->owner, bData->reason); bData->triggered = now; if(bData != cData->bans) diff --git a/src/hash.h b/src/hash.h index 6ab5a86..41d3efd 100644 --- a/src/hash.h +++ b/src/hash.h @@ -58,6 +58,7 @@ #define FLAGS_STAMPED 0x1000 /* for users who have been stamped */ #define FLAGS_HIDDEN_HOST 0x2000 /* user's host is masked by their account */ #define FLAGS_REGNICK 0x4000 /* user owns their current nick */ +#define FLAGS_REGISTERING 0x8000 /* user has issued accnt register command, is waiting for email cookie */ #define IsOper(x) ((x)->modes & FLAGS_OPER) #define IsService(x) ((x)->modes & FLAGS_SERVICE) @@ -73,6 +74,7 @@ #define IsStamped(x) ((x)->modes & FLAGS_STAMPED) #define IsHiddenHost(x) ((x)->modes & FLAGS_HIDDEN_HOST) #define IsReggedNick(x) ((x)->modes & FLAGS_REGNICK) +#define IsRegistering(x) ((x)->modes & FLAGS_REGISTERING) #define IsLocal(x) ((x)->uplink == self) #define NICKLEN 30 diff --git a/src/nickserv.c b/src/nickserv.c index 66705c8..65ca14e 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -157,6 +157,7 @@ static const struct message_entry msgtab[] = { { "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?" }, @@ -278,7 +279,7 @@ static const struct message_entry msgtab[] = { { "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 %1$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" }, @@ -1084,6 +1085,11 @@ static NICKSERV_FUNC(cmd_register) 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; @@ -1166,6 +1172,9 @@ static NICKSERV_FUNC(cmd_register) if (no_auth) nickserv_make_cookie(user, hi, ACTIVATION, hi->passwd); + /* Set registering flag.. */ + user->modes |= FLAGS_REGISTERING; + return 1; } diff --git a/src/opserv.c b/src/opserv.c index a7eca70..367d496 100644 --- a/src/opserv.c +++ b/src/opserv.c @@ -1183,6 +1183,7 @@ static MODCMD_FUNC(cmd_whois) if (IsDeaf(target)) buffer[bpos++] = 'd'; if (IsHiddenHost(target)) buffer[bpos++] = 'x'; if (IsGagged(target)) buffer_cat(" (gagged)"); + if (IsRegistering(target)) buffer_cat(" (registered account)"); buffer[bpos] = 0; if (bpos > 0) reply("OSMSG_WHOIS_MODES", buffer);