Merge branch 'U4-11166' of https://github.com/jamescoxhead/Umbraco-CMS into jamescoxhead-U4-11166
This commit is contained in:
@@ -219,6 +219,7 @@ namespace Umbraco.Web.Editors
|
||||
// so to do that here, we'll need to check if this current user is an admin and if not we should exclude all user who are
|
||||
// also admins
|
||||
|
||||
var hideDisabledUsers = UmbracoConfig.For.UmbracoSettings().Security.HideDisabledUsersInBackoffice;
|
||||
var excludeUserGroups = new string[0];
|
||||
var isAdmin = Security.CurrentUser.IsAdmin();
|
||||
if (isAdmin == false)
|
||||
@@ -241,10 +242,18 @@ namespace Umbraco.Web.Editors
|
||||
filterQuery.Where(x => x.Name.Contains(filter) || x.Username.Contains(filter));
|
||||
}
|
||||
|
||||
if (hideDisabledUsers)
|
||||
{
|
||||
if (userStates == null || userStates.Any() == false)
|
||||
{
|
||||
userStates = new[] { UserState.Active, UserState.Invited, UserState.LockedOut, UserState.Inactive };
|
||||
}
|
||||
}
|
||||
|
||||
long pageIndex = pageNumber - 1;
|
||||
long total;
|
||||
var result = Services.UserService.GetAll(pageIndex, pageSize, out total, orderBy, orderDirection, userStates, userGroups, excludeUserGroups, filterQuery);
|
||||
|
||||
|
||||
var paged = new PagedUserResult(total, pageNumber, pageSize)
|
||||
{
|
||||
Items = Mapper.Map<IEnumerable<UserBasic>>(result),
|
||||
|
||||
Reference in New Issue
Block a user