Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow superusers login using email #3677

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#region Usings

using System;
using System.Linq;
using System.Web;
using Microsoft.Extensions.DependencyInjection;
using DotNetNuke.Abstractions;
Expand Down Expand Up @@ -259,7 +260,12 @@ private void OnLoginClick(object sender, EventArgs e)
if (emailUsedAsUsername)
{
// one additonal call to db to see if an account with that email actually exists
userByEmail = UserController.GetUserByEmail(PortalController.GetEffectivePortalId(PortalId), userName);
int totalRecords = 0;
var effectivePortalId = PortalController.GetEffectivePortalId(PortalId);
userByEmail = UserController
.GetUsersByEmail(Null.NullInteger, userName, Null.NullInteger, Null.NullInteger, ref totalRecords)
.Cast<UserInfo>()
.FirstOrDefault(user => user.IsSuperUser || user.PortalID == effectivePortalId);

if (userByEmail != null)
{
Expand Down