Last active
December 11, 2016 22:38
-
-
Save BenGGolden/bb2ef7795240ad1958b911f587d45d86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SetPasswordSaveAction : UserBaseAction | |
{ | |
private ID _formId; | |
public override void Execute(ID formId, AdaptedResultList adaptedFields, ActionCallContext actionCallContext = null, | |
params object[] data) | |
{ | |
_formId = formId; | |
var password = adaptedFields.GetEntry(PasswordField, "Password")?.Value ?? string.Empty; | |
var userName = Tracker.Current?.Session.Contact.Identifiers.Identifier; | |
var user = Membership.GetUser(userName); | |
if (user == null) return; | |
var tempPass = user.ResetPassword(); | |
user.ChangePassword(tempPass, password); | |
} | |
public override FormItem CurrentForm => FormItem.GetForm(_formId); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment