Пример #1
0
		public ResetUserPasswordResponse ResetUserPassword(ResetUserPasswordRequest request)
		{
			Platform.CheckForNullReference(request, "request");
			Platform.CheckMemberIsSet(request.UserName, "UserName");

			var user = FindUserByName(request.UserName);
			EnsureCurrentUserAuthorizedToManage(user.AccountType);

			if (user.AccountType != UserAccountType.U)
				throw new RequestValidationException(SR.MessageAccountTypeDoesNotSupportPasswordReset);


			var settings = new AuthenticationSettings();
			user.ResetPassword(settings.DefaultTemporaryPassword);

			var assembler = new UserAssembler();
			return new ResetUserPasswordResponse(assembler.GetUserSummary(user));
		}
Пример #2
0
		public ResetUserPasswordResponse ResetUserPassword(ResetUserPasswordRequest request)
		{
			Platform.CheckForNullReference(request, "request");
			Platform.CheckMemberIsSet(request.UserName, "UserName");

			var user = FindUserByName(request.UserName);

			var settings = new AuthenticationSettings();
			user.ResetPassword(settings.DefaultTemporaryPassword);

			var assembler = new UserAssembler();
			return new ResetUserPasswordResponse(assembler.GetUserSummary(user));
		}