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): * Contributor(s):
* Ben "Count XULula" Goodger * Ben "Count XULula" Goodger
* Mike Calmus
*/ */
/*** =================== INITIALISATION CODE =================== ***/ /*** =================== INITIALISATION CODE =================== ***/
@ -236,39 +237,38 @@ function LoadSignons() {
var nextPassword; var nextPassword;
try { try {
nextPassword = enumerator.getNext(); 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) { } catch(e) {
/* user supplied invalid database key */ /* An entry is corrupt. Go to next element. */
window.close();
return false;
} }
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; signonsTreeView.rowCount = signons.length;

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

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

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

@ -21,6 +21,7 @@
* *
* Contributor(s): * Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com> * Pierre Phaneuf <pp@ludusdesign.com>
* Mike Calmus
* *
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
@ -2937,7 +2938,8 @@ SINGSIGN_ReencryptAll()
user->signonData_list.ElementAt(k)); user->signonData_list.ElementAt(k));
nsAutoString userName; nsAutoString userName;
if (NS_FAILED(si_Decrypt(data->value, 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))) { if (NS_FAILED(si_Encrypt(userName, data->value))) {
return PR_FALSE; return PR_FALSE;