File tree Expand file tree Collapse file tree 5 files changed +22
-0
lines changed
DigitalLearningSolutions.Data
DataServices/UserDataService
DigitalLearningSolutions.Web
ViewModels/TrackingSystem/Centre/Administrator
Views/TrackingSystem/Centre/Administrator Expand file tree Collapse file tree 5 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ FROM AdminAccounts AS aa
105105 aa.IsSupervisor,
106106 aa.IsTrainer,
107107 aa.CategoryID,
108+ aa.LastAccessed,
108109 CASE
109110 WHEN aa.CategoryID IS NULL THEN 'All'
110111 ELSE cc.CategoryName
Original file line number Diff line number Diff line change 11namespace DigitalLearningSolutions . Data . Models . User
22{
3+ using System ;
4+
35 public class AdminAccount
46 {
57 public int Id { get ; set ; }
@@ -26,6 +28,7 @@ public class AdminAccount
2628 public bool IsWorkforceContributor { get ; set ; }
2729 public bool IsLocalWorkforceManager { get ; set ; }
2830 public bool IsNominatedSupervisor { get ; set ; }
31+ public DateTime ? LastAccessed { get ; set ; }
2932
3033 public bool IsCmsAdministrator => ImportOnly && IsContentManager ;
3134 public bool IsCmsManager => IsContentManager && ! ImportOnly ;
Original file line number Diff line number Diff line change 33 using DigitalLearningSolutions . Data . Helpers ;
44 using DigitalLearningSolutions . Data . Models . Centres ;
55 using DigitalLearningSolutions . Data . Models . SearchSortFilterPaginate ;
6+ using System ;
67
78 public class AdminEntity : BaseSearchableItem
89 {
@@ -72,6 +73,7 @@ public override string SearchableName
7273 public bool IsSuperAdmin => AdminAccount . IsSuperAdmin ;
7374 public bool IsReportsViewer => AdminAccount . IsReportsViewer ;
7475 public bool IsActive => AdminAccount . Active ;
76+ public DateTime ? LastAccessed => AdminAccount . LastAccessed ;
7577
7678 }
7779}
Original file line number Diff line number Diff line change 55 using DigitalLearningSolutions . Data . Models . User ;
66 using DigitalLearningSolutions . Web . Helpers ;
77 using DigitalLearningSolutions . Web . ViewModels . Common . SearchablePage ;
8+ using System ;
9+ using DateHelper = Helpers . DateHelper ;
810
911 public class SearchableAdminViewModel : BaseFilterableViewModel
1012 {
@@ -23,6 +25,10 @@ ReturnPageQuery returnPageQuery
2325 EmailAddress = admin . EmailForCentreNotifications ;
2426 IsLocked = admin . UserAccount . FailedLoginCount >= AuthHelper . FailedLoginThreshold ;
2527 IsActive = admin . AdminAccount . Active ;
28+ if ( admin . LastAccessed . HasValue )
29+ {
30+ LastAccessed = admin . LastAccessed . Value . ToString ( DateHelper . StandardDateFormat ) ;
31+ }
2632 CanShowDeactivateAdminButton =
2733 UserPermissionsHelper . LoggedInAdminCanDeactivateUser ( admin . AdminAccount , loggedInAdminAccount ) ;
2834
@@ -46,6 +52,8 @@ ReturnPageQuery returnPageQuery
4652
4753 public bool IsActive { get ; set ; }
4854
55+ public string ? LastAccessed { get ; set ; }
56+
4957 public ReturnPageQuery ReturnPageQuery { get ; set ; }
5058 }
5159}
Original file line number Diff line number Diff line change 3535 @Model.CategoryName
3636 </dd >
3737 </div >
38+ <div class =" nhsuk-summary-list__row" >
39+ <dt class =" nhsuk-summary-list__key" >
40+ Last accessed
41+ </dt >
42+ <dd class =" nhsuk-summary-list__value" >
43+ @( Model .LastAccessed != null ? Model .LastAccessed : " -" )
44+ </dd >
45+ </div >
3846 </dl >
3947
4048 @if (Model .IsLocked )
You can’t perform that action at this time.
0 commit comments