public string GenerateRandomStrongPassword() { var ranStrPwObj = new RandomStrongPassword(); return(ranStrPwObj.GenerateRandomStrongPassword()); }
/// <summary> /// Resets a user's password to a new, automatically generated password. /// </summary> /// <param name="username">The user to reset the password for.</param> /// <param name="answer">The password answer for the specified user.</param> /// <returns>The new password for the specified user.</returns> public override string ResetPassword(string username, string answer) { Guid g = new Guid(username); Customer c = new Customer(g, true); object lockuntil = DateTime.Now.AddMinutes(-1); string newPassword = ""; Password p; if (c.IsAdminUser || c.IsAdminSuperUser) { p = new RandomStrongPassword(); } else { p = new RandomPassword(); } newPassword = p.ClearPassword.Replace("&", "*"); c.UpdateCustomer( /*CustomerLevelID*/ null, /*EMail*/ null, /*SaltedAndHashedPassword*/ p.SaltedPassword, /*SaltKey*/ p.Salt, /*DateOfBirth*/ null, /*Gender*/ null, /*FirstName*/ null, /*LastName*/ null, /*Notes*/ null, /*SkinID*/ null, /*Phone*/ null, /*AffiliateID*/ null, /*Referrer*/ null, /*CouponCode*/ null, /*OkToEmail*/ null, /*IsAdmin*/ null, /*BillingEqualsShipping*/ null, /*LastIPAddress*/ null, /*OrderNotes*/ null, /*SubscriptionExpiresOn*/ null, /*RTShipRequest*/ null, /*RTShipResponse*/ null, /*OrderOptions*/ null, /*LocaleSetting*/ null, /*MicroPayBalance*/ null, /*RecurringShippingMethodID*/ null, /*RecurringShippingMethod*/ null, /*BillingAddressID*/ null, /*ShippingAddressID*/ null, /*GiftRegistryGUID*/ null, /*GiftRegistryIsAnonymous*/ null, /*GiftRegistryAllowSearchByOthers*/ null, /*GiftRegistryNickName*/ null, /*GiftRegistryHideShippingAddresses*/ null, /*CODCompanyCheckAllowed*/ null, /*CODNet30Allowed*/ null, /*ExtensionData*/ null, /*FinalizationData*/ null, /*Deleted*/ null, /*Over13Checked*/ null, /*CurrencySetting*/ null, /*VATSetting*/ null, /*VATRegistrationID*/ null, /*StoreCCInDB*/ null, /*IsRegistered*/ null, /*LockedUntil*/ lockuntil, /*AdminCanViewCC*/ null, /*BadLogin*/ -1, /*Active*/ null, /*PwdChangeRequired*/ 1, /*RegisterDate*/ null, /*StoreId*/ null ); return(newPassword); }