From f4cea3fe03cd1aea9c19fbedf732eaf9b04ffb98 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Tue, 29 Jul 2025 16:20:07 -0400 Subject: [PATCH] fix #5349 - send verification email if unverified user attempts to login, add ability to enable/disable email verification per site --- Oqtane.Client/Modules/Admin/Login/Index.razor | 12 +--- Oqtane.Client/Modules/Admin/Users/Add.razor | 11 ++++ Oqtane.Client/Modules/Admin/Users/Edit.razor | 2 +- Oqtane.Client/Modules/Admin/Users/Index.razor | 14 ++++- .../Resources/Modules/Admin/Login/Index.resx | 2 +- .../Resources/Modules/Admin/Users/Add.resx | 6 ++ .../Resources/Modules/Admin/Users/Edit.resx | 2 +- .../Resources/Modules/Admin/Users/Index.resx | 8 ++- Oqtane.Server/Controllers/UserController.cs | 7 +-- .../OqtaneServiceCollectionExtensions.cs | 5 +- Oqtane.Server/Managers/UserManager.cs | 63 +++++++++++-------- .../Interfaces/ISettingRepository.cs | 1 + Oqtane.Server/Repository/SettingRepository.cs | 13 ++++ 13 files changed, 101 insertions(+), 45 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/Login/Index.razor b/Oqtane.Client/Modules/Admin/Login/Index.razor index f0a057d0..66562e6c 100644 --- a/Oqtane.Client/Modules/Admin/Login/Index.razor +++ b/Oqtane.Client/Modules/Admin/Login/Index.razor @@ -21,9 +21,7 @@ else @if (_allowexternallogin) { -
- -
+

} @if (_allowsitelogin) { @@ -49,15 +47,11 @@ else -
- -
+

@if (PageState.Site.AllowRegistration) { -
- -
+

@Localizer["Register"] } } diff --git a/Oqtane.Client/Modules/Admin/Users/Add.razor b/Oqtane.Client/Modules/Admin/Users/Add.razor index cb5c7224..e5581222 100644 --- a/Oqtane.Client/Modules/Admin/Users/Add.razor +++ b/Oqtane.Client/Modules/Admin/Users/Add.razor @@ -28,6 +28,15 @@ +
+ +
+ +
+
@@ -120,6 +129,7 @@ private bool _initialized = false; private string _username = string.Empty; private string _email = string.Empty; + private string _confirmed = "True"; private string _displayname = string.Empty; private string _timezoneid = string.Empty; private string _notify = "True"; @@ -169,6 +179,7 @@ user.Username = _username; user.Password = ""; // will be auto generated user.Email = _email; + user.EmailConfirmed = bool.Parse(_confirmed); user.DisplayName = string.IsNullOrWhiteSpace(_displayname) ? _username : _displayname; user.TimeZoneId = _timezoneid; user.PhotoFileId = null; diff --git a/Oqtane.Client/Modules/Admin/Users/Edit.razor b/Oqtane.Client/Modules/Admin/Users/Edit.razor index cc497086..2d75d27a 100644 --- a/Oqtane.Client/Modules/Admin/Users/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Users/Edit.razor @@ -48,7 +48,7 @@
- +
+
+ +
+ +
+
@if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host)) {
- +