Ejemplo n.º 1
0
        /// <summary>
        /// Change the user's login name
        /// </summary>
        /// <param name="newUsername">New desired username</param>
        /// <returns>true=success; false=failure</returns>
        public Boolean ChangeUsername(String newUsername)
        {
            String logMethodName = "ChangeUsername(String newUsername) - ";

            _log.Debug(logMethodName + "Begin Method");
            Boolean result = false;

            try
            {
                _log.Debug(logMethodName + "Calling ISecurityAdapter.ChangeUsername(Object membershipId, String currentUsername, String newUsername)");
                result = _adapter.ChangeUsername(_membershipId, _accountData.Username, newUsername);
            }
            catch (SaltADMembershipProvider.DuplicateUserException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                _log.Error(logMethodName + "Error attempting to change username", ex);
                throw new WtfException("Error attempting to change username", ex);
            }

            _log.Debug(logMethodName + "End Method");

            return(result);
        }