/// <summary>
        /// Verifies that the specified user name and password exist in the data source.
        /// </summary>
        /// <returns>
        /// true if the specified username and password are valid; otherwise, false.
        /// </returns>
        /// <param name="username">The name of the user to validate. </param><param name="password">The password for the specified user. </param>
        public override bool ValidateUser(string username, string password)
        {
            var currentuser = (RestaurantUser)GetUser(username, true);

            return(currentuser != null && base.ValidateUser(username, password) &&
                   RestaurantUserRepository.ValidatePasswordWithHash(password, currentuser.Password));
        }
        /// <summary>
        /// Processes a request to update the password for a membership user.
        /// </summary>
        /// <returns>
        /// true if the password was updated successfully; otherwise, false.
        /// </returns>
        /// <param name="username">The user to update the password for. </param><param name="oldPassword">The current password for the specified user. </param><param name="newPassword">The new password for the specified user. </param>
        public override bool ChangePassword(string username, string oldPassword, string newPassword)
        {
            var currentUser = (RestaurantUser)GetUser(username, true /* userIsOnline */);

            if (currentUser == null || oldPassword == null)
            {
                return(false);
            }
            var basesuccess = base.ChangePassword(username, oldPassword, newPassword) &&
                              RestaurantUserRepository.ValidatePasswordWithHash(oldPassword.Trim(), currentUser.Password);

            if (basesuccess)
            {
                currentUser.Password = newPassword;
                basesuccess          = UserRepository.Update(currentUser);
            }
            return(basesuccess);
        }