Skip to content

Commit

Permalink
Merge pull request #5567 from johnhenley/issues/5245
Browse files Browse the repository at this point in the history
  • Loading branch information
bdukes committed Apr 25, 2023
2 parents 834dfb2 + f211a21 commit edabf5d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
7 changes: 7 additions & 0 deletions DNN Platform/Library/Services/Mail/Mail.cs
Expand Up @@ -193,6 +193,13 @@ public static string SendMail(int portalId, int userId, MessageType msgType, Por
subject = "EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_SUBJECT";
body = "EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_BODY";
break;
case MessageType.PasswordReminderUserIsNotApprovedAdmin:
subject = "EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_ADMINISTRATOR_SUBJECT";
body = "EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_ADMINISTRATOR_BODY";
toUser = settings.AdministratorId;
admin = UserController.GetUserById(settings.PortalId, settings.AdministratorId);
locale = admin.Profile.PreferredLocale;
break;
case MessageType.UserAuthorized:
subject = "EMAIL_USER_AUTHORIZED_SUBJECT";
body = "EMAIL_USER_AUTHORIZED_BODY";
Expand Down
1 change: 1 addition & 0 deletions DNN Platform/Library/Services/Mail/MessageType.cs
Expand Up @@ -18,5 +18,6 @@ public enum MessageType
PasswordReminderUserIsNotApproved = 9,
UserAuthorized = 10,
UserUnAuthorized = 11,
PasswordReminderUserIsNotApprovedAdmin = 12,
}
}
17 changes: 14 additions & 3 deletions DNN Platform/Website/App_GlobalResources/GlobalResources.resx
Expand Up @@ -1361,9 +1361,8 @@ Sincerely,
<data name="EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_BODY.Text" xml:space="preserve">
<value>Dear [User:DisplayName],

You have requested a Password Reset Token from [Portal:PortalName], but Your account is pending approval.

Password can be reset after account is approved.
You have requested a Password Reset Token from [Portal:PortalName], but your account is pending approval.
The administrator for [Portal:PortalName] has been notified for review and will issue another password reset email if your account is approved.

Sincerely,
[Portal:PortalName]
Expand All @@ -1374,6 +1373,18 @@ Sincerely,
<data name="EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_SUBJECT.Text" xml:space="preserve">
<value>[Portal:PortalName] Password Reminder</value>
</data>
<data name="EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_ADMINISTRATOR_BODY.Text" xml:space="preserve">
<value>
The following user has requested a Password Reset Token from [Portal:PortalName], but the user account is pending approval.
User Name: [User:UserName]
Display Name: [User:DisplayName]

After reviewing this user, if the account is authorized, resend the user a password reset email.
</value>
</data>
<data name="EMAIL_PASSWORD_REMINDER_USER_ISNOT_APPROVED_ADMINISTRATOR_SUBJECT.Text" xml:space="preserve">
<value>[Portal:PortalName] Password Reminder requested for unapproved User [User:Username]</value>
</data>
<data name="503.Error" xml:space="preserve">
<value>{0} - 503 Service Unavailable</value>
</data>
Expand Down
1 change: 1 addition & 0 deletions DNN Platform/Website/admin/Security/SendPassword.ascx.cs
Expand Up @@ -243,6 +243,7 @@ protected void OnSendPasswordClick(object sender, EventArgs e)
if (this.user.Membership.Approved == false)
{
Mail.SendMail(this.user, MessageType.PasswordReminderUserIsNotApproved, this.PortalSettings);
Mail.SendMail(this.user, MessageType.PasswordReminderUserIsNotApprovedAdmin, this.PortalSettings);
canSend = false;
}

Expand Down

0 comments on commit edabf5d

Please sign in to comment.