fix issue with updateprofile notice email sending old values instead of new values
This commit is contained in:
parent
0947a44e5a
commit
149985a9f8
1 changed files with 28 additions and 8 deletions
|
@ -45,6 +45,7 @@ import password.pwm.http.PwmRequestAttribute;
|
|||
import password.pwm.http.bean.UpdateProfileBean;
|
||||
import password.pwm.ldap.LdapOperationsHelper;
|
||||
import password.pwm.ldap.UserInfo;
|
||||
import password.pwm.ldap.UserInfoFactory;
|
||||
import password.pwm.svc.stats.Statistic;
|
||||
import password.pwm.svc.token.TokenType;
|
||||
import password.pwm.svc.token.TokenUtil;
|
||||
|
@ -368,28 +369,47 @@ public class UpdateProfileUtil
|
|||
|
||||
LdapOperationsHelper.writeFormValuesToLdap( theUser, formMap, macroMachine, false );
|
||||
|
||||
final UserIdentity userIdentity = userInfo.getUserIdentity();
|
||||
postUpdateActionsAndEmail( pwmApplication, sessionLabel, locale, userInfo.getUserIdentity(), updateProfileProfile );
|
||||
|
||||
// success, so forward to success page
|
||||
pwmApplication.getStatisticsManager().incrementValue( Statistic.UPDATE_ATTRIBUTES );
|
||||
}
|
||||
|
||||
private static void postUpdateActionsAndEmail(
|
||||
final PwmApplication pwmApplication,
|
||||
final SessionLabel sessionLabel,
|
||||
final Locale locale,
|
||||
final UserIdentity userIdentity,
|
||||
final UpdateProfileProfile updateProfileProfile
|
||||
)
|
||||
throws PwmUnrecoverableException, ChaiUnavailableException, PwmOperationalException
|
||||
{
|
||||
// obtain new macro machine (with a new UserInfo) so old cached values won't be used for next op
|
||||
final UserInfo reloadedUserInfo = UserInfoFactory.newUserInfo(
|
||||
pwmApplication,
|
||||
sessionLabel,
|
||||
locale,
|
||||
userIdentity,
|
||||
pwmApplication.getProxiedChaiUser( userIdentity ).getChaiProvider() );
|
||||
final MacroMachine reloadedMacroMachine = MacroMachine.forUser( pwmApplication, sessionLabel, reloadedUserInfo, null, null );
|
||||
|
||||
{
|
||||
// execute configured actions
|
||||
final List<ActionConfiguration> actions = updateProfileProfile.readSettingAsAction( PwmSetting.UPDATE_PROFILE_WRITE_ATTRIBUTES );
|
||||
if ( actions != null && !actions.isEmpty() )
|
||||
{
|
||||
LOGGER.debug( sessionLabel, () -> "executing configured actions to user " + userIdentity );
|
||||
LOGGER.debug( sessionLabel, () -> "executing configured actions to user " + reloadedUserInfo.getUserIdentity() );
|
||||
|
||||
|
||||
final ActionExecutor actionExecutor = new ActionExecutor.ActionExecutorSettings( pwmApplication, userIdentity )
|
||||
final ActionExecutor actionExecutor = new ActionExecutor.ActionExecutorSettings( pwmApplication, reloadedUserInfo.getUserIdentity() )
|
||||
.setExpandPwmMacros( true )
|
||||
.setMacroMachine( macroMachine )
|
||||
.setMacroMachine( reloadedMacroMachine )
|
||||
.createActionExecutor();
|
||||
|
||||
actionExecutor.executeActions( actions, sessionLabel );
|
||||
}
|
||||
}
|
||||
sendProfileUpdateEmailNotice( pwmApplication, macroMachine, userInfo, locale, sessionLabel );
|
||||
|
||||
// success, so forward to success page
|
||||
pwmApplication.getStatisticsManager().incrementValue( Statistic.UPDATE_ATTRIBUTES );
|
||||
sendProfileUpdateEmailNotice( pwmApplication, reloadedMacroMachine, reloadedUserInfo, locale, sessionLabel );
|
||||
}
|
||||
|
||||
static TokenDestinationItem tokenDestinationItemForCurrentValidation(
|
||||
|
|
Loading…
Reference in a new issue