/// <summary>
        /// Creates a new Password Reset Ticket for the specified user.
        /// </summary>
        public static void RequestTicket(User user)
        {
            var service = new PasswordResetService(user);

            using (var scope = Database.CreateTransactionScope())
            {
                service.CreateTicket();
                service.SendEmail();
                scope.Complete();
            }
        }
        public static void Impersonate(User user)
        {
            if (user == null)
                throw new ArgumentNullException("user");


            if (OriginalAdministrator == null)
            {
                OriginalAdministrator = AppContext.User;
            }

            user.LogOn();

            HttpContext.Current.Session["Context.OriginalUrl"] = HttpContext.Current.Request.RawUrl;
            HttpContext.Current.Response.Redirect("~/");
        }
 PasswordResetService(User user)
 {
     this.User = user;
 }
 /// <summary>
 /// Sends an email to the specified user using this template and the merge data provided.
 /// </summary>
 public void Send(User toUser, object mergeData, Action<EmailQueueItem> customise = null)
 {
     Send(new[] { toUser }, mergeData, customise);
 }