17 Mar 2008
13 Mar 2009
Link to this post
We have a business requirement to default newly registered users to expire after 30 days. The administrators should be able to then extend this through the administration system as required.
We've got half-way (OK, maybe a quarter) of the way there. Within the profile settings in web.config, we've added an ExpiryDate of type DateTime. This is appearing correctly on the User admin screen and is getting stored in the database in the UserMetaData table.
In the <sec:ManageProfile> section of the CreateUserWizard page, we've added an ExpiryDate textbox but we don't want this to be editable and it should automatically be set to 30 days from today - any value entered here is correctly going in to the database, but we want to force a certain value.
That's question 1!
Question 2 is, once we have that correctly going in to the UserMetaData table, how do we configure the login check to include this as part of the authentication process and return an 'Account expired' error if today is greater than the value in that table?
Thanks in advance