resetpassword.js (822B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 "use strict"; 6 7 document.addEventListener("dialogaccept", resetPassword); 8 9 function resetPassword() { 10 var pk11db = Cc["@mozilla.org/security/pk11tokendb;1"].getService( 11 Ci.nsIPK11TokenDB 12 ); 13 var token = pk11db.getInternalKeyToken(); 14 token.reset(); 15 16 try { 17 Services.logins.removeAllUserFacingLogins(); 18 } catch (e) {} 19 20 let l10n = new Localization(["security/pippki/pippki.ftl"], true); 21 if (l10n) { 22 Services.prompt.alert( 23 window, 24 l10n.formatValueSync("pippki-reset-password-confirmation-title"), 25 l10n.formatValueSync("pippki-reset-password-confirmation-message") 26 ); 27 } 28 }