Feature Request: Ability to reset a user's password as an administrator - FogBugz Knowledge Exchange most recent 30 from http://fogbugz.stackexchange.com2013-05-19T05:11:53Zhttp://fogbugz.stackexchange.com/feeds/question/9823http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://fogbugz.stackexchange.com/questions/9823/feature-request-ability-to-reset-a-users-password-as-an-administratorFeature Request: Ability to reset a user's password as an administratoradambox2012-01-18T15:13:37Z2012-07-31T13:11:00Z
<p>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.</p>
http://fogbugz.stackexchange.com/questions/9823/feature-request-ability-to-reset-a-users-password-as-an-administrator/9824#9824Answer by adambox for Feature Request: Ability to reset a user's password as an administratoradambox2012-01-18T15:17:24Z2012-07-31T13:11:00Z<p>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.</p>
<p>Note: this only works if you have FogBugz not at the root of your website.</p>
<p>Anyone with improvements to this script, please post them! :)</p>
<pre><code>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");
});
}
</code></pre>