Bug 186237 manage stored passwords preference option does not work in this build

patch by mcalmus@nyx.net r=dveditz sr=brendan a=dveditz
This commit is contained in:
timeless%mozdev.org 2004-02-13 10:09:21 +00:00
Родитель 5f8c0656aa
Коммит b9adeb8b50
3 изменённых файлов: 37 добавлений и 35 удалений

Просмотреть файл

@ -20,6 +20,7 @@
*
* Contributor(s):
* Ben "Count XULula" Goodger
* Mike Calmus
*/
/*** =================== INITIALISATION CODE =================== ***/
@ -236,39 +237,38 @@ function LoadSignons() {
var nextPassword;
try {
nextPassword = enumerator.getNext();
nextPassword = nextPassword.QueryInterface(Components.interfaces.nsIPassword);
var host = nextPassword.host;
var user = nextPassword.user;
var rawuser = user;
// if no username supplied, try to parse it out of the url
if (user == "") {
var unused = { };
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var username;
try {
username = ioService.newURI(host, null, null).username;
} catch(e) {
username = "";
}
if (username != "") {
user = username;
} else {
user = "<>";
}
}
if (encrypted) {
user = kSignonBundle.getFormattedString("encrypted", [user], 1);
}
signons[count] = new Signon(count++, host, user, rawuser);
} catch(e) {
/* user supplied invalid database key */
window.close();
return false;
/* An entry is corrupt. Go to next element. */
}
nextPassword = nextPassword.QueryInterface(Components.interfaces.nsIPassword);
var host = nextPassword.host;
var user = nextPassword.user;
var rawuser = user;
// if no username supplied, try to parse it out of the url
if (user == "") {
var unused = { };
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var username;
try {
username = ioService.newURI(host, null, null).username;
} catch(e) {
username = "";
}
if (username != "") {
user = username;
} else {
user = "<>";
}
}
if (encrypted) {
user = kSignonBundle.getFormattedString("encrypted", [user], 1);
}
signons[count] = new Signon(count++, host, user, rawuser);
}
signonsTreeView.rowCount = signons.length;

Просмотреть файл

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mike Calmus
*
*
* Alternatively, the contents of this file may be used under the terms of
@ -66,6 +67,8 @@ class nsPasswordManagerEnumerator : public nsISimpleEnumerator
PRUnichar * pswd;
nsresult rv = SINGSIGN_Enumerate(mHostCount, mUserCount++, &host, &user, &pswd);
if (NS_FAILED(rv)) {
mUserCount = 0;
mHostCount++;
return rv;
}
if (mUserCount == SINGSIGN_UserCount(mHostCount)) {
@ -222,9 +225,6 @@ nsPasswordManager::FindPasswordEntry
// Emumerate through set of saved logins
while (hasMoreElements) {
rv = enumerator->GetNext(getter_AddRefs(passwordElem));
if (NS_FAILED(rv)) {
return rv;
}
if (NS_SUCCEEDED(rv) && passwordElem) {

Просмотреть файл

@ -21,6 +21,7 @@
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
* Mike Calmus
*
*
* Alternatively, the contents of this file may be used under the terms of
@ -2937,7 +2938,8 @@ SINGSIGN_ReencryptAll()
user->signonData_list.ElementAt(k));
nsAutoString userName;
if (NS_FAILED(si_Decrypt(data->value, userName))) {
return PR_FALSE;
//Don't try to re-encrypt. Just go to the next one.
continue;
}
if (NS_FAILED(si_Encrypt(userName, data->value))) {
return PR_FALSE;