private string GetPasswordWithFormat(string username, out int passwordFormat, out int status, out string passwordSalt, out bool userIsApproved)
{
ArrayList fields = new ArrayList();
fields.Add("PasswordFormat");
fields.Add("Password");
fields.Add("PasswordSalt");
fields.Add("isActive");
_dops.ResetDops();
_dops.Sproc = "usp_getPasswordByUser";
//Using Email as the username
_dops.SetParameter("@Email", username, "IN");
ArrayList results = new ArrayList();
//default values
passwordFormat = 0;
passwordSalt = string.Empty;
userIsApproved = false;
status = 1;
try
{
results = _dops.get_arrayList(fields);
}
catch (SqlException)
{
return string.Empty;
}
//If there is no password returned, then the user is not valid
if (results.Count == 0)
{
status = 1; //user not found
return string.Empty;
}
ArrayList resultsFirstRow = (ArrayList)results[0];
passwordFormat = (int)resultsFirstRow[0];
passwordSalt = (string)resultsFirstRow[2];
userIsApproved = (bool)resultsFirstRow[3];
status = 0;
return (string)resultsFirstRow[1];
}