Skip to content

Commit b228c78

Browse files
ChrisKianbrianchandotcom
authored andcommitted
LPS-193886 Apply same logic as added in LPS-189689 so new user setup urls can be used properly
1 parent 2ff72d1 commit b228c78

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

portal-impl/src/com/liferay/portal/service/impl/UserLocalServiceImpl.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6231,7 +6231,9 @@ else if (!user.isActive()) {
62316231
return true;
62326232
}
62336233

6234-
protected void notifyUser(User user, ServiceContext serviceContext) {
6234+
protected void notifyUser(User user, ServiceContext serviceContext)
6235+
throws PortalException {
6236+
62356237
if (!PrefsPropsUtil.getBoolean(
62366238
user.getCompanyId(),
62376239
PropsKeys.ADMIN_EMAIL_USER_ADDED_ENABLED)) {
@@ -6264,10 +6266,6 @@ protected void notifyUser(User user, ServiceContext serviceContext) {
62646266
PropsKeys.ADMIN_EMAIL_USER_ADDED_NO_PASSWORD_BODY);
62656267
}
62666268
else {
6267-
Ticket ticket = _ticketLocalService.addDistinctTicket(
6268-
user.getCompanyId(), User.class.getName(), user.getUserId(),
6269-
TicketConstants.TYPE_PASSWORD, null, null, serviceContext);
6270-
62716269
String updatePasswordURL = "/portal/update_password?";
62726270

62736271
long plid = serviceContext.getPlid();
@@ -6285,9 +6283,18 @@ protected void notifyUser(User user, ServiceContext serviceContext) {
62856283
}
62866284
}
62876285

6286+
Ticket ticket = _ticketLocalService.addDistinctTicket(
6287+
user.getCompanyId(), User.class.getName(), user.getUserId(),
6288+
TicketConstants.TYPE_PASSWORD, null, null, serviceContext);
6289+
62886290
passwordResetURL = StringBundler.concat(
62896291
serviceContext.getPortalURL(), serviceContext.getPathMain(),
6290-
updatePasswordURL, "ticketKey=", ticket.getKey());
6292+
updatePasswordURL, "ticketId=", ticket.getTicketId(),
6293+
"&ticketKey=", ticket.getKey());
6294+
6295+
ticket.setKey(PasswordEncryptorUtil.encrypt(ticket.getKey()));
6296+
6297+
_ticketLocalService.updateTicket(ticket);
62916298

62926299
localizedBodyMap = LocalizationUtil.getLocalizationMap(
62936300
companyPortletPreferences,

0 commit comments

Comments
 (0)