mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-26 00:57:30 +09:00
[PALEMOON] Preferences - Security - Password Manager: Use LoginHelper.isMasterPasswordSet instead of _masterPasswordSet
This commit is contained in:
parent
6c1f35b378
commit
0aaef1f312
1 changed files with 4 additions and 21 deletions
|
|
@ -3,6 +3,9 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
|
||||||
|
"resource://gre/modules/LoginHelper.jsm");
|
||||||
|
|
||||||
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
|
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||||
|
|
||||||
var gSecurityPane = {
|
var gSecurityPane = {
|
||||||
|
|
@ -141,7 +144,7 @@ var gSecurityPane = {
|
||||||
*/
|
*/
|
||||||
_initMasterPasswordUI: function ()
|
_initMasterPasswordUI: function ()
|
||||||
{
|
{
|
||||||
var noMP = !this._masterPasswordSet();
|
var noMP = !LoginHelper.isMasterPasswordSet();
|
||||||
|
|
||||||
var button = document.getElementById("changeMasterPassword");
|
var button = document.getElementById("changeMasterPassword");
|
||||||
button.disabled = noMP;
|
button.disabled = noMP;
|
||||||
|
|
@ -150,26 +153,6 @@ var gSecurityPane = {
|
||||||
checkbox.checked = !noMP;
|
checkbox.checked = !noMP;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the user has a master password set and false otherwise.
|
|
||||||
*/
|
|
||||||
_masterPasswordSet: function ()
|
|
||||||
{
|
|
||||||
const Cc = Components.classes, Ci = Components.interfaces;
|
|
||||||
var secmodDB = Cc["@mozilla.org/security/pkcs11moduledb;1"].
|
|
||||||
getService(Ci.nsIPKCS11ModuleDB);
|
|
||||||
var slot = secmodDB.findSlotByName("");
|
|
||||||
if (slot) {
|
|
||||||
var status = slot.status;
|
|
||||||
var hasMP = status != Ci.nsIPKCS11Slot.SLOT_UNINITIALIZED &&
|
|
||||||
status != Ci.nsIPKCS11Slot.SLOT_READY;
|
|
||||||
return hasMP;
|
|
||||||
} else {
|
|
||||||
// XXX I have no bloody idea what this means
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables/disables the master password button depending on the state of the
|
* Enables/disables the master password button depending on the state of the
|
||||||
* "use master password" checkbox, and prompts for master password removal if
|
* "use master password" checkbox, and prompts for master password removal if
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue