From a0dec90f6a5d409dbcc340b5e099ad558f3d18b0 Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Mon, 13 Apr 2026 14:58:21 -0700 Subject: [PATCH 1/2] RE1-T113 Set pw on first login --- Core/Resgrid.Model/DepartmentMember.cs | 7 +++++++ Core/Resgrid.Services/DepartmentsService.cs | 2 +- Core/Resgrid.Services/UsersService.cs | 2 +- .../M0064_AddingMustChangePassword.cs | 19 ++++++++++++++++++ .../M0064_AddingMustChangePasswordPg.cs | 19 ++++++++++++++++++ .../User/Controllers/PersonnelController.cs | 10 ++++++++++ .../User/Controllers/ProfileController.cs | 7 +++++++ .../Areas/User/Models/AddPersonModel.cs | 2 ++ .../Profile/ResetPasswordForUserView.cs | 2 ++ .../User/Views/Personnel/AddPerson.cshtml | 11 ++++++++++ .../Views/Profile/ResetPasswordForUser.cshtml | 10 ++++++++++ .../Controllers/AccountController.cs | 20 ++++++++++++++++++- 12 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 Providers/Resgrid.Providers.Migrations/Migrations/M0064_AddingMustChangePassword.cs create mode 100644 Providers/Resgrid.Providers.MigrationsPg/Migrations/M0064_AddingMustChangePasswordPg.cs diff --git a/Core/Resgrid.Model/DepartmentMember.cs b/Core/Resgrid.Model/DepartmentMember.cs index 54be279d..de5d7acd 100644 --- a/Core/Resgrid.Model/DepartmentMember.cs +++ b/Core/Resgrid.Model/DepartmentMember.cs @@ -80,6 +80,13 @@ public class DepartmentMember : IEntity /// public DateTime? PasswordLastSetOn { get; set; } + /// + /// When true the user must change their password on next login. + /// Set by admins when creating accounts or resetting passwords. + /// Cleared automatically after the user completes the forced password change. + /// + public bool MustChangePassword { get; set; } + [NotMapped] public string TableName => "DepartmentMembers"; diff --git a/Core/Resgrid.Services/DepartmentsService.cs b/Core/Resgrid.Services/DepartmentsService.cs index 0a776305..7bacf14b 100644 --- a/Core/Resgrid.Services/DepartmentsService.cs +++ b/Core/Resgrid.Services/DepartmentsService.cs @@ -289,7 +289,7 @@ public async Task GetUserIdForDeletedUserInDepartmentAsync(int departmen if (member != null) { member.IsDeleted = true; - var savedMember = _departmentMembersRepository.SaveOrUpdateAsync(member, cancellationToken); + await _departmentMembersRepository.SaveOrUpdateAsync(member, cancellationToken); var member2 = await _departmentMembersRepository.GetDepartmentMemberByDepartmentIdAndUserIdAsync(departmentId, userIdToDelete); diff --git a/Core/Resgrid.Services/UsersService.cs b/Core/Resgrid.Services/UsersService.cs index 5cfc46b8..45a37ec4 100644 --- a/Core/Resgrid.Services/UsersService.cs +++ b/Core/Resgrid.Services/UsersService.cs @@ -97,7 +97,7 @@ public async Task DoesUserHaveAnyActiveDepartments(string userName) var user = await GetUserByNameAsync(userName); var memberships = await _departmentMembersRepository.GetAllByUserIdAsync(user.UserId); - return memberships.Any(x => x.IsDeleted == false); + return memberships.Any(x => x.IsDeleted == false && (x.IsDisabled == null || x.IsDisabled == false)); } public IdentityUser GetUserById(string userId, bool bypassCache = true) diff --git a/Providers/Resgrid.Providers.Migrations/Migrations/M0064_AddingMustChangePassword.cs b/Providers/Resgrid.Providers.Migrations/Migrations/M0064_AddingMustChangePassword.cs new file mode 100644 index 00000000..29872aaa --- /dev/null +++ b/Providers/Resgrid.Providers.Migrations/Migrations/M0064_AddingMustChangePassword.cs @@ -0,0 +1,19 @@ +using FluentMigrator; + +namespace Resgrid.Providers.Migrations.Migrations +{ + [Migration(64)] + public class M0064_AddingMustChangePassword : Migration + { + public override void Up() + { + Alter.Table("DepartmentMembers") + .AddColumn("MustChangePassword").AsBoolean().NotNullable().WithDefaultValue(false); + } + + public override void Down() + { + Delete.Column("MustChangePassword").FromTable("DepartmentMembers"); + } + } +} diff --git a/Providers/Resgrid.Providers.MigrationsPg/Migrations/M0064_AddingMustChangePasswordPg.cs b/Providers/Resgrid.Providers.MigrationsPg/Migrations/M0064_AddingMustChangePasswordPg.cs new file mode 100644 index 00000000..6f27a770 --- /dev/null +++ b/Providers/Resgrid.Providers.MigrationsPg/Migrations/M0064_AddingMustChangePasswordPg.cs @@ -0,0 +1,19 @@ +using FluentMigrator; + +namespace Resgrid.Providers.MigrationsPg.Migrations +{ + [Migration(64)] + public class M0064_AddingMustChangePasswordPg : Migration + { + public override void Up() + { + Alter.Table("DepartmentMembers".ToLower()) + .AddColumn("MustChangePassword".ToLower()).AsBoolean().NotNullable().WithDefaultValue(false); + } + + public override void Down() + { + Delete.Column("MustChangePassword".ToLower()).FromTable("DepartmentMembers".ToLower()); + } + } +} diff --git a/Web/Resgrid.Web/Areas/User/Controllers/PersonnelController.cs b/Web/Resgrid.Web/Areas/User/Controllers/PersonnelController.cs index a8dd69b4..75072b84 100644 --- a/Web/Resgrid.Web/Areas/User/Controllers/PersonnelController.cs +++ b/Web/Resgrid.Web/Areas/User/Controllers/PersonnelController.cs @@ -547,6 +547,16 @@ public async Task AddPerson(AddPersonModel model, IFormCollection await _departmentsService.AddUserToDepartmentAsync(DepartmentId, user.UserId, false, cancellationToken); + if (model.MustChangePasswordOnLogin) + { + var member = await _departmentsService.GetDepartmentMemberAsync(user.UserId, DepartmentId); + if (member != null) + { + member.MustChangePassword = true; + await _departmentsService.SaveDepartmentMemberAsync(member, cancellationToken); + } + } + var userObject = _usersService.GetUserById(user.UserId); _eventAggregator.SendMessage(new UserCreatedEvent() { DepartmentId = DepartmentId, Name = string.Format("{0} {1}", model.FirstName, model.LastName), User = userObject }); diff --git a/Web/Resgrid.Web/Areas/User/Controllers/ProfileController.cs b/Web/Resgrid.Web/Areas/User/Controllers/ProfileController.cs index 3cfbae4b..1e76d238 100644 --- a/Web/Resgrid.Web/Areas/User/Controllers/ProfileController.cs +++ b/Web/Resgrid.Web/Areas/User/Controllers/ProfileController.cs @@ -1000,6 +1000,13 @@ public async Task ResetPasswordForUser(ResetPasswordForUserView { await _departmentSsoService.RecordPasswordChangedAsync(DepartmentId, model.UserId); + var member = await _departmentsService.GetDepartmentMemberAsync(model.UserId, DepartmentId); + if (member != null) + { + member.MustChangePassword = model.MustChangePasswordOnLogin; + await _departmentsService.SaveDepartmentMemberAsync(member); + } + if (model.EmailUser) await _emailService.SendPasswordResetEmail(model.Email, model.Name, user.UserName, model.Password, userDepartment.Name); diff --git a/Web/Resgrid.Web/Areas/User/Models/AddPersonModel.cs b/Web/Resgrid.Web/Areas/User/Models/AddPersonModel.cs index 94782c81..77940d95 100644 --- a/Web/Resgrid.Web/Areas/User/Models/AddPersonModel.cs +++ b/Web/Resgrid.Web/Areas/User/Models/AddPersonModel.cs @@ -63,5 +63,7 @@ public class AddPersonModel: BaseUserModel public string ConfirmPassword { get; set; } public bool SendAccountCreationNotification { get; set; } + + public bool MustChangePasswordOnLogin { get; set; } } } diff --git a/Web/Resgrid.Web/Areas/User/Models/Profile/ResetPasswordForUserView.cs b/Web/Resgrid.Web/Areas/User/Models/Profile/ResetPasswordForUserView.cs index 7a5e351d..8512907e 100644 --- a/Web/Resgrid.Web/Areas/User/Models/Profile/ResetPasswordForUserView.cs +++ b/Web/Resgrid.Web/Areas/User/Models/Profile/ResetPasswordForUserView.cs @@ -25,5 +25,7 @@ public class ResetPasswordForUserView [Display(Name = "Confirm password")] [System.ComponentModel.DataAnnotations.Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } + + public bool MustChangePasswordOnLogin { get; set; } } } diff --git a/Web/Resgrid.Web/Areas/User/Views/Personnel/AddPerson.cshtml b/Web/Resgrid.Web/Areas/User/Views/Personnel/AddPerson.cshtml index 1b701089..517b402a 100644 --- a/Web/Resgrid.Web/Areas/User/Views/Personnel/AddPerson.cshtml +++ b/Web/Resgrid.Web/Areas/User/Views/Personnel/AddPerson.cshtml @@ -185,6 +185,17 @@ +
+ +
+
+ + +
+

User will be required to change their password on first login.

+
+
+ @if (!string.IsNullOrEmpty(Model.UdfFormHtml)) {
diff --git a/Web/Resgrid.Web/Areas/User/Views/Profile/ResetPasswordForUser.cshtml b/Web/Resgrid.Web/Areas/User/Views/Profile/ResetPasswordForUser.cshtml index ad0f9abb..4266886b 100644 --- a/Web/Resgrid.Web/Areas/User/Views/Profile/ResetPasswordForUser.cshtml +++ b/Web/Resgrid.Web/Areas/User/Views/Profile/ResetPasswordForUser.cshtml @@ -96,6 +96,16 @@ @localizer["EmailUserInfo"] +
+ +
+
+ + +
+ User will be required to change their password on next login. +
+
diff --git a/Web/Resgrid.Web/Controllers/AccountController.cs b/Web/Resgrid.Web/Controllers/AccountController.cs index 90502739..f5d33f6e 100644 --- a/Web/Resgrid.Web/Controllers/AccountController.cs +++ b/Web/Resgrid.Web/Controllers/AccountController.cs @@ -163,10 +163,19 @@ await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, var department = await _departmentsService.GetDepartmentForUserAsync(model.Username); if (department != null) { + var member = await _departmentsService.GetDepartmentMemberAsync(identityUser.Id, department.DepartmentId); + + // Check if admin flagged this user to change password on next login + if (member != null && member.MustChangePassword) + { + HttpContext.Session.SetString("ForcePasswordChangeUserId", identityUser.Id); + HttpContext.Session.SetString("ForcePasswordChangeDeptId", department.DepartmentId.ToString()); + return RedirectToAction(nameof(ForcePasswordChange)); + } + var policy = await _departmentSsoService.GetSecurityPolicyForDepartmentAsync(department.DepartmentId, cancellationToken); if (policy != null && policy.PasswordExpirationDays > 0) { - var member = await _departmentsService.GetDepartmentMemberAsync(identityUser.Id, department.DepartmentId); if (_departmentSsoService.IsPasswordExpired(policy, member?.PasswordLastSetOn)) { HttpContext.Session.SetString("ForcePasswordChangeUserId", identityUser.Id); @@ -554,6 +563,15 @@ public async Task ForcePasswordChange(ForcePasswordChangeViewMode // Record the password change and clear the forced-change session flags await _departmentSsoService.RecordPasswordChangedAsync(deptId, userId, cancellationToken); + + // Clear the must-change-password flag if it was set by an admin + var member = await _departmentsService.GetDepartmentMemberAsync(userId, deptId); + if (member != null && member.MustChangePassword) + { + member.MustChangePassword = false; + await _departmentsService.SaveDepartmentMemberAsync(member, cancellationToken); + } + HttpContext.Session.Remove("ForcePasswordChangeUserId"); HttpContext.Session.Remove("ForcePasswordChangeDeptId"); From d414d3fe645450aa1c407cde6323e35295d7a0b9 Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Mon, 13 Apr 2026 15:37:36 -0700 Subject: [PATCH 2/2] RE1-T113 PR#330 fixes --- .../Areas/User/Personnel/Person.ar.resx | 6 ++++++ .../Areas/User/Personnel/Person.de.resx | 6 ++++++ .../Areas/User/Personnel/Person.en.resx | 6 ++++++ .../Areas/User/Personnel/Person.es.resx | 6 ++++++ .../Areas/User/Personnel/Person.fr.resx | 6 ++++++ .../Areas/User/Personnel/Person.it.resx | 6 ++++++ .../Areas/User/Personnel/Person.pl.resx | 6 ++++++ .../Areas/User/Personnel/Person.sv.resx | 6 ++++++ .../Areas/User/Personnel/Person.uk.resx | 6 ++++++ .../Resgrid.Localization/Areas/User/Profile/Profile.ar.resx | 6 ++++++ .../Resgrid.Localization/Areas/User/Profile/Profile.de.resx | 6 ++++++ .../Resgrid.Localization/Areas/User/Profile/Profile.en.resx | 6 ++++++ .../Resgrid.Localization/Areas/User/Profile/Profile.es.resx | 6 ++++++ .../Resgrid.Localization/Areas/User/Profile/Profile.fr.resx | 6 ++++++ .../Resgrid.Localization/Areas/User/Profile/Profile.it.resx | 6 ++++++ .../Resgrid.Localization/Areas/User/Profile/Profile.pl.resx | 6 ++++++ .../Resgrid.Localization/Areas/User/Profile/Profile.sv.resx | 6 ++++++ .../Resgrid.Localization/Areas/User/Profile/Profile.uk.resx | 6 ++++++ Core/Resgrid.Model/DepartmentMember.cs | 1 + Web/Resgrid.Web/Areas/User/Controllers/ProfileController.cs | 1 + Web/Resgrid.Web/Areas/User/Views/Personnel/AddPerson.cshtml | 4 ++-- .../Areas/User/Views/Profile/ResetPasswordForUser.cshtml | 6 +++--- 22 files changed, 115 insertions(+), 5 deletions(-) diff --git a/Core/Resgrid.Localization/Areas/User/Personnel/Person.ar.resx b/Core/Resgrid.Localization/Areas/User/Personnel/Person.ar.resx index f3ff66a1..10608ac9 100644 --- a/Core/Resgrid.Localization/Areas/User/Personnel/Person.ar.resx +++ b/Core/Resgrid.Localization/Areas/User/Personnel/Person.ar.resx @@ -53,6 +53,12 @@ خيارات الإشعارات إشعار المستخدم؟ أزل التحديد إذا كنت لا تريد من Resgrid إشعار المستخدم بإنشاء هذا الحساب. + + Require Password Change + + + User will be required to change their password on first login. + لا يوجد أفراد غير منتمين لمجموعة الأفراد أرقام الهاتف diff --git a/Core/Resgrid.Localization/Areas/User/Personnel/Person.de.resx b/Core/Resgrid.Localization/Areas/User/Personnel/Person.de.resx index d78eb9c4..a2803f32 100644 --- a/Core/Resgrid.Localization/Areas/User/Personnel/Person.de.resx +++ b/Core/Resgrid.Localization/Areas/User/Personnel/Person.de.resx @@ -212,6 +212,12 @@ Uncheck if you don't want Resgrid to notify the user of this account creation. + + Passwortaenderung erforderlich + + + Der Benutzer muss sein Passwort bei der ersten Anmeldung aendern. + No UnGrouped Personnel diff --git a/Core/Resgrid.Localization/Areas/User/Personnel/Person.en.resx b/Core/Resgrid.Localization/Areas/User/Personnel/Person.en.resx index 304e92d7..178d202c 100644 --- a/Core/Resgrid.Localization/Areas/User/Personnel/Person.en.resx +++ b/Core/Resgrid.Localization/Areas/User/Personnel/Person.en.resx @@ -261,6 +261,12 @@ Uncheck if you don't want Resgrid to notify the user of this account creation. + + Require Password Change + + + User will be required to change their password on first login. + No UnGrouped Personnel diff --git a/Core/Resgrid.Localization/Areas/User/Personnel/Person.es.resx b/Core/Resgrid.Localization/Areas/User/Personnel/Person.es.resx index a473ca2f..52664dbe 100644 --- a/Core/Resgrid.Localization/Areas/User/Personnel/Person.es.resx +++ b/Core/Resgrid.Localization/Areas/User/Personnel/Person.es.resx @@ -261,6 +261,12 @@ Desmarque si no desea que Resgrid notifique al usuario sobre la creación de esta cuenta. + + Requerir cambio de contrasena + + + El usuario debera cambiar su contrasena en el primer inicio de sesion. + Sin Personal Desagrupado diff --git a/Core/Resgrid.Localization/Areas/User/Personnel/Person.fr.resx b/Core/Resgrid.Localization/Areas/User/Personnel/Person.fr.resx index bc24ae37..c6245232 100644 --- a/Core/Resgrid.Localization/Areas/User/Personnel/Person.fr.resx +++ b/Core/Resgrid.Localization/Areas/User/Personnel/Person.fr.resx @@ -212,6 +212,12 @@ Uncheck if you don't want Resgrid to notify the user of this account creation. + + Exiger le changement de mot de passe + + + L'utilisateur devra changer son mot de passe lors de la premiere connexion. + No UnGrouped Personnel diff --git a/Core/Resgrid.Localization/Areas/User/Personnel/Person.it.resx b/Core/Resgrid.Localization/Areas/User/Personnel/Person.it.resx index b7415213..b51354b6 100644 --- a/Core/Resgrid.Localization/Areas/User/Personnel/Person.it.resx +++ b/Core/Resgrid.Localization/Areas/User/Personnel/Person.it.resx @@ -212,6 +212,12 @@ Uncheck if you don't want Resgrid to notify the user of this account creation. + + Richiedi cambio password + + + L'utente dovra cambiare la password al primo accesso. + No UnGrouped Personnel diff --git a/Core/Resgrid.Localization/Areas/User/Personnel/Person.pl.resx b/Core/Resgrid.Localization/Areas/User/Personnel/Person.pl.resx index 04f5f4bd..24752a99 100644 --- a/Core/Resgrid.Localization/Areas/User/Personnel/Person.pl.resx +++ b/Core/Resgrid.Localization/Areas/User/Personnel/Person.pl.resx @@ -212,6 +212,12 @@ Uncheck if you don't want Resgrid to notify the user of this account creation. + + Wymagaj zmiany hasla + + + Uzytkownik bedzie musial zmienic haslo przy pierwszym logowaniu. + No UnGrouped Personnel diff --git a/Core/Resgrid.Localization/Areas/User/Personnel/Person.sv.resx b/Core/Resgrid.Localization/Areas/User/Personnel/Person.sv.resx index c2ab1eee..a401e221 100644 --- a/Core/Resgrid.Localization/Areas/User/Personnel/Person.sv.resx +++ b/Core/Resgrid.Localization/Areas/User/Personnel/Person.sv.resx @@ -212,6 +212,12 @@ Uncheck if you don't want Resgrid to notify the user of this account creation. + + Krav pa losenordsbyte + + + Anvandaren maste byta losenord vid forsta inloggningen. + No UnGrouped Personnel diff --git a/Core/Resgrid.Localization/Areas/User/Personnel/Person.uk.resx b/Core/Resgrid.Localization/Areas/User/Personnel/Person.uk.resx index 35aca75b..5ba3deca 100644 --- a/Core/Resgrid.Localization/Areas/User/Personnel/Person.uk.resx +++ b/Core/Resgrid.Localization/Areas/User/Personnel/Person.uk.resx @@ -212,6 +212,12 @@ Uncheck if you don't want Resgrid to notify the user of this account creation. + + Vymahaty zminu parolya + + + Korystuvach povynen zminyty parol pid chas pershoho vkhodu. + No UnGrouped Personnel diff --git a/Core/Resgrid.Localization/Areas/User/Profile/Profile.ar.resx b/Core/Resgrid.Localization/Areas/User/Profile/Profile.ar.resx index e9e00622..fe0e8005 100644 --- a/Core/Resgrid.Localization/Areas/User/Profile/Profile.ar.resx +++ b/Core/Resgrid.Localization/Areas/User/Profile/Profile.ar.resx @@ -31,6 +31,12 @@ تعديل جدول التأمين إرسال بريد إلكتروني للمستخدم؟ حدد هذا المربع إذا أردت إرسال بريد إلكتروني للمستخدم يحتوي على اسم المستخدم وكلمة المرور الجديدة. + + Require Password Change + + + User will be required to change their password on next login. + تنتهي في تنتهي في صادرة عن diff --git a/Core/Resgrid.Localization/Areas/User/Profile/Profile.de.resx b/Core/Resgrid.Localization/Areas/User/Profile/Profile.de.resx index 776ab3f7..7f94abfa 100644 --- a/Core/Resgrid.Localization/Areas/User/Profile/Profile.de.resx +++ b/Core/Resgrid.Localization/Areas/User/Profile/Profile.de.resx @@ -146,6 +146,12 @@ Check this box if you want the user Emailed with their UserName and new Password. + + Passwortaenderung erforderlich + + + Der Benutzer muss sein Passwort bei der naechsten Anmeldung aendern. + Expires On diff --git a/Core/Resgrid.Localization/Areas/User/Profile/Profile.en.resx b/Core/Resgrid.Localization/Areas/User/Profile/Profile.en.resx index dc2fe0fd..abfa0243 100644 --- a/Core/Resgrid.Localization/Areas/User/Profile/Profile.en.resx +++ b/Core/Resgrid.Localization/Areas/User/Profile/Profile.en.resx @@ -195,6 +195,12 @@ Check this box if you want the user Emailed with their UserName and new Password. + + Require Password Change + + + User will be required to change their password on next login. + Expires On diff --git a/Core/Resgrid.Localization/Areas/User/Profile/Profile.es.resx b/Core/Resgrid.Localization/Areas/User/Profile/Profile.es.resx index 853222fa..84912ace 100644 --- a/Core/Resgrid.Localization/Areas/User/Profile/Profile.es.resx +++ b/Core/Resgrid.Localization/Areas/User/Profile/Profile.es.resx @@ -195,6 +195,12 @@ Marque esta casilla si desea que el usuario envíe un correo electrónico con su nombre de usuario y su nueva contraseña. + + Requerir cambio de contrasena + + + El usuario debera cambiar su contrasena en el proximo inicio de sesion. + Expira el diff --git a/Core/Resgrid.Localization/Areas/User/Profile/Profile.fr.resx b/Core/Resgrid.Localization/Areas/User/Profile/Profile.fr.resx index 93362f83..7fdb8114 100644 --- a/Core/Resgrid.Localization/Areas/User/Profile/Profile.fr.resx +++ b/Core/Resgrid.Localization/Areas/User/Profile/Profile.fr.resx @@ -146,6 +146,12 @@ Check this box if you want the user Emailed with their UserName and new Password. + + Exiger le changement de mot de passe + + + L'utilisateur devra changer son mot de passe lors de la prochaine connexion. + Expires On diff --git a/Core/Resgrid.Localization/Areas/User/Profile/Profile.it.resx b/Core/Resgrid.Localization/Areas/User/Profile/Profile.it.resx index ee07ef64..eb28f28c 100644 --- a/Core/Resgrid.Localization/Areas/User/Profile/Profile.it.resx +++ b/Core/Resgrid.Localization/Areas/User/Profile/Profile.it.resx @@ -146,6 +146,12 @@ Check this box if you want the user Emailed with their UserName and new Password. + + Richiedi cambio password + + + L'utente dovra cambiare la password al prossimo accesso. + Expires On diff --git a/Core/Resgrid.Localization/Areas/User/Profile/Profile.pl.resx b/Core/Resgrid.Localization/Areas/User/Profile/Profile.pl.resx index b18f5d34..855a18f3 100644 --- a/Core/Resgrid.Localization/Areas/User/Profile/Profile.pl.resx +++ b/Core/Resgrid.Localization/Areas/User/Profile/Profile.pl.resx @@ -146,6 +146,12 @@ Check this box if you want the user Emailed with their UserName and new Password. + + Wymagaj zmiany hasla + + + Uzytkownik bedzie musial zmienic haslo przy nastepnym logowaniu. + Expires On diff --git a/Core/Resgrid.Localization/Areas/User/Profile/Profile.sv.resx b/Core/Resgrid.Localization/Areas/User/Profile/Profile.sv.resx index c5ba35a7..dac7aafe 100644 --- a/Core/Resgrid.Localization/Areas/User/Profile/Profile.sv.resx +++ b/Core/Resgrid.Localization/Areas/User/Profile/Profile.sv.resx @@ -146,6 +146,12 @@ Check this box if you want the user Emailed with their UserName and new Password. + + Krav pa losenordsbyte + + + Anvandaren maste byta losenord vid naesta inloggning. + Expires On diff --git a/Core/Resgrid.Localization/Areas/User/Profile/Profile.uk.resx b/Core/Resgrid.Localization/Areas/User/Profile/Profile.uk.resx index 39bb0c89..a58e1207 100644 --- a/Core/Resgrid.Localization/Areas/User/Profile/Profile.uk.resx +++ b/Core/Resgrid.Localization/Areas/User/Profile/Profile.uk.resx @@ -146,6 +146,12 @@ Check this box if you want the user Emailed with their UserName and new Password. + + Vymahaty zminu parolya + + + Korystuvach povynen zminyty parol pid chas nastupnoho vkhodu. + Expires On diff --git a/Core/Resgrid.Model/DepartmentMember.cs b/Core/Resgrid.Model/DepartmentMember.cs index de5d7acd..6af608f8 100644 --- a/Core/Resgrid.Model/DepartmentMember.cs +++ b/Core/Resgrid.Model/DepartmentMember.cs @@ -85,6 +85,7 @@ public class DepartmentMember : IEntity /// Set by admins when creating accounts or resetting passwords. /// Cleared automatically after the user completes the forced password change. /// + [ProtoMember(13)] public bool MustChangePassword { get; set; } [NotMapped] diff --git a/Web/Resgrid.Web/Areas/User/Controllers/ProfileController.cs b/Web/Resgrid.Web/Areas/User/Controllers/ProfileController.cs index 1e76d238..5b117fbc 100644 --- a/Web/Resgrid.Web/Areas/User/Controllers/ProfileController.cs +++ b/Web/Resgrid.Web/Areas/User/Controllers/ProfileController.cs @@ -962,6 +962,7 @@ public async Task ResetPasswordForUser(string userId) model.Email = user.Email; model.Username = user.UserName; model.MinPasswordLength = await _departmentSsoService.GetEffectiveMinPasswordLengthAsync(DepartmentId); + model.MustChangePasswordOnLogin = true; return View(model); } diff --git a/Web/Resgrid.Web/Areas/User/Views/Personnel/AddPerson.cshtml b/Web/Resgrid.Web/Areas/User/Views/Personnel/AddPerson.cshtml index 517b402a..36a239a7 100644 --- a/Web/Resgrid.Web/Areas/User/Views/Personnel/AddPerson.cshtml +++ b/Web/Resgrid.Web/Areas/User/Views/Personnel/AddPerson.cshtml @@ -186,13 +186,13 @@
- +
-

User will be required to change their password on first login.

+

@localizer["RequirePasswordChangeHelp"]

diff --git a/Web/Resgrid.Web/Areas/User/Views/Profile/ResetPasswordForUser.cshtml b/Web/Resgrid.Web/Areas/User/Views/Profile/ResetPasswordForUser.cshtml index 4266886b..58a94f22 100644 --- a/Web/Resgrid.Web/Areas/User/Views/Profile/ResetPasswordForUser.cshtml +++ b/Web/Resgrid.Web/Areas/User/Views/Profile/ResetPasswordForUser.cshtml @@ -97,13 +97,13 @@
- +
- +
- User will be required to change their password on next login. + @localizer["RequirePasswordChangeHelp"]