fix #5349 - send verification email if unverified user attempts to login, add ability to enable/disable email verification per site

This commit is contained in:
sbwalker
2025-07-29 16:20:07 -04:00
parent 658059806b
commit f4cea3fe03
13 changed files with 101 additions and 45 deletions

View File

@ -165,14 +165,13 @@ namespace Oqtane.Controllers
bool allowregistration;
if (_userPermissions.IsAuthorized(User, user.SiteId, EntityNames.User, -1, PermissionNames.Write, RoleNames.Admin))
{
user.EmailConfirmed = true;
user.IsAuthenticated = true;
user.IsAuthenticated = true; // admins can add any existing user to a site
allowregistration = true;
}
else
{
user.EmailConfirmed = false;
user.IsAuthenticated = false;
user.EmailConfirmed = false; // standard users cannot specify that their email is verified
user.IsAuthenticated = false; // existing users can only be added to a site if they provide a valid username and password
allowregistration = _sites.GetSite(user.SiteId).AllowRegistration;
}