Backend userlist to display 'activiated' and 'unactiviated' users
Is there a way to differeniate which users are activated successfully with the email reply and which users are just created? Looking for a way to manage this list and have unsuccessful users pop out.
Hi Richard,
Yes, you can differentiate approved from unapproved users. But Sitefinity will not delete unapproved users, so the list keeps growing forever. I'm using the function below to get unapproved users that are older than an x amount of time. The next step is to delete them.
Public Function GetUnapprovedUsers(MinimumAge As TimeSpan) As System.Linq.IQueryable(Of Telerik.Sitefinity.Security.Model.User) Dim ReturnValue As IQueryable(Of Telerik.Sitefinity.Security.Model.User) = Nothing Try Dim UserManager As New Telerik.Sitefinity.Security.UserManager Dim MaxCreateDate As Date ' Calculate the maximum date the users may have created their account. MaxCreateDate = Now.Subtract(MinimumAge) ReturnValue = UserManager.GetUsers.Where(Function(u) (u.IsApproved = False) And (u.CreationDate <= MaxCreateDate)) Catch ex As Exception ReturnValue = Nothing End Try Return ReturnValue End Function