protected override IConfigurable PrepareDataObject() { PopSubscriptionProxy popSubscriptionProxy = (PopSubscriptionProxy)base.PrepareDataObject(); if (this.Force == false) { AggregationSubscriptionDataProvider aggregationSubscriptionDataProvider = (AggregationSubscriptionDataProvider)base.DataSession; if (base.Mailbox == null) { ADObjectId adobjectId; if (!base.TryGetExecutingUserId(out adobjectId)) { throw new ExecutingUserPropertyNotFoundException("executingUserid"); } } else { ADObjectId internalADObjectId = base.Mailbox.InternalADObjectId; } LocalizedException exception; if (!Pop3AutoProvision.ValidatePopSettings(popSubscriptionProxy.LeaveOnServer, popSubscriptionProxy.AggregationType == AggregationType.Mirrored, popSubscriptionProxy.IncomingServer, popSubscriptionProxy.IncomingPort, popSubscriptionProxy.IncomingUserName, this.password, popSubscriptionProxy.IncomingAuthentication, popSubscriptionProxy.IncomingSecurity, aggregationSubscriptionDataProvider.UserLegacyDN, CommonLoggingHelper.SyncLogSession, out exception)) { base.WriteDebugInfoAndError(exception, ErrorCategory.InvalidArgument, this.DataObject); } } popSubscriptionProxy.SetPassword(this.password); base.WriteDebugInfo(); return(popSubscriptionProxy); }
protected override void ValidateWithDataObject(IConfigurable dataObject) { base.ValidateWithDataObject(dataObject); PopSubscriptionProxy popSubscriptionProxy = (PopSubscriptionProxy)dataObject; AuthenticationMechanism authenticationMechanism = base.Fields.IsModified("IncomingAuth") ? this.IncomingAuth : popSubscriptionProxy.IncomingAuthentication; SecureString password = this.password ?? popSubscriptionProxy.Subscription.LogonPasswordSecured; string text = base.Fields.IsModified("IncomingUserName") ? base.IncomingUserName : popSubscriptionProxy.IncomingUserName; AggregationTaskUtils.ValidateUserName(text, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError)); if (authenticationMechanism == AuthenticationMechanism.Basic) { AggregationTaskUtils.ValidateUnicodeInfoOnUserNameAndPassword(text, password, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError)); } string text2 = base.Fields.IsModified("IncomingServer") ? base.IncomingServer : popSubscriptionProxy.IncomingServer; AggregationTaskUtils.ValidateIncomingServerLength(text2, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError)); if (!base.ShouldSkipAccountValidation()) { bool leaveOnServer = base.Fields.IsModified("LeaveOnServer") ? this.LeaveOnServer : popSubscriptionProxy.LeaveOnServer; int port = base.Fields.IsModified("IncomingPort") ? base.IncomingPort : popSubscriptionProxy.IncomingPort; SecurityMechanism security = base.Fields.IsModified("IncomingSecurity") ? this.IncomingSecurity : popSubscriptionProxy.IncomingSecurity; LocalizedException exception; if (!Pop3AutoProvision.ValidatePopSettings(leaveOnServer, popSubscriptionProxy.AggregationType == AggregationType.Mirrored, text2, port, text, password, authenticationMechanism, security, popSubscriptionProxy.Subscription.UserLegacyDN, CommonLoggingHelper.SyncLogSession, out exception)) { base.WriteDebugInfoAndError(exception, (ErrorCategory)1003, dataObject); } } }