Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
singsign.h File Reference
#include "nsString.h"
#include "nsVoidArray.h"
#include "nsIPref.h"
#include "nsIDOMWindowInternal.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  si_SignonDataStruct

Defines

#define SINGSIGN_SAVE_PASSWORD_NEVER   0
#define SINGSIGN_SAVE_PASSWORD_FOR_SESSION   1
#define SINGSIGN_SAVE_PASSWORD_PERMANENTLY   2

Functions

PR_BEGIN_EXTERN_C PRInt32 SINGSIGN_HostCount ()
PRInt32 SINGSIGN_UserCount (PRInt32 host)
PRInt32 SINGSIGN_RejectCount ()
nsresult SINGSIGN_Enumerate (PRInt32 hostNumber, PRInt32 userNumber, PRBool decrypt, char **host, PRUnichar **user, PRUnichar **pswd)
nsresult SINGSIGN_RejectEnumerate (PRInt32 rejectNumber, char **host)
void SINGSIGN_RestoreSignonData (nsIPrompt *dialog, nsIURI *passwordRealm, const PRUnichar *name, PRUnichar **value, PRUint32 formNumber, PRUint32 elementNumber)
nsresult SINGSIGN_PromptUsernameAndPassword (const PRUnichar *dialogTitle, const PRUnichar *text, PRUnichar **user, PRUnichar **pwd, const char *passwordRealm, nsIPrompt *dialog, PRBool *returnValue, PRUint32 savePassword=SINGSIGN_SAVE_PASSWORD_PERMANENTLY)
nsresult SINGSIGN_PromptPassword (const PRUnichar *dialogTitle, const PRUnichar *text, PRUnichar **pwd, const char *passwordRealm, nsIPrompt *dialog, PRBool *returnValue, PRUint32 savePassword=SINGSIGN_SAVE_PASSWORD_PERMANENTLY)
nsresult SINGSIGN_Prompt (const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *defaultText, PRUnichar **resultText, const char *passwordRealm, nsIPrompt *dialog, PRBool *returnValue, PRUint32 savePassword=SINGSIGN_SAVE_PASSWORD_PERMANENTLY)
nsresult SINGSIGN_RemoveUser (const char *passwordRealm, const PRUnichar *userName, PRBool notify)
nsresult SINGSIGN_RemoveUserAfterLoginFailure (const char *passwordRealm, const PRUnichar *userName, PRBool notify)
nsresult SINGSIGN_RemoveReject (const char *host)
nsresult SINGSIGN_AddReject (const char *host)
PRBool SINGSIGN_StorePassword (const char *passwordRealm, const PRUnichar *userName, const PRUnichar *password)
nsresult SINGSIGN_HaveData (nsIPrompt *dialog, const char *passwordRealm, const PRUnichar *userName, PRBool *retval)
void SI_RegisterCallback (const char *domain, PrefChangedFunc callback, void *instance_data)
void SI_UnregisterCallback (const char *domain, PrefChangedFunc callback, void *instance_data)
PRBool SI_GetBoolPref (const char *prefname, PRBool defaultvalue)
void SI_SetBoolPref (const char *prefname, PRBool prefvalue)
void SI_SetCharPref (const char *prefname, const char *prefvalue)
void SI_GetCharPref (const char *prefname, char **aPrefvalue)
void SI_GetLocalizedUnicharPref (const char *prefname, PRUnichar **aPrefvalue)
void SI_InitSignonFileName ()
PRBool SI_InSequence (const nsString &sequence, int number)
void SI_FindValueInArgs (const nsAString &results, const nsAString &name, nsAString &value)
void SI_DeleteAll ()
void SI_ClearUserData ()
void SI_DeletePersistentUserData ()
PRBool SINGSIGN_ReencryptAll ()
void SINGSIGN_RememberSignonData (nsIPrompt *dialog, nsIURI *uri, nsVoidArray *signonData, nsIDOMWindowInternal *window)

Define Documentation

Definition at line 56 of file singsign.h.

Definition at line 55 of file singsign.h.

Definition at line 57 of file singsign.h.


Function Documentation

Definition at line 1417 of file singsign.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1405 of file singsign.cpp.

               {
  if (si_PartiallyLoaded) {
    /* repeatedly remove first user node of first URL node */
    while (si_RemoveUser(NULL, EmptyString(), PR_FALSE, PR_FALSE, PR_TRUE, PR_TRUE)) {
    }
  }
  si_PartiallyLoaded = PR_FALSE;
  si_signon_list_changed = PR_TRUE;
  si_SaveSignonDataLocked("signons", PR_TRUE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1423 of file singsign.cpp.

                              {

  if (signonFileName && signonFileName[0]) {
    nsCOMPtr<nsIFile> file;
    nsresult rv = Wallet_ProfileDirectory(getter_AddRefs(file));
    if (NS_SUCCEEDED(rv)) {
      rv = file->AppendNative(nsDependentCString(signonFileName));
      if (NS_SUCCEEDED(rv))
        file->Remove(PR_FALSE);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SI_FindValueInArgs ( const nsAString &  results,
const nsAString &  name,
nsAString &  value 
)

Definition at line 2824 of file singsign.cpp.

{
  /* note: name must start and end with a vertical bar */
  nsReadingIterator<PRUnichar> start, end, barPos;
  results.BeginReading(start);
  results.EndReading(end);

  FindInReadable(name, start, end);
  if (start == end) {
    return;
  }
  start.advance(name.Length()); /* get past the |name| part */
  barPos = start;
  results.EndReading(end);
  FindCharInReadable(PRUnichar('|'), barPos, end);
  value = Substring(start, barPos);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool SI_GetBoolPref ( const char *  prefname,
PRBool  defaultvalue 
)

Definition at line 196 of file singsign.cpp.

                                                           {
  nsresult ret;
  PRBool prefvalue = defaultvalue;
  nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
  if (NS_SUCCEEDED(ret)) {
    ret = pPrefService->GetBoolPref(prefname, &prefvalue);
  }
  return prefvalue;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SI_GetCharPref ( const char *  prefname,
char **  aPrefvalue 
)

Definition at line 222 of file singsign.cpp.

                                                         {
  nsresult ret;
  nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
  if (NS_SUCCEEDED(ret)) {
    ret = pPrefService->CopyCharPref(prefname, aPrefvalue);
    if (NS_FAILED(ret)) {
      *aPrefvalue = nsnull;
    }
  } else {
    *aPrefvalue = nsnull;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SI_GetLocalizedUnicharPref ( const char *  prefname,
PRUnichar **  aPrefvalue 
)

Definition at line 236 of file singsign.cpp.

                                                                          {
  nsresult ret;
  nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
  if (NS_SUCCEEDED(ret)) {
    ret = pPrefService->GetLocalizedUnicharPref(prefname, aPrefvalue);
    if (NS_FAILED(ret)) {
      *aPrefvalue = nsnull;
    }
  } else {
      *aPrefvalue = nsnull;
  }
}

Here is the call graph for this function:

Definition at line 365 of file singsign.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool SI_InSequence ( const nsString sequence,
int  number 
)

Definition at line 2796 of file singsign.cpp.

{
  nsAutoString tail( sequence );
  nsAutoString head, temp;
  PRInt32 separator;

  for (;;) {
    /* get next item in list */
    separator = tail.FindChar(',');
    if (-1 == separator) {
      return PR_FALSE;
    }
    tail.Left(head, separator);
    tail.Mid(temp, separator+1, tail.Length() - (separator+1));
    tail = temp;

    /* test item to see if it equals our number */
    PRInt32 error;
    PRInt32 numberInList = head.ToInteger(&error);
    if (!error && numberInList == number) {
      return PR_TRUE;
    }
  }
  /* NOTREACHED */
  return PR_FALSE;
}

Here is the caller graph for this function:

void SI_RegisterCallback ( const char *  domain,
PrefChangedFunc  callback,
void instance_data 
)

Definition at line 166 of file singsign.cpp.

                                                                                       {
  nsresult ret;
  nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
  if (NS_SUCCEEDED(ret)) {
    ret = pPrefService->RegisterCallback(domain, callback, instance_data);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SI_SetBoolPref ( const char *  prefname,
PRBool  prefvalue 
)

Definition at line 184 of file singsign.cpp.

                                                        {
  nsresult ret;
  nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
  if (NS_SUCCEEDED(ret)) {
    ret = pPrefService->SetBoolPref(prefname, prefvalue);
    if (NS_SUCCEEDED(ret)) {
      ret = pPrefService->SavePrefFile(nsnull); 
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SI_SetCharPref ( const char *  prefname,
const char *  prefvalue 
)

Definition at line 207 of file singsign.cpp.

                                                              {
  if (!prefvalue) {
    return; /* otherwise the SetCharPref routine called below will crash */
  }
  nsresult ret;
  nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
  if (NS_SUCCEEDED(ret)) {
    ret = pPrefService->SetCharPref(prefname, prefvalue);
    if (NS_SUCCEEDED(ret)) {
      ret = pPrefService->SavePrefFile(nsnull); 
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SI_UnregisterCallback ( const char *  domain,
PrefChangedFunc  callback,
void instance_data 
)

Definition at line 175 of file singsign.cpp.

                                                                                         {
  nsresult ret;
  nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
  if (NS_SUCCEEDED(ret)) {
    ret = pPrefService->UnregisterCallback(domain, callback, instance_data);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult SINGSIGN_AddReject ( const char *  host)

Definition at line 1019 of file singsign.cpp.

                                       {
  si_PutReject(host, nsString(/*thisParameter_isObsolete*/), PR_TRUE);
// @see http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/extensions/wallet/src/singsign.cpp&rev=1.212&mark=1693#1650
  return NS_OK;
}

Here is the call graph for this function:

nsresult SINGSIGN_Enumerate ( PRInt32  hostNumber,
PRInt32  userNumber,
PRBool  decrypt,
char **  host,
PRUnichar **  user,
PRUnichar **  pswd 
)

Definition at line 2927 of file singsign.cpp.

                                           {

  if (gSelectUserDialogCount>0 && hostNumber==0 && userNumber==0) {
    // starting to enumerate over all saved logins
    // notify recipients if login list is in use by SelectUserDialog
    nsCOMPtr<nsIObserverService> os(do_GetService("@mozilla.org/observer-service;1"));
    if (os) {
      os->NotifyObservers(nsnull, "signonSelectUser", NS_LITERAL_STRING("inUse").get());
    }
  }

  if (hostNumber > SINGSIGN_HostCount() || userNumber > SINGSIGN_UserCount(hostNumber)) {
    return NS_ERROR_FAILURE;
  }
  si_SignonURLStruct *hostStruct;
  si_SignonUserStruct * userStruct;
  si_SignonDataStruct* data = nsnull;

  hostStruct = NS_STATIC_CAST(si_SignonURLStruct*, si_signon_list->ElementAt(hostNumber));
  NS_ASSERTION(hostStruct, "corrupt singlesignon list");
  *host = (char *) nsMemory::Clone
    (hostStruct->passwordRealm, strlen(hostStruct->passwordRealm) + 1);
  NS_ENSURE_ARG_POINTER(host);
  userStruct = NS_STATIC_CAST
    (si_SignonUserStruct*, hostStruct->signonUser_list.ElementAt(userNumber));

  /* first non-password data item for user is the username */
  PRInt32 dataCount = userStruct->signonData_list.Count();
  PRInt32 k;
  for (k=0; k<dataCount; k++) {
    data = NS_STATIC_CAST(si_SignonDataStruct *, userStruct->signonData_list.ElementAt(k));
    if (!(data->isPassword)) {
      break;
    }
  }

  nsresult rv;
  nsAutoString userName;
  if (decrypt) {
    rv = Wallet_Decrypt(data->value, userName);
    if (NS_FAILED(rv)) {
      /* don't display saved signons if user couldn't unlock the database */
    return rv;
    }
  } else {
    userName = data->value;
  }
  if (!(*user = ToNewUnicode(userName))) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  /* first password data item for user is the password */
  for (k=0; k<dataCount; k++) {
    data = NS_STATIC_CAST(si_SignonDataStruct *, userStruct->signonData_list.ElementAt(k));
    if ((data->isPassword)) {
      break;
    }
  }

  nsAutoString passWord;
  if (decrypt) {
    rv = Wallet_Decrypt(data->value, passWord);
    if (NS_FAILED(rv)) {
      /* don't display saved signons if user couldn't unlock the database */
      Recycle(*user);
      return rv;
    }
  } else {
    passWord = data->value;
  }  
  if (!(*pswd = ToNewUnicode(passWord))) {
    Recycle(*user);
    return NS_ERROR_OUT_OF_MEMORY;
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult SINGSIGN_HaveData ( nsIPrompt dialog,
const char *  passwordRealm,
const PRUnichar userName,
PRBool retval 
)

Definition at line 2883 of file singsign.cpp.

{
  nsAutoString data, usernameForLookup;

  *retval = PR_FALSE;

  if (!si_GetSignonRememberingPref()) {
    return NS_OK;
  }

  /* get previous data used with this username, pick first user if no username found */
  si_RestoreOldSignonDataFromBrowser(dialog, passwordRealm, usernameForLookup.IsEmpty(), usernameForLookup, data);

  if (!data.IsEmpty()) {
    *retval = PR_TRUE;
  }

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 2904 of file singsign.cpp.

                     {
  /* force loading of the signons file */
  si_RegisterSignonPrefCallbacks();

  if (!si_signon_list) {
    return 0;
  }
  return si_signon_list->Count();
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult SINGSIGN_Prompt ( const PRUnichar dialogTitle,
const PRUnichar text,
const PRUnichar defaultText,
PRUnichar **  resultText,
const char *  passwordRealm,
nsIPrompt dialog,
PRBool returnValue,
PRUint32  savePassword = SINGSIGN_SAVE_PASSWORD_PERMANENTLY 
)

Definition at line 2738 of file singsign.cpp.

{
  nsresult res;
  nsAutoString data, emptyUsername;

  /* do only the dialog if signon preference is not enabled */
  if (!si_GetSignonRememberingPref()){
    return si_DoDialogIfPrefIsOff(dialogTitle,
                                  text,
                                  nsnull,
                                  nsnull,
                                  defaultText,
                                  resultText,
                                  passwordRealm,
                                  dialog,
                                  pressedOK, 
                                  savePassword,
                                  prompt);
  }

  /* get previous data used with this hostname */
  si_RestoreOldSignonDataFromBrowser(dialog, passwordRealm, PR_TRUE, emptyUsername, data);

  /* return if data was found */
  if (!data.IsEmpty()) {
    *resultText = ToNewUnicode(data);
    *pressedOK = PR_TRUE;
    return NS_OK;
  }

  /* no data found, get new data from user */
  data = defaultText;
  *resultText = ToNewUnicode(data);
  PRBool checked = PR_FALSE;
  res = si_CheckGetData(resultText, dialogTitle, text, dialog, savePassword, &checked);
  if (NS_FAILED(res)) {
    /* user pressed Cancel */
    PR_FREEIF(*resultText);
    *pressedOK = PR_FALSE;
    return NS_OK;
  }
  if (checked) {
    Wallet_GiveCaveat(nsnull, dialog);
    si_RememberSignonDataFromBrowser(passwordRealm, emptyUsername, nsDependentString(*resultText));
  }

  /* cleanup and return */
  *pressedOK = PR_TRUE;
  return NS_OK;
}

Here is the call graph for this function:

nsresult SINGSIGN_PromptPassword ( const PRUnichar dialogTitle,
const PRUnichar text,
PRUnichar **  pwd,
const char *  passwordRealm,
nsIPrompt dialog,
PRBool returnValue,
PRUint32  savePassword = SINGSIGN_SAVE_PASSWORD_PERMANENTLY 
)

Definition at line 2685 of file singsign.cpp.

{

  nsresult res;
  nsAutoString password, username;

  /* do only the dialog if signon preference is not enabled */
  if (!si_GetSignonRememberingPref()){
    return si_DoDialogIfPrefIsOff(dialogTitle,
                                  text,
                                  nsnull,
                                  pwd,
                                  nsnull,
                                  nsnull,
                                  passwordRealm,
                                  dialog,
                                  pressedOK, 
                                  savePassword,
                                  promptPassword);
  }

  /* get previous password used with this username, pick first user if no username found */
  si_RestoreOldSignonDataFromBrowser(dialog, passwordRealm, username.IsEmpty(), username, password);

  /* return if a password was found */
  if (!password.IsEmpty()) {
    *pwd = ToNewUnicode(password);
    *pressedOK = PR_TRUE;
    return NS_OK;
  }

  /* no password found, get new password from user */
  PRBool checked = PR_FALSE;
  res = si_CheckGetPassword(pwd, dialogTitle, text, dialog, savePassword, &checked);
  if (NS_FAILED(res)) {
    /* user pressed Cancel */
    PR_FREEIF(*pwd);
    *pressedOK = PR_FALSE;
    return NS_OK;
  }
  if (checked) {
    Wallet_GiveCaveat(nsnull, dialog);
    si_RememberSignonDataFromBrowser(passwordRealm, username, nsDependentString(*pwd));
  }

  /* cleanup and return */
  *pressedOK = PR_TRUE;
  return NS_OK;
}

Here is the call graph for this function:

nsresult SINGSIGN_PromptUsernameAndPassword ( const PRUnichar dialogTitle,
const PRUnichar text,
PRUnichar **  user,
PRUnichar **  pwd,
const char *  passwordRealm,
nsIPrompt dialog,
PRBool returnValue,
PRUint32  savePassword = SINGSIGN_SAVE_PASSWORD_PERMANENTLY 
)

Definition at line 2627 of file singsign.cpp.

                                                                                             {

  nsresult res;

  /* do only the dialog if signon preference is not enabled */
  if (!si_GetSignonRememberingPref()){
    return si_DoDialogIfPrefIsOff(dialogTitle,
                                  text,
                                  user,
                                  pwd,
                                  nsnull,
                                  nsnull,
                                  passwordRealm,
                                  dialog,
                                  pressedOK, 
                                  savePassword,
                                  promptUsernameAndPassword);
  }

  /* prefill with previous username/password if any */
  nsAutoString username, password;
  si_RestoreOldSignonDataFromBrowser(dialog, passwordRealm, PR_FALSE, username, password);

  /* get new username/password from user */
  if (!(*user = ToNewUnicode(username))) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  if (!(*pwd = ToNewUnicode(password))) {
    PR_Free(*user);
    return NS_ERROR_OUT_OF_MEMORY;
  }

  PRBool checked = (**user != 0);
  PRBool remembered = checked;
  res = si_CheckGetUsernamePassword(user, pwd, dialogTitle, text, dialog, savePassword, &checked);
  if (NS_FAILED(res)) {
    /* user pressed Cancel */
    PR_FREEIF(*user);
    PR_FREEIF(*pwd);
    *pressedOK = PR_FALSE;
    return NS_OK;
  }
  if (checked) {
    Wallet_GiveCaveat(nsnull, dialog);
    si_RememberSignonDataFromBrowser (passwordRealm, nsDependentString(*user), nsDependentString(*pwd));
  } else if (remembered) {
    /* a login was remembered but user unchecked the box; we forget the remembered login */
    si_RemoveUser(passwordRealm, username, PR_TRUE, PR_FALSE, PR_TRUE);  
  }

  /* cleanup and return */
  *pressedOK = PR_TRUE;
  return NS_OK;
}

Here is the call graph for this function:

Definition at line 2843 of file singsign.cpp.

{
  /* force loading of the signons file */
  si_RegisterSignonPrefCallbacks();

  nsAutoString buffer;
  si_SignonURLStruct *url;
  si_SignonUserStruct * user;
  si_SignonDataStruct* data = nsnull;

  si_lock_signon_list();
  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 = url->signonUser_list.Count();
    for (PRInt32 j=0; j<userCount; j++) {
      user = NS_STATIC_CAST(si_SignonUserStruct*, url->signonUser_list.ElementAt(j));

      PRInt32 dataCount = user->signonData_list.Count();
      for (PRInt32 k=0; k<dataCount; k++) {
        data = NS_STATIC_CAST(si_SignonDataStruct *,
                              user->signonData_list.ElementAt(k));
        nsAutoString userName;
        if (NS_FAILED(Wallet_Decrypt(data->value, userName))) {
          //Don't try to re-encrypt. Just go to the next one.
          continue;
        }
        if (NS_FAILED(Wallet_Encrypt(userName, data->value))) {
          return PR_FALSE;
        }
      }
    }
  }
  si_signon_list_changed = PR_TRUE;
  si_SaveSignonDataLocked("signons", PR_TRUE);
  si_unlock_signon_list();
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3006 of file singsign.cpp.

                       {
  if (!si_reject_list) {
    return 0;
  }
  return si_reject_list->Count();
}

Here is the caller graph for this function:

nsresult SINGSIGN_RejectEnumerate ( PRInt32  rejectNumber,
char **  host 
)

Definition at line 3015 of file singsign.cpp.

                                        {

  si_Reject *reject;
  reject = NS_STATIC_CAST(si_Reject*, si_reject_list->ElementAt(rejectNumber));
  NS_ASSERTION(reject, "corrupt reject list");

  *host = (char *) nsMemory::Clone
    (reject->passwordRealm, strlen(reject->passwordRealm) + 1);
  NS_ENSURE_ARG_POINTER(host);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void SINGSIGN_RememberSignonData ( nsIPrompt dialog,
nsIURI uri,
nsVoidArray signonData,
nsIDOMWindowInternal window 
)

Definition at line 2321 of file singsign.cpp.

{
  if (!passwordRealm)
    return;      

  nsCAutoString realm, legacyRealm;
  if (!si_ExtractRealm(passwordRealm, realm))
    return;

  if (NS_FAILED(passwordRealm->GetHost(legacyRealm)))
    return;

  if (!realm.IsEmpty()) {
    si_RememberSignonData(dialog, realm.get(), legacyRealm.get(), signonData, window);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 994 of file singsign.cpp.

                                        {
  si_Reject* reject;
  nsresult rv = NS_ERROR_FAILURE;

  /* step backwards through all rejects */
  si_lock_signon_list();
  PRInt32 rejectCount = LIST_COUNT(si_reject_list);
  while (rejectCount>0) {
    rejectCount--;
    reject = NS_STATIC_CAST(si_Reject*, si_reject_list->ElementAt(rejectCount));
    if (reject && !PL_strcmp(reject->passwordRealm, host)) {
      si_FreeReject(reject);
      si_signon_list_changed = PR_TRUE;
      rv = NS_OK;
    }
  }
  si_SaveSignonDataLocked("rejects", PR_FALSE);
  si_unlock_signon_list();
  return rv;
}

Here is the call graph for this function:

nsresult SINGSIGN_RemoveUser ( const char *  passwordRealm,
const PRUnichar userName,
PRBool  notify 
)

Definition at line 979 of file singsign.cpp.

Here is the call graph for this function:

nsresult SINGSIGN_RemoveUserAfterLoginFailure ( const char *  passwordRealm,
const PRUnichar userName,
PRBool  notify 
)

Definition at line 985 of file singsign.cpp.

Here is the call graph for this function:

void SINGSIGN_RestoreSignonData ( nsIPrompt dialog,
nsIURI passwordRealm,
const PRUnichar name,
PRUnichar **  value,
PRUint32  formNumber,
PRUint32  elementNumber 
)

Definition at line 2452 of file singsign.cpp.

                                                                                                                                                            {
  LOG(("enter SINGSIGN_RestoreSignonData\n"));

  if (!passwordRealm)
    return;  

  nsCAutoString realm;
  if (!si_ExtractRealm(passwordRealm, realm))
    return;

  nsCAutoString legacyRealm;
  if (NS_FAILED(passwordRealm->GetHost(legacyRealm)))
    return;

  si_RestoreSignonData(dialog, realm.get(), legacyRealm.get(), name, value, formNumber, elementNumber);

  LOG(("exit SINGSIGN_RestoreSignonData [value=%s]\n",
      *value ? NS_LossyConvertUCS2toASCII(*value).get() : "(null)"));
}

Here is the call graph for this function:

PRBool SINGSIGN_StorePassword ( const char *  passwordRealm,
const PRUnichar userName,
const PRUnichar password 
)

Definition at line 2545 of file singsign.cpp.

{
//  Wallet_GiveCaveat(nsnull, dialog); ??? what value to use for dialog?
  si_RememberSignonDataFromBrowser(passwordRealm, nsDependentString(user), nsDependentString(password));
  return PR_TRUE;
}

Here is the call graph for this function:

Definition at line 2915 of file singsign.cpp.

                                 {
  if (!si_signon_list) {
    return 0;
  }

  si_SignonURLStruct *hostStruct;
  hostStruct = NS_STATIC_CAST(si_SignonURLStruct*, si_signon_list->ElementAt(host));
  return hostStruct->signonUser_list.Count();
}

Here is the caller graph for this function: