public string ProcessUser(string encodedUser, string encodedPass) { IMemberShipData msd = null; string token = string.Empty; try { msd = new Data(Utilities.GetDbSetting()); string decodedUser = Utilities.DecodeClientBase64String(encodedUser); string decodedPass = Utilities.DecodeClientBase64String(encodedPass); //LogParameters(); token = VerifyUser(decodedUser, decodedPass, msd); if (!string.IsNullOrEmpty(token)) msd.AddToken(decodedUser, token); } catch (Exception e) { msd.LogMsg("Error: " + e.Message + ", trace: " + e.StackTrace.ToString()); } return token; }
public bool ProcessUserRegistration(string encodedUser, string encodedEmail, string encodedPass) { IMemberShipData msd = null; bool userAdded = false; try { msd = new Data(Utilities.GetDbSetting()); string decodedUser = Utilities.DecodeClientBase64String(encodedUser); string decodedEmail = Utilities.DecodeClientBase64String(encodedEmail); string decodedPass = Utilities.DecodeClientBase64String(encodedPass); //LogParameters(); if (Utilities.ValidUserToRegistration(decodedUser, decodedEmail, decodedPass)) { Password p = new Password(); NewPassword np = p.GetPassword(decodedPass); userAdded = msd.AddUser(decodedUser, decodedEmail, np.SaltedHashedPassword, np.Salt); } } catch (Exception e) { msd.LogMsg("Error: " + e.Message + ", trace: " + e.StackTrace.ToString()); } return userAdded; }
public string LoginDemoUser() { string token = string.Empty; IMemberShipData msd = null; try { msd = new Data(Utilities.GetDbSetting()); token = VerifyUser(AccountDataProvider.Constants.DEMO_USER, AccountDataProvider.Constants.DEMO_USER_PASSWORD, msd); if (!string.IsNullOrEmpty(token)) msd.AddToken(AccountDataProvider.Constants.DEMO_USER, token); } catch (Exception e) { msd.LogMsg("Error: " + e.Message + ", trace: " + e.StackTrace.ToString()); } return token; }