/// <summary>
/// Shows the reset success.
/// </summary>
private void ShowResetSuccess()
{
RockContext rockContext = new RockContext();
UserLoginService userLoginService = new UserLoginService( rockContext );
UserLogin user = userLoginService.GetByConfirmationCode( this.ConfirmationCode );
if ( user != null )
{
string caption = GetAttributeValue( "PasswordResetCaption" );
if ( caption.Contains( "{1}" ) )
{
caption = string.Format( caption, user.Person.FirstName, user.UserName );
}
else if ( caption.Contains( "{0}" ) )
{
caption = string.Format( caption, user.Person.FirstName );
}
lResetSuccess.Text = caption;
userLoginService.SetPassword( user, tbPassword.Text );
user.IsConfirmed = true;
rockContext.SaveChanges();
pnlResetSuccess.Visible = true;
}
else
{
ShowCode();
}
}