SINGSIGN_GetSignonListForViewer(nsAutoString& aSignonList)
SINGSIGN_GetSignonListForViewer(nsString& aSignonList)
SINGSIGN_GetSignonListForViewer(nsAutoString& aSignonList){  /* force loading of the signons file */  si_RegisterSignonPrefCallbacks();  nsAutoString buffer;  int signonNum = 0;  si_SignonURLStruct *url;  si_SignonUserStruct * user;  si_SignonDataStruct* data = nsnull;  PRInt32 urlCount = LIST_COUNT(si_signon_list);  for (PRInt32 i=0; i<urlCount; i++) {    url = NS_STATIC_CAST(si_SignonURLStruct*, si_signon_list->ElementAt(i));    PRInt32 userCount = LIST_COUNT(url->signonUser_list);    for (PRInt32 j=0; j<userCount; j++) {      user = NS_STATIC_CAST(si_SignonUserStruct*, url->signonUser_list->ElementAt(j));      /* first non-password data item for user is the username */      PRInt32 dataCount = LIST_COUNT(user->signonData_list);      for (PRInt32 k=0; k<dataCount; k++) {        data = (si_SignonDataStruct *) (user->signonData_list->ElementAt(k));        if (!(data->isPassword)) {          break;        }      }      nsAutoString userName;      if (NS_SUCCEEDED(si_Decrypt(data->value, userName))) {        buffer.AppendWithConversion(BREAK);        buffer.AppendWithConversion("<OPTION value=");        buffer.AppendInt(signonNum, 10);        buffer.AppendWithConversion(">");        buffer.AppendWithConversion(url->passwordRealm);        buffer.AppendWithConversion(":");        if (!data->isPassword) { /* need this test in case all fields are passwords */          buffer += userName;          if (data->value.CharAt(0) != '~') { /* this was an encrypted value */            buffer.AppendWithConversion("(encrypted)");          }        }        buffer.AppendWithConversion("</OPTION>\n");        signonNum++;      } else {        /* don't display saved signons if user couldn't unlock the database */        aSignonList.AssignWithConversion("."); /* a list of length 1 tells viewer that database was not unlocked */         return;      }    }  }  aSignonList = buffer;}