1

When you first create a user, you can choose to have FogBugz generate a password and ask the user to log in and change it. I want (as an administrator) to be able to cause the user to have to set their password again.

flag

1 Answer

1

This lousy BugMonkey customization adds a link to the edit user page to ajaxily reset a user's password. Set it up to be on for admins and off for other users. It uses a terrible hack to prevent your current login cookie from being sent, so the post to the forgot password page is unauthenticated (as it needs to be). Make sure to set sUrl to your FogBugz URL with weird capitalization so the hack works.

Note: this only works if you have FogBugz not at the root of your website.

Anyone with improvements to this script, please post them! :)

name:          Password Resetter
description:   Adds link to reset a user's password
author:        Adam Wishneusky
version:       1.0.0.1

js:

   // set sUrl to your FogBugz url, without the trailing slash, and with strange
   // capitalization that users won't use when they access the site. e.g. if your
   // URL is http://example.com/fogbugz/default.asp set sUrl to this:
   // http://example.com/fOgBugz

   $('label[for="bPassword"]').after(' <a href="#" onclick="reset();">Reset Password</a>')
   window.reset = function() {
      var sUrl = "http://adam.hq.fogcreek.com/fogbugzreLeaSe";
      var sEmail = $("#inputSEmail").attr("value");
      $.ajax({
           url: sUrl + "/default.asp",
           type: "POST",
           data: "sPerson=" + encodeURIComponent(sEmail) + "&pre=preForgotPassword"
      }).done(function( msg ) {
         console.log(msg);
         alert("Password reset");
      });
   }
link|flag
If you have FogBugz at the root of your website (site/default.asp), try dEfAuLt.asp – Michel de Ruiter Jul 31 at 21:58
@michel I thought that didn't work. I must have misread your comment before (which now seems to be gone..) – adambox Aug 1 at 18:50
@adambox I thought it didn't work but I checked the wrong mailbox. Works fine! (see your case FC2321389) – Michel de Ruiter Aug 2 at 8:06

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.