コード例 #1
0
        /// <summary>
        ///     This ,ethod is used to authenticate a users login
        /// </summary>
        /// <param name="email"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public AppUser AuthenticateAppUserLogin(string email, string password)
        {
            var hashPassword = new Md5Ecryption().ConvertStringToMd5Hash(password.Trim());
            var user         = new AppUserFactory().GetAppUserByLogin(email, hashPassword);

            return(user);
        }
コード例 #2
0
        /// <summary>
        ///     This method is used to send a forgot password request to fetch the user
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        public AppUser ForgotPasswordRequest(string email)
        {
            email = email.Trim();
            var user        = new AppUserFactory().GetAppUserByEmail(email);
            var appuser     = _db.AppUsers.Find(user.AppUserId);
            var newPassword = Membership.GeneratePassword(8, 1);

            appuser.Password         = newPassword;
            _db.Entry(appuser).State = EntityState.Modified;
            _db.SaveChanges();
            new MailerDaemon().ResetUserPassword(appuser);
            return(user);
        }