diff --git a/src/Umbraco.Core/Models/Membership/UserState.cs b/src/Umbraco.Core/Models/Membership/UserState.cs index 5f6ee1615a..fc277b4fa3 100644 --- a/src/Umbraco.Core/Models/Membership/UserState.cs +++ b/src/Umbraco.Core/Models/Membership/UserState.cs @@ -9,6 +9,7 @@ Active = 0, Disabled = 1, LockedOut = 2, - Invited = 3 + Invited = 3, + Inactive = 4 } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs b/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs index 5701cd1008..fb3f7b56ee 100644 --- a/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/UserRepository.cs @@ -186,6 +186,8 @@ UNION SELECT '4CountOfLockedOut' AS colName, COUNT(id) AS num FROM umbracoUser WHERE userNoConsole = 1 UNION SELECT '5CountOfInvited' AS colName, COUNT(id) AS num FROM umbracoUser WHERE lastLoginDate IS NULL AND userDisabled = 1 AND invitedDate IS NOT NULL +UNION +SELECT '6CountOfDisabled' AS colName, COUNT(id) AS num FROM umbracoUser WHERE userDisabled = 0 AND userNoConsole = 0 AND lastLoginDate IS NULL ORDER BY colName"; var result = Database.Fetch(sql); @@ -196,7 +198,8 @@ ORDER BY colName"; {UserState.Active, (int)result[1].num}, {UserState.Disabled, (int)result[2].num}, {UserState.LockedOut, (int)result[3].num}, - {UserState.Invited, (int)result[4].num} + {UserState.Invited, (int)result[4].num}, + {UserState.Inactive, (int) result[5].num} }; } @@ -765,6 +768,12 @@ ORDER BY colName"; sb.Append("(userDisabled = 0 AND userNoConsole = 0 AND lastLoginDate IS NOT NULL)"); appended = true; } + if (userState.Contains(UserState.Inactive)) + { + if (appended) sb.Append(" OR "); + sb.Append("(userDisabled = 0 AND userNoConsole = 0 AND lastLoginDate IS NULL)"); + appended = true; + } if (userState.Contains(UserState.Disabled)) { if (appended) sb.Append(" OR "); @@ -915,4 +924,4 @@ ORDER BY colName"; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web.UI.Client/src/common/services/usershelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/usershelper.service.js index 21fe84ff8d..6e20ce91ac 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/usershelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/usershelper.service.js @@ -8,7 +8,8 @@ { "value": 0, "name": "Active", "key": "Active", "color": "success" }, { "value": 1, "name": "Disabled", "key": "Disabled", "color": "danger" }, { "value": 2, "name": "Locked out", "key": "LockedOut", "color": "danger" }, - { "value": 3, "name": "Invited", "key": "Invited", "color": "warning" } + { "value": 3, "name": "Invited", "key": "Invited", "color": "warning" }, + { "value": 4, "name": "Inactive", "key": "Inactive", "color": "warning" } ]; angular.forEach(userStates, function (userState) { diff --git a/src/Umbraco.Web/Editors/UsersController.cs b/src/Umbraco.Web/Editors/UsersController.cs index 89b1f8b238..6df1733509 100644 --- a/src/Umbraco.Web/Editors/UsersController.cs +++ b/src/Umbraco.Web/Editors/UsersController.cs @@ -246,7 +246,7 @@ namespace Umbraco.Web.Editors { if (userStates == null || userStates.Any() == false) { - userStates = new[] { UserState.Active, UserState.Invited, UserState.LockedOut }; + userStates = new[] { UserState.Active, UserState.Invited, UserState.LockedOut, UserState.Inactive }; } }