kalimuthu
kalimuthu

Reputation: 139

How to manually unlock user with SimpleMembership provider MVC 4.0?

Is there a way to manually unlock a user with the SimpleMembership provider?

   if(WebSecurity.IsAccountLockedOut(model.UserName,4,10000)) {
         return RedirectToAction("LockedAccount");
    }
    websecurity.unlockuser(); -> any functions like this

Within the time limit an admin wants to unlock the user account. Is there any possibilities? Can anyone give the correct suggestions?

Upvotes: 0

Views: 733

Answers (1)

Kevin Junghans
Kevin Junghans

Reputation: 17540

There is not a method in WebSecurity to unlock the account. But you could try using the SimpleMembershipProvider like this.

var membership = (WebMatrix.WebData.SimpleMembershipProvider)Membership.Provider;
membership.UnlockUser(model.UserName);

Upvotes: 1

Related Questions