コード例 #1
0
        private AMFUserLogin CreateTestUser(string emailAddress)
        {
            AMFUserLogin retVal = new AMFUserLogin();

            retVal.Email     = emailAddress;
            retVal.FirstName = "Artie";
            retVal.LastName  = "Test";
            retVal.UpdatePassword(TestHashedPassword, TestPasswordSalt);

            return(retVal);
        }
コード例 #2
0
        public static AMFUserLogin GenerateNewUser(int userId, string userName, string hashedPassword, string passwordSalt, int passwordIterations)
        {
            AMFUserLogin retVal = new AMFUserLogin();

            retVal.Id        = userId;
            retVal.Email     = userName;
            retVal.FirstName = string.Empty;
            retVal.LastName  = string.Empty;
            retVal.UpdatePassword(hashedPassword, passwordSalt);

            return(retVal);
        }
コード例 #3
0
        public static AMFUserLogin Create(string userName, string password, string firstName, string lastName, string passwordHint)
        {
            AMFUserLogin retVal = new AMFUserLogin();

            retVal.Email        = userName;
            retVal.FirstName    = firstName;
            retVal.LastName     = lastName;
            retVal.PasswordHint = passwordHint;
            retVal.UpdatePassword(password);
            retVal.DateCreated = DateTime.Now;

            return(retVal);
        }
コード例 #4
0
        /// <summary>
        /// Update the editable fields for a User
        /// </summary>
        /// <param name="userLogin">The source user</param>
        /// <returns>The updated user</returns>
        public AMFUserLogin Update(long userId, string firstName, string lastName, string password)
        {
            AMFUserLogin retVal = this.UserRepository.GetById(userId);

            if (retVal != null)
            {
                retVal.FirstName = firstName;
                retVal.LastName  = lastName;
                retVal.UpdatePassword(password);

                retVal = this.UserRepository.Save(retVal);
            }

            return(retVal);
        }