diff options
author | Matěj Cepl <mcepl@redhat.com> | 2010-07-16 01:57:10 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2010-07-16 04:24:35 +0200 |
commit | 91aac059810fec3d849bb48eb51f55e64b1cc32b (patch) | |
tree | f2b1da249409e413c2bb03279ef46077cb79707e /lib/util.js | |
parent | 2b1cf2b13c8d75feff30fdcf93bdb390523e1fd9 (diff) | |
parent | ff9af9afae670abd2944ad56705032285db08bc0 (diff) | |
download | bugzilla-triage-91aac059810fec3d849bb48eb51f55e64b1cc32b.tar.gz |
Merge branch 'betterPasswordHandling'
Diffstat (limited to 'lib/util.js')
-rw-r--r-- | lib/util.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/util.js b/lib/util.js index b72f7f0..f582d1d 100644 --- a/lib/util.js +++ b/lib/util.js @@ -197,7 +197,10 @@ var filterByRegexp = exports.filterByRegexp = * * @return String with the password */ -var getPassword = exports.getPassword = function getPassword() { +var getPassword = exports.getPassword = function getPassword(prompt) { + if (prompt === null) { + prompt = "Enter password:"; + } var prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"] .getService(Ci.nsIPromptService); var password = { @@ -206,7 +209,7 @@ var getPassword = exports.getPassword = function getPassword() { var check = { value : true }; // default the checkbox to true - var result = prompts.promptPassword(null, "Title", "Enter password:", + var result = prompts.promptPassword(null, "Title", prompt, password, null, check); // result is true if OK was pressed, false if cancel was pressed. // password.value is set if OK was pressed. @@ -216,4 +219,4 @@ var getPassword = exports.getPassword = function getPassword() { } else { return undefined; } -};
\ No newline at end of file +}; |