summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-11 13:01:25 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-11 13:01:25 +0200
commit87adbf432207434cfc528f914998d58dbfebb5a7 (patch)
tree35e3eba73eab3f618cd2950b91c8ca8e4701a8e1 /application
parent92207c99ab0fe9d7b1500ecf9b5a17e44cc495dc (diff)
downloadUXP-87adbf432207434cfc528f914998d58dbfebb5a7.tar
UXP-87adbf432207434cfc528f914998d58dbfebb5a7.tar.gz
UXP-87adbf432207434cfc528f914998d58dbfebb5a7.tar.lz
UXP-87adbf432207434cfc528f914998d58dbfebb5a7.tar.xz
UXP-87adbf432207434cfc528f914998d58dbfebb5a7.zip
[PALEMOON] Preferences - Security - Password Manager: Use LoginHelper.isMasterPasswordSet instead of _masterPasswordSet
Diffstat (limited to 'application')
-rw-r--r--application/palemoon/components/preferences/security.js25
1 files changed, 4 insertions, 21 deletions
diff --git a/application/palemoon/components/preferences/security.js b/application/palemoon/components/preferences/security.js
index a337f398c..56664bf66 100644
--- a/application/palemoon/components/preferences/security.js
+++ b/application/palemoon/components/preferences/security.js
@@ -3,6 +3,9 @@
* 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/. */
+XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
+ "resource://gre/modules/LoginHelper.jsm");
+
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
var gSecurityPane = {
@@ -141,7 +144,7 @@ var gSecurityPane = {
*/
_initMasterPasswordUI: function ()
{
- var noMP = !this._masterPasswordSet();
+ var noMP = !LoginHelper.isMasterPasswordSet();
var button = document.getElementById("changeMasterPassword");
button.disabled = noMP;
@@ -151,26 +154,6 @@ var gSecurityPane = {
},
/**
- * 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
* "use master password" checkbox, and prompts for master password removal if
* one is set.