]> jfr.im git - irc/evilnet/x3.git/commitdiff
added odelcookie
authorsirvulcan <redacted>
Mon, 7 Mar 2005 04:12:33 +0000 (04:12 +0000)
committersirvulcan <redacted>
Mon, 7 Mar 2005 04:12:33 +0000 (04:12 +0000)
ChangeLog.X3
src/md5.c
src/nickserv.c
src/nickserv.help

index 44c8392e437c85d1aafbaeb1adf77475fec98a60..7deb1b6b77700a8a6224b1e43d1b8f1958101903 100644 (file)
@@ -1,9 +1,16 @@
 /***********************************************************************
  X3 ChangeLog
 
-2005-02-22  Neil Spierling  <sirvulcan@gmail.com>
+2005-03-07  Neil Spierling  <sirvulcan@gmail.com>
 
-       * stuff
+       * nickserv.help: Added odelcookie section.
+
+       * src/nickserv.c: Added odelcookie for deleting auth cookies and email
+       cookies.
+
+       * src/md5.c: Cleaned up compile warnings.
+
+       * src/nickserv.help: Added odelcookie section.
 
 ***********************************************************************/
 
index 859c9d0dededf0acdbf09c75f068cffcd9ad67c9..62680ee087931793d361f69de005d8da5a2a5b2e 100644 (file)
--- a/src/md5.c
+++ b/src/md5.c
@@ -439,6 +439,7 @@ void md5_process( md5_context *ctx, uint8 data[64] )
     C = ctx->state[2];
     D = ctx->state[3];
 
+#undef F
 #define F(x,y,z) (z ^ (x & (y ^ z)))
 
     P( A, B, C, D,  0,  7, 0xD76AA478 );
index 3f09fca6608d1bac94271d667572dbe2fd2d6d79..173fca320df762ec2e3d38c823c994d95ce332e7 100644 (file)
@@ -151,6 +151,7 @@ static const struct message_entry msgtab[] = {
     { "NSMSG_COOKIE_LIVE", "Account $b%s$b already has a cookie active.  Please either finish using that cookie, wait for it to expire, or auth to the account and use the $bdelcookie$b command." },
     { "NSMSG_EMAIL_UNACTIVATED", "That email address already has an unused cookie outstanding.  Please use the cookie or wait for it to expire." },
     { "NSMSG_NO_COOKIE", "Your account does not have any cookie issued right now." },
+    { "NSMSG_NO_COOKIE_FOREIGN", "The account $b%s$b does not have any cookie issued right now." },
     { "NSMSG_CANNOT_COOKIE", "You cannot use that kind of cookie when you are logged in." },
     { "NSMSG_BAD_COOKIE", "That cookie is not the right one.  Please make sure you are copying it EXACTLY from the email; it is case-sensitive, so $bABC$b is different from $babc$b." },
     { "NSMSG_HANDLE_ACTIVATED", "Your account is now activated (with the password you entered when you registered).  You are now authenticated to your account." },
@@ -162,6 +163,7 @@ static const struct message_entry msgtab[] = {
     { "NSMSG_BAD_COOKIE_TYPE", "Your account had bad cookie type %d; sorry.  I am confused.  Please report this bug." },
     { "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_ATE_FOREIGN_COOKIE", "I ate the cookie for account $b%s$b.  It 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." },
@@ -1883,6 +1885,26 @@ static NICKSERV_FUNC(cmd_delcookie)
     return 1;
 }
 
+static NICKSERV_FUNC(cmd_odelcookie)
+{
+    struct handle_info *hi;
+
+    NICKSERV_MIN_PARMS(2);
+
+    if (!(hi = get_victim_oper(user, argv[1])))
+        return 0;
+
+    if (!hi->cookie) {
+        reply("NSMSG_NO_COOKIE_FOREIGN", hi->handle);
+        return 0;
+    }
+
+    nickserv_eat_cookie(hi->cookie);
+    reply("NSMSG_ATE_FOREIGN_COOKIE", hi->handle);
+
+    return 1;
+}
+
 static NICKSERV_FUNC(cmd_resetpass)
 {
     struct handle_info *hi;
@@ -3961,6 +3983,7 @@ init_nickserv(const char *nick)
         nickserv_define_func("RESETPASS", cmd_resetpass, -1, 0, 0);
         nickserv_define_func("COOKIE", cmd_cookie, -1, 0, 0);
         nickserv_define_func("DELCOOKIE", cmd_delcookie, -1, 1, 0);
+        nickserv_define_func("ODELCOOKIE", cmd_odelcookie, 0, 1, 0);
         dict_insert(nickserv_opt_dict, "EMAIL", opt_email);
     }
     nickserv_define_func("GHOST", cmd_ghost, -1, 1, 0);
index 65b45ce3a4a0d88cafaf8924825c4d5dac3142da..b6f6f640a887e908083e9b561a93b19b0cd55b85 100644 (file)
         "$uSee Also:$u accountinfo, account flags, nickinfo, set, userinfo"
         );
 };
+
+"ODELCOOKIE" {
+        "/services/nickserv/email_enabled" (
+        "/msg $N ODELCOOKIE <nick|*account>",
+        "Requests that $N cancels the cookie of the specified account.",
+        );
+};
+
 "PASS" ("/msg $N@$s PASS <oldpass> <newpass>",
         "Changes your $b$N$b password.",
         "$uSee Also:$u auth");