зеркало из https://github.com/mozilla/gecko-dev.git
bug 41843, single signon not working on key sites, r=sspitzer
This commit is contained in:
Родитель
5ca3f53ba7
Коммит
19be7933a9
|
@ -97,8 +97,17 @@ function LoadSignons()
|
||||||
var currSignon = TrimString(signonList[i]);
|
var currSignon = TrimString(signonList[i]);
|
||||||
// TEMP HACK until morse fixes signon viewer functions
|
// TEMP HACK until morse fixes signon viewer functions
|
||||||
currSignon = RemoveHTMLFormatting(currSignon);
|
currSignon = RemoveHTMLFormatting(currSignon);
|
||||||
|
/* parameter passed in is url:username */
|
||||||
var site = currSignon.substring(0,currSignon.lastIndexOf(":"));
|
var site = currSignon.substring(0,currSignon.lastIndexOf(":"));
|
||||||
var user = currSignon.substring(currSignon.lastIndexOf(":")+1,currSignon.length);
|
var user = currSignon.substring(currSignon.lastIndexOf(":")+1,currSignon.length);
|
||||||
|
if (user == "") {
|
||||||
|
/* no username passed in, parse if out of url */
|
||||||
|
var uri =
|
||||||
|
Components.classes["component://netscape/network/standard-url"]
|
||||||
|
.createInstance(Components.interfaces.nsIURI);
|
||||||
|
uri.spec = site;
|
||||||
|
user = uri.username;
|
||||||
|
}
|
||||||
AddItem("savesignonlist",[site,user],"signon_",i-1);
|
AddItem("savesignonlist",[site,user],"signon_",i-1);
|
||||||
}
|
}
|
||||||
if (deleted_signons_count >= signonList.length) {
|
if (deleted_signons_count >= signonList.length) {
|
||||||
|
|
|
@ -1812,8 +1812,8 @@ si_OkToSave(char *passwordRealm, nsAutoString userName) {
|
||||||
/*
|
/*
|
||||||
* Check for a signon submission and remember the data if so
|
* Check for a signon submission and remember the data if so
|
||||||
*/
|
*/
|
||||||
PUBLIC void
|
PRIVATE void
|
||||||
SINGSIGN_RememberSignonData (char* passwordRealm, nsVoidArray * signonData)
|
si_RememberSignonData (char* passwordRealm, nsVoidArray * signonData)
|
||||||
{
|
{
|
||||||
int passwordCount = 0;
|
int passwordCount = 0;
|
||||||
int pswd[3];
|
int pswd[3];
|
||||||
|
@ -1924,7 +1924,28 @@ SINGSIGN_RememberSignonData (char* passwordRealm, nsVoidArray * signonData)
|
||||||
}
|
}
|
||||||
|
|
||||||
PUBLIC void
|
PUBLIC void
|
||||||
SINGSIGN_RestoreSignonData (char* passwordRealm, PRUnichar* name, PRUnichar** value, PRUint32 elementNumber) {
|
SINGSIGN_RememberSignonData (char* passwordRealm, nsVoidArray * signonData)
|
||||||
|
{
|
||||||
|
nsresult rv;
|
||||||
|
NS_WITH_SERVICE(nsIURL, uri, "component://netscape/network/standard-url", &rv);
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
rv = uri->SetSpec(passwordRealm);
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
char * strippedRealm;
|
||||||
|
rv = uri->GetHost(&strippedRealm);
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
si_RememberSignonData (strippedRealm, signonData);
|
||||||
|
PR_Free(strippedRealm);
|
||||||
|
}
|
||||||
|
|
||||||
|
PRIVATE void
|
||||||
|
si_RestoreSignonData (char* passwordRealm, PRUnichar* name, PRUnichar** value, PRUint32 elementNumber) {
|
||||||
si_SignonUserStruct* user;
|
si_SignonUserStruct* user;
|
||||||
si_SignonDataStruct* data;
|
si_SignonDataStruct* data;
|
||||||
nsAutoString correctedName;
|
nsAutoString correctedName;
|
||||||
|
@ -2026,6 +2047,26 @@ SINGSIGN_RestoreSignonData (char* passwordRealm, PRUnichar* name, PRUnichar** va
|
||||||
si_unlock_signon_list();
|
si_unlock_signon_list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PUBLIC void
|
||||||
|
SINGSIGN_RestoreSignonData (char* passwordRealm, PRUnichar* name, PRUnichar** value, PRUint32 elementNumber) {
|
||||||
|
nsresult rv;
|
||||||
|
NS_WITH_SERVICE(nsIURL, uri, "component://netscape/network/standard-url", &rv);
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
rv = uri->SetSpec(passwordRealm);
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
char * strippedRealm;
|
||||||
|
rv = uri->GetHost(&strippedRealm);
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
si_RestoreSignonData (strippedRealm, name, value, elementNumber);
|
||||||
|
PR_Free(strippedRealm);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remember signon data from a browser-generated password dialog
|
* Remember signon data from a browser-generated password dialog
|
||||||
*/
|
*/
|
||||||
|
|
Загрузка…
Ссылка в новой задаче