// Token: 0x06000B7A RID: 2938 RVA: 0x0004A418 File Offset: 0x00048618
        private static bool InternalCheckForAutomaticBooking(bool isEventForConfigObject, MailboxSession itemStore, CachedState cachedState)
        {
            cachedState.LockForRead();
            CalendarConfiguration calendarConfiguration;

            try
            {
                calendarConfiguration = (cachedState.State[0] as CalendarConfiguration);
                if (calendarConfiguration == null || isEventForConfigObject)
                {
                    LockCookie lockCookie = cachedState.UpgradeToWriterLock();
                    try
                    {
                        using (CalendarConfigurationDataProvider calendarConfigurationDataProvider = new CalendarConfigurationDataProvider(itemStore))
                        {
                            calendarConfiguration = (CalendarConfiguration)calendarConfigurationDataProvider.Read <CalendarConfiguration>(null);
                            if (calendarConfiguration == null)
                            {
                                Globals.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_CorruptCalendarConfiguration, null, new object[]
                                {
                                    itemStore.MailboxOwner.LegacyDn
                                });
                                calendarConfigurationDataProvider.Delete(new CalendarConfiguration());
                                calendarConfiguration = new CalendarConfiguration();
                            }
                        }
                        if (calendarConfiguration.AutomateProcessing == CalendarProcessingFlags.AutoAccept)
                        {
                            calendarConfiguration.AddNewRequestsTentatively = true;
                        }
                        cachedState.State[0] = calendarConfiguration;
                        ResourceCheck.Tracer.TraceDebug((long)itemStore.GetHashCode(), "{0}: The calendar settings object was new or has been changed - (re)reading contents.", new object[]
                        {
                            TraceContext.Get()
                        });
                    }
                    catch (ObjectNotFoundException innerException)
                    {
                        ResourceCheck.Tracer.TraceError((long)itemStore.GetHashCode(), "{0}: The calendar configuration was deleted while we were looking at it. Back off and retry.", new object[]
                        {
                            TraceContext.Get()
                        });
                        throw new TransientMailboxException(innerException);
                    }
                    finally
                    {
                        cachedState.DowngradeFromWriterLock(ref lockCookie);
                    }
                }
            }
            finally
            {
                cachedState.ReleaseReaderLock();
            }
            ResourceCheck.Tracer.TraceDebug <object, CalendarProcessingFlags>((long)itemStore.GetHashCode(), "{0}: MailboxType {1}", TraceContext.Get(), calendarConfiguration.AutomateProcessing);
            ResourceCheck.TracerPfd.TracePfd <int, object, CalendarProcessingFlags>((long)itemStore.GetHashCode(), "PFD IWR {0} {1}: ResourceMailbox: {2}", 19223, TraceContext.Get(), calendarConfiguration.AutomateProcessing);
            return(calendarConfiguration.AutomateProcessing == CalendarProcessingFlags.AutoAccept);
        }
Exemple #2
0
        private void LoadSettings()
        {
            moduleId = WebUtils.ParseInt32FromQueryString("mid", -1);
            itemId   = WebUtils.ParseInt32FromQueryString("ItemID", -1);

            moduleSettings = ModuleSettings.GetModuleSettings(moduleId);
            GmapApiKey     = SiteUtils.GetGmapApiKey();
            config         = new CalendarConfiguration(ModuleSettings.GetModuleSettings(moduleId));

            AddClassToBody("eventcaldetail");
        }
 internal bool CommitChanges(MailboxSession mailboxSession)
 {
     if (mailboxSession == null)
     {
         throw new ArgumentNullException("mailboxSession");
     }
     try
     {
         using (CalendarConfigurationDataProvider calendarConfigurationDataProvider = new CalendarConfigurationDataProvider(mailboxSession))
         {
             CalendarConfiguration calendarConfiguration = (CalendarConfiguration)calendarConfigurationDataProvider.Read <CalendarConfiguration>(null);
             if (calendarConfiguration == null)
             {
                 string message = string.Format("Unable to load Calendar configuration object for mailbox {0}", mailboxSession.MailboxOwner.LegacyDn);
                 ExTraceGlobals.CalendarCallTracer.TraceDebug(0L, message);
                 calendarConfigurationDataProvider.Delete(new CalendarConfiguration());
                 calendarConfiguration = (CalendarConfiguration)calendarConfigurationDataProvider.Read <CalendarConfiguration>(null);
                 if (calendarConfiguration == null)
                 {
                     message = string.Format("Unable to re-create Calendar configuration object for mailbox {0}", mailboxSession.MailboxOwner.LegacyDn);
                     ExTraceGlobals.CalendarCallTracer.TraceDebug(0L, message);
                     return(false);
                 }
             }
             calendarConfiguration.AddNewRequestsTentatively           = this.addNewRequestsTentatively;
             calendarConfiguration.RemoveOldMeetingMessages            = this.removeOldMeetingMessages;
             calendarConfiguration.RemoveForwardedMeetingNotifications = this.removeForwardedMeetingNotifications;
             calendarConfiguration.DefaultReminderTime            = this.defaultReminderTime;
             calendarConfiguration.ProcessExternalMeetingMessages = this.processExternalMeetingMessages;
             calendarConfigurationDataProvider.Save(calendarConfiguration);
         }
     }
     catch (ObjectExistedException ex)
     {
         string message2 = string.Format("Unable to load Calendar configuration object for mailbox. Exception {0}", ex.Message);
         ExTraceGlobals.CalendarCallTracer.TraceDebug(0L, message2);
         return(false);
     }
     catch (StoragePermanentException ex2)
     {
         string message3 = string.Format("Unable to load Calendar configuration object for mailbox. Exception {0}", ex2.Message);
         ExTraceGlobals.CalendarCallTracer.TraceDebug(0L, message3);
         return(false);
     }
     catch (StorageTransientException ex3)
     {
         string message4 = string.Format("Unable to load Calendar configuration object for mailbox. Exception {0}", ex3.Message);
         ExTraceGlobals.CalendarCallTracer.TraceDebug(0L, message4);
         return(false);
     }
     return(true);
 }
Exemple #4
0
        public GraphApiService(IAuthenticationProvider authenticationProvider, IOptions <CalendarConfiguration> calendarConfiguration,
                               IEmployeeDataProvider employeeDataProvider, ILogger <GraphApiService> logger)
        {
            _client               = new GraphServiceClient(authenticationProvider);
            _calendarConfig       = calendarConfiguration.Value;
            _employeeDataProvider = employeeDataProvider;
            _logger               = logger;

            if (_calendarConfig.PostponeWithYears == null)
            {
                _calendarConfig.PostponeWithYears = 0;
            }
        }
        private void LoadParams()
        {
            visibleDateParam = "visdate" + this.ModuleId.ToString();
            visibleDate      = WebUtils.ParseDateFromQueryString(visibleDateParam, DateTime.Now);
            currentDate      = DateTime.Now;

            config = new CalendarConfiguration(Settings);

            if (config.InstanceCssClass.Length > 0)
            {
                pnlOuterWrap.SetOrAppendCss(config.InstanceCssClass);
            }
        }
        public static void GetSDOPostAction(DataRow input, DataTable dataTable, DataObjectStore store)
        {
            DataRow dataRow = dataTable.Rows[0];
            CalendarConfiguration calendarConfiguration = store.GetDataObject("CalendarConfiguration") as CalendarConfiguration;

            if (calendarConfiguration != null)
            {
                dataRow["ResourceDelegates"]      = calendarConfiguration.ResourceDelegates.ResolveRecipientsForSDO(3, (RecipientObjectResolverRow x) => Strings.DisplayedResourceDelegates(x.DisplayName, x.PrimarySmtpAddress));
                dataRow["AutomateProcessingAuto"] = (calendarConfiguration.AutomateProcessing == CalendarProcessingFlags.AutoAccept && calendarConfiguration.AllBookInPolicy && !calendarConfiguration.AllRequestInPolicy);
            }
            RecipientTypeDetails recipientTypeDetails = (RecipientTypeDetails)dataRow["RecipientTypeDetails"];

            dataRow["IsRoom"] = (recipientTypeDetails == RecipientTypeDetails.RoomMailbox);
        }
        internal override CalendarProcessingFlags?GetCalendarConfig()
        {
            CalendarConfiguration calendarConfiguration = null;

            using (CalendarConfigurationDataProvider calendarConfigurationDataProvider = new CalendarConfigurationDataProvider(this.session))
            {
                calendarConfiguration = (CalendarConfiguration)calendarConfigurationDataProvider.Read <CalendarConfiguration>(null);
            }
            if (calendarConfiguration == null)
            {
                Globals.ConsistencyChecksTracer.TraceWarning(0L, "Could not load the attendee's calendar configuration data. Skipping mailbox.");
                return(null);
            }
            return(new CalendarProcessingFlags?(calendarConfiguration.AutomateProcessing));
        }
        public static void GetObjectPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            MailboxPropertiesHelper.GetCountryOrRegion(inputRow, dataTable, store);
            MailboxPropertiesHelper.GetEmailAddresses(inputRow, dataTable, store);
            DataRow dataRow = dataTable.Rows[0];
            CalendarConfiguration calendarConfiguration = store.GetDataObject("CalendarConfiguration") as CalendarConfiguration;

            if (calendarConfiguration != null)
            {
                bool flag  = calendarConfiguration.AutomateProcessing == CalendarProcessingFlags.AutoAccept;
                bool flag2 = flag && !calendarConfiguration.AllBookInPolicy && calendarConfiguration.AllRequestInPolicy;
                bool flag3 = flag && calendarConfiguration.AllBookInPolicy && !calendarConfiguration.AllRequestInPolicy;
                dataRow["AutomateProcessingManual"]     = flag2;
                dataRow["AutomateProcessingAuto"]       = flag3;
                dataRow["AutomateProcessingCustomized"] = (!flag2 && !flag3);
                dataRow["AdditionalResponse"]           = (calendarConfiguration.AddAdditionalResponse ? calendarConfiguration.AdditionalResponse : string.Empty);
            }
            MailboxPropertiesHelper.UpdateCanSetABP(dataRow, store);
        }
        private void ConfigureCalendar()
        {
            MailboxCalendarConfiguration mailboxCalendarConfiguration = new MailboxCalendarConfiguration
            {
                Principal            = this.MailboxPrincipal,
                RemindersEnabled     = false,
                ReminderSoundEnabled = false
            };

            mailboxCalendarConfiguration.Save(this.mailboxStoreTypeProvider);
            this.TraceDebug("Save settings to disable calendar reminder", new object[0]);
            using (CalendarConfigurationDataProvider calendarConfigurationDataProvider = new CalendarConfigurationDataProvider(this.mailboxSession))
            {
                CalendarConfiguration instance = new CalendarConfiguration
                {
                    MailboxOwnerId = this.group.Id,
                    RemoveForwardedMeetingNotifications = true,
                    RemoveOldMeetingMessages            = true
                };
                calendarConfigurationDataProvider.Save(instance);
                this.TraceDebug("Save settings to disable calendar forward notification.", new object[0]);
            }
        }
Exemple #10
0
 // Token: 0x0600078F RID: 1935 RVA: 0x0003566A File Offset: 0x0003386A
 public void ProcessMeetingMessage(MailboxSession itemStore, MeetingMessage mtgMessage, ref CalendarItemBase originalCalItem, CalendarConfiguration mailboxConfig, IEnumerable <VersionedId> duplicates, bool performOmd)
 {
     this.ProcessMeetingMessage(itemStore, mtgMessage, ref originalCalItem, mailboxConfig, duplicates, performOmd, this.honorProcessingConfiguration);
 }
 // Token: 0x0600256A RID: 9578 RVA: 0x000D89B9 File Offset: 0x000D6BB9
 internal ResourceOptionsRecipientWell(CalendarConfiguration resourceConfig)
 {
     this.calendarConfig = resourceConfig;
 }
        // Token: 0x06000BCD RID: 3021 RVA: 0x0004DDF0 File Offset: 0x0004BFF0
        public static BookingRoles QueryRole(IRecipientSession rs, ADRecipient recipient, CalendarConfiguration mailboxConfig, out bool reqInPolicy, out bool bookInPolicy)
        {
            BookingRoles bookingRoles = BookingRoles.NoRole;

            reqInPolicy  = false;
            bookInPolicy = false;
            BookingPolicy.Tracer.TraceDebug((long)((recipient != null) ? recipient.GetHashCode() : 0), "{0}: Evaluating RequestInPolicy", new object[]
            {
                TraceContext.Get()
            });
            if (mailboxConfig.AllRequestInPolicy || BookingPolicy.InRole(rs, recipient, mailboxConfig.RequestInPolicy, mailboxConfig.RequestInPolicyLegacy))
            {
                bookingRoles = BookingRoles.RequestInPolicy;
                reqInPolicy  = true;
            }
            BookingPolicy.Tracer.TraceDebug((long)((recipient != null) ? recipient.GetHashCode() : 0), "{0}: Evaluating BookInPolicy", new object[]
            {
                TraceContext.Get()
            });
            if (mailboxConfig.AllBookInPolicy || BookingPolicy.InRole(rs, recipient, mailboxConfig.BookInPolicy, mailboxConfig.BookInPolicyLegacy))
            {
                bookingRoles = BookingRoles.BookInPolicy;
                bookInPolicy = true;
            }
            BookingPolicy.Tracer.TraceDebug((long)((recipient != null) ? recipient.GetHashCode() : 0), "{0}: Evaluating RequestOutOfPolicy", new object[]
            {
                TraceContext.Get()
            });
            if (mailboxConfig.AllRequestOutOfPolicy || BookingPolicy.InRole(rs, recipient, mailboxConfig.RequestOutOfPolicy, mailboxConfig.RequestOutOfPolicyLegacy))
            {
                bookingRoles = BookingRoles.RequestOutOfPolicy;
            }
            if (bookingRoles == BookingRoles.NoRole)
            {
                BookingPolicy.Tracer.TraceDebug((long)((recipient != null) ? recipient.GetHashCode() : 0), "{0}: No Role", new object[]
                {
                    TraceContext.Get()
                });
            }
            return(bookingRoles);
        }
Exemple #13
0
 public CalendarWorkflowConfiguration(CalendarConfiguration calendarConfiguration) : base(calendarConfiguration)
 {
     this.CalendarConfiguration = calendarConfiguration;
 }
        // Token: 0x060007AC RID: 1964 RVA: 0x00036880 File Offset: 0x00034A80
        public void PerformCleanUp(MailboxSession itemStore, StoreObject item, CalendarConfiguration mailboxConfig, CalendarItemBase originalCalItem, IEnumerable <VersionedId> duplicates)
        {
            bool flag = false;

            if (mailboxConfig.RemoveOldMeetingMessages && !(item is MeetingForwardNotification))
            {
                this.DeleteOldMessages(itemStore, (MeetingMessage)item, originalCalItem, out flag);
            }
            if (item is MeetingMessage)
            {
                bool           flag2          = false;
                MeetingMessage meetingMessage = (MeetingMessage)item;
                if (meetingMessage.IsRepairUpdateMessage)
                {
                    flag2 = (!flag || (!(meetingMessage is MeetingRequest) && !(meetingMessage is MeetingCancellation)));
                    if (flag2)
                    {
                        meetingMessage.MarkAsOutOfDate();
                        meetingMessage.IsRead = true;
                        try
                        {
                            int num = 3;
                            ConflictResolutionResult saveResults;
                            do
                            {
                                saveResults = meetingMessage.Save(SaveMode.ResolveConflicts);
                                meetingMessage.Load();
                                num--;
                            }while (num > 0 && !CalendarProcessing.CheckSaveResults(meetingMessage, saveResults, meetingMessage.InternetMessageId));
                        }
                        catch (ObjectNotFoundException arg)
                        {
                            flag2 = false;
                            OldMessageDeletion.Tracer.TraceWarning <object, ObjectNotFoundException>((long)this.GetHashCode(), "{0}: Tried to mark a RUM as Outdated, which does not exist anymore. Exception: {1}", TraceContext.Get(), arg);
                        }
                    }
                }
                if (!flag2 && item is MeetingForwardNotification)
                {
                    bool   flag3 = itemStore.IsGroupMailbox();
                    string text  = null;
                    flag2 = (mailboxConfig.RemoveForwardedMeetingNotifications || !meetingMessage.IsResponseRequested || flag3);
                    if (!flag2)
                    {
                        Participant participant = null;
                        flag2 = OldMessageDeletion.IsSenderSame(meetingMessage.From, itemStore, out participant);
                        if (participant != null)
                        {
                            text = participant.EmailAddress;
                        }
                    }
                    string text2;
                    if (flag2)
                    {
                        text2 = string.Format("Deleting MFN message as it was forwarded by the organizer. ParticipantFromEmail: {0}, Message From: {1},  From RoutingType: {2},  Mailbox owner : {3}, Mailboxconfig.RemoveMFN setting {4}, IsResponseRequested {5}, Subject: {6}, IsGroupMailbox: {7} ", new object[]
                        {
                            text ?? "unspecified",
                            meetingMessage.From,
                            (meetingMessage.From != null) ? meetingMessage.From.RoutingType : "unspecified",
                            itemStore.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString(),
                            mailboxConfig.RemoveForwardedMeetingNotifications,
                            meetingMessage.IsResponseRequested,
                            meetingMessage.Subject,
                            flag3
                        });
                    }
                    else
                    {
                        text2 = string.Format("Not deleting MFN message as it was forwarded by someone other than the organizer. ParticipantFromEmail {0}, Message From: {1}, From RoutingType: {2},  Mailbox owner : {3}, Mailboxconfig.RemoveMFN setting {4}, IsResponseRequested {5}, Subject: {6} ", new object[]
                        {
                            text ?? "unspecified",
                            meetingMessage.From,
                            (meetingMessage.From != null) ? meetingMessage.From.RoutingType : "unspecified",
                            itemStore.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString(),
                            mailboxConfig.RemoveForwardedMeetingNotifications,
                            meetingMessage.IsResponseRequested,
                            meetingMessage.Subject
                        });
                    }
                    OldMessageDeletion.Tracer.TraceDebug((long)this.GetHashCode(), text2);
                    MfnLog.LogEntry(itemStore, text2);
                }
                if (!flag2 && OldMessageDeletion.IsSelfForwardedEventAndAccepted(meetingMessage, itemStore, originalCalItem))
                {
                    flag2 = true;
                    OldMessageDeletion.Tracer.TraceDebug((long)this.GetHashCode(), "{0}: Marked the meeting request for deletion as sent to self", new object[]
                    {
                        TraceContext.Get()
                    });
                }
                if (flag2)
                {
                    this.DeleteMessage(itemStore, item);
                }
            }
            if (duplicates != null)
            {
                foreach (VersionedId versionedId in duplicates)
                {
                    itemStore.Delete(DeleteItemFlags.MoveToDeletedItems, new StoreId[]
                    {
                        versionedId
                    });
                    OldMessageDeletion.Tracer.TraceDebug <object, VersionedId>((long)this.GetHashCode(), "{0}: Deleted a duplicate item ID: {1}.", TraceContext.Get(), versionedId);
                }
            }
        }
Exemple #15
0
        // Token: 0x06000790 RID: 1936 RVA: 0x00035684 File Offset: 0x00033884
        public void ProcessMeetingMessage(MailboxSession itemStore, MeetingMessage mtgMessage, ref CalendarItemBase originalCalItem, CalendarConfiguration mailboxConfig, IEnumerable <VersionedId> duplicates, bool performOmd, bool honorExternalMeetingMessageProcessingConfig)
        {
            bool isProcessed = mtgMessage.IsProcessed;
            bool flag        = this.PreProcessMessage(itemStore, mtgMessage, isProcessed, mtgMessage.CalendarProcessed);
            bool flag2       = false;

            if (!flag)
            {
                flag2 = CalendarProcessing.IsAutoAcceptanceProcessingRequired(itemStore, mtgMessage, originalCalItem);
            }
            if (flag || flag2)
            {
                int num = mailboxConfig.DefaultReminderTime;
                if (num < 0 || num > 2629800)
                {
                    num = CalendarProcessing.DefaultReminderMinutesBeforeStart;
                }
                int num2 = 3;
                int i    = num2;
                if (this.honorProcessingConfiguration && originalCalItem == null && !mailboxConfig.AddNewRequestsTentatively && !mtgMessage.IsRepairUpdateMessage)
                {
                    CalendarProcessing.ProcessingTracer.TraceDebug((long)mtgMessage.GetHashCode(), "{0}: Skipping processing because user settings for adding new items is false.", new object[]
                    {
                        TraceContext.Get()
                    });
                    return;
                }
                if (honorExternalMeetingMessageProcessingConfig && mtgMessage.SkipMessage(mailboxConfig.ProcessExternalMeetingMessages, originalCalItem))
                {
                    CalendarProcessing.ProcessingTracer.TraceDebug <object, bool>((long)mtgMessage.GetHashCode(), "{0}: Skipping processing because user settings for processing external items is false. IsRepairUpdateMessage: {1}", TraceContext.Get(), mtgMessage.IsRepairUpdateMessage);
                    return;
                }
                while (i > 0)
                {
                    try
                    {
                        if (flag)
                        {
                            if (!this.DoProcessingLogic(itemStore, mtgMessage, ref originalCalItem, num, ref i))
                            {
                                this.TraceDebugAndPfd(mtgMessage.GetHashCode(), string.Format("{0}: completedProcessing = {1}", TraceContext.Get(), false));
                                continue;
                            }
                            flag = false;
                            this.TraceDebugAndPfd(mtgMessage.GetHashCode(), string.Format("{0}: completedProcessing = {1}", TraceContext.Get(), true));
                            flag2 = CalendarProcessing.IsAutoAcceptanceProcessingRequired(itemStore, mtgMessage, originalCalItem);
                        }
                        if (flag2)
                        {
                            CalendarProcessing.AutoAcceptEvents(itemStore, originalCalItem);
                            flag2 = false;
                        }
                        if (!flag && !flag2)
                        {
                            break;
                        }
                    }
                    catch (ObjectExistedException exception)
                    {
                        this.TraceAndLogException(exception, itemStore, mtgMessage, i);
                        i--;
                    }
                    catch (SaveConflictException ex)
                    {
                        this.TraceAndLogException(ex, itemStore, mtgMessage, i);
                        i--;
                        if (originalCalItem != null)
                        {
                            originalCalItem.Dispose();
                            originalCalItem = null;
                        }
                        if (!CalendarAssistant.GetCalendarItem(mtgMessage, CalendarProcessing.UnexpectedPathTracer, ref originalCalItem, duplicates != null, out duplicates))
                        {
                            throw new SkipException(Strings.descSkipExceptionFailedToLoadCalItem, ex);
                        }
                        if (originalCalItem != null)
                        {
                            originalCalItem.OpenAsReadWrite();
                        }
                    }
                    catch (QuotaExceededException exception2)
                    {
                        this.TraceAndLogException(exception2, itemStore, mtgMessage, i);
                        i = -1;
                    }
                    catch (ObjectNotFoundException ex2)
                    {
                        this.TraceAndLogException(ex2, itemStore, mtgMessage, i);
                        throw new SkipException(ex2);
                    }
                    catch (VirusDetectedException exception3)
                    {
                        this.TraceAndLogException(exception3, itemStore, mtgMessage, i);
                        i = -1;
                    }
                    catch (VirusMessageDeletedException exception4)
                    {
                        this.TraceAndLogException(exception4, itemStore, mtgMessage, i);
                        i = -1;
                    }
                    catch (DataValidationException ex3)
                    {
                        this.TraceAndLogException(ex3, itemStore, mtgMessage, i);
                        throw new SkipException(ex3);
                    }
                    catch (RecurrenceException ex4)
                    {
                        this.TraceAndLogException(ex4, itemStore, mtgMessage, i);
                        throw new SkipException(ex4);
                    }
                }
                if (flag && i == 0)
                {
                    string internetMessageId = mtgMessage.InternetMessageId;
                    CalendarProcessing.ProcessingTracer.TraceDebug <object, string>((long)mtgMessage.GetHashCode(), "{0}: Attempting a third time to process message, but without the catch blocks: {1}", TraceContext.Get(), internetMessageId);
                    this.DoProcessingLogic(itemStore, mtgMessage, ref originalCalItem, num, ref i);
                }
            }
            if (ObjectClass.IsMeetingCancellationSeries(mtgMessage.ClassName) || ObjectClass.IsMeetingRequestSeries(mtgMessage.ClassName))
            {
                this.TryUnparkInstanceMessages(itemStore, mtgMessage.GetValueOrDefault <string>(MeetingMessageSchema.SeriesId), mtgMessage.GetValueOrDefault <int>(MeetingMessageSchema.SeriesSequenceNumber));
            }
            if (performOmd)
            {
                this.OldMessageDeletion.PerformCleanUp(itemStore, mtgMessage, mailboxConfig, originalCalItem, duplicates);
            }
        }
 public SchedulingPermissionsConfiguration(CalendarConfiguration calendarConfiguration) : base(calendarConfiguration)
 {
 }
Exemple #17
0
 public ResourceConfigurationBase(CalendarConfiguration calendarConfiguration) : base(calendarConfiguration)
 {
     this.CalendarConfiguration = calendarConfiguration;
 }
Exemple #18
0
		protected override void InternalProcessRecord()
		{
			TaskLogger.LogEnter(new object[]
			{
				this.DataObject
			});
			bool flag = false;
			if (false == this.Force && this.Arbitration)
			{
				TIdentity identity = this.Identity;
				if (!base.ShouldContinue(Strings.SetArbitrationMailboxConfirmationMessage(identity.ToString())))
				{
					TaskLogger.LogExit();
					return;
				}
			}
			if (false == this.Force && this.originalForwardingAddress == null && this.DataObject.ForwardingAddress != null && this.DataObject.ForwardingSmtpAddress != null)
			{
				LocalizedString message = (this.originalForwardingSmtpAddress != null) ? Strings.SetMailboxForwardingAddressConfirmationMessage : Strings.SetBothForwardingAddressConfirmationMessage;
				if (!base.ShouldContinue(message))
				{
					TaskLogger.LogExit();
					return;
				}
			}
			if (this.DataObject.IsModified(MailboxSchema.ForwardingSmtpAddress) && this.DataObject.ForwardingSmtpAddress != null && this.DataObject.ForwardingAddress != null && !base.Fields.IsModified(MailboxSchema.ForwardingAddress))
			{
				this.WriteWarning(Strings.ContactAdminForForwardingWarning);
			}
			if (false == this.Force && this.DataObject.IsModified(ADRecipientSchema.AuditLogAgeLimit))
			{
				EnhancedTimeSpan t;
				if (this.DataObject.MailboxAuditLogAgeLimit == EnhancedTimeSpan.Zero)
				{
					TIdentity identity2 = this.Identity;
					if (!base.ShouldContinue(Strings.ConfirmationMessageSetMailboxAuditLogAgeLimitZero(identity2.ToString())))
					{
						TaskLogger.LogExit();
						return;
					}
				}
				else if (this.DataObject.TryGetOriginalValue<EnhancedTimeSpan>(ADRecipientSchema.AuditLogAgeLimit, out t))
				{
					EnhancedTimeSpan mailboxAuditLogAgeLimit = this.DataObject.MailboxAuditLogAgeLimit;
					if (t > mailboxAuditLogAgeLimit)
					{
						TIdentity identity3 = this.Identity;
						if (!base.ShouldContinue(Strings.ConfirmationMessageSetMailboxAuditLogAgeLimitSmaller(identity3.ToString(), mailboxAuditLogAgeLimit.ToString())))
						{
							TaskLogger.LogExit();
							return;
						}
					}
				}
			}
			bool flag2 = false;
			bool flag3 = false;
			MapiMessageStoreSession mapiMessageStoreSession = null;
			try
			{
				if (this.needChangeMailboxSubtype)
				{
					if (this.originalRecipientTypeDetails == RecipientTypeDetails.UserMailbox)
					{
						MailboxTaskHelper.GrantPermissionToLinkedUserAccount(this.DataObject, PermissionTaskHelper.GetReadOnlySession(null), new Task.ErrorLoggerDelegate(base.WriteError), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose));
						flag2 = true;
						flag3 = true;
					}
					else if (this.targetRecipientTypeDetails == RecipientTypeDetails.UserMailbox)
					{
						MailboxTaskHelper.ClearExternalAssociatedAccountPermission(this.DataObject, PermissionTaskHelper.GetReadOnlySession(null), new Task.ErrorLoggerDelegate(base.WriteError), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose));
						flag = true;
						flag3 = true;
					}
				}
				else if (this.DataObject.IsChanged(ADRecipientSchema.MasterAccountSid))
				{
					MailboxTaskHelper.GrantPermissionToLinkedUserAccount(this.DataObject, PermissionTaskHelper.GetReadOnlySession(null), new Task.ErrorLoggerDelegate(base.WriteError), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose));
					flag2 = true;
					flag3 = true;
				}
				base.InternalProcessRecord();
				if (flag3)
				{
					PermissionTaskHelper.SaveMailboxSecurityDescriptor(this.DataObject, SecurityDescriptorConverter.ConvertToActiveDirectorySecurity(this.DataObject.ExchangeSecurityDescriptor), (IRecipientSession)base.DataSession, ref mapiMessageStoreSession, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError));
				}
			}
			finally
			{
				if (mapiMessageStoreSession != null)
				{
					mapiMessageStoreSession.Dispose();
				}
			}
			if (flag2)
			{
				base.WriteVerbose(Strings.VerboseSaveADSecurityDescriptor(this.DataObject.Id.ToString()));
				this.DataObject.SaveSecurityDescriptor(((SecurityDescriptor)this.DataObject[ADObjectSchema.NTSecurityDescriptor]).ToRawSecurityDescriptor());
			}
			bool flag4 = base.Fields.IsModified(ADUserSchema.SharingPolicy);
			if (this.RemoveManagedFolderAndPolicy || flag || flag4)
			{
				ADSessionSettings sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(base.RootOrgContainerId, base.CurrentOrganizationId, base.ExecutingUserOrganizationId, false);
				IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, true, ConsistencyMode.IgnoreInvalid, sessionSettings, 4021, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\RecipientTasks\\mailbox\\SetMailbox.cs");
				if (!tenantOrRootOrgRecipientSession.IsReadConnectionAvailable())
				{
					tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(ConsistencyMode.IgnoreInvalid, sessionSettings, 4030, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\RecipientTasks\\mailbox\\SetMailbox.cs");
				}
				MailboxSession mailboxSession = this.OpenMailboxSession(tenantOrRootOrgRecipientSession, this.DataObject);
				if (mailboxSession == null)
				{
					base.WriteError(new RecipientTaskException(Strings.LogonFailure), ExchangeErrorCategory.ServerOperation, null);
					return;
				}
				using (mailboxSession)
				{
					if (this.RemoveManagedFolderAndPolicy && !ElcMailboxHelper.RemoveElcInMailbox(mailboxSession))
					{
						this.WriteWarning(Strings.WarningNonemptyManagedFolderNotDeleted);
					}
					if (flag)
					{
						using (CalendarConfigurationDataProvider calendarConfigurationDataProvider = new CalendarConfigurationDataProvider(mailboxSession))
						{
							CalendarConfiguration calendarConfiguration = (CalendarConfiguration)calendarConfigurationDataProvider.Read<CalendarConfiguration>(null);
							calendarConfiguration.AutomateProcessing = CalendarProcessingFlags.None;
							try
							{
								calendarConfigurationDataProvider.Save(calendarConfiguration);
							}
							catch (LocalizedException exception)
							{
								base.WriteError(exception, ExchangeErrorCategory.ServerOperation, null);
							}
						}
					}
					if (flag4)
					{
						mailboxSession.Mailbox.Delete(MailboxSchema.LastSharingPolicyAppliedId);
						mailboxSession.Mailbox.Delete(MailboxSchema.LastSharingPolicyAppliedHash);
						mailboxSession.Mailbox.Delete(MailboxSchema.LastSharingPolicyAppliedTime);
						mailboxSession.Mailbox.Save();
					}
				}
			}
			if (base.IsSetRandomPassword)
			{
				MailboxTaskHelper.SetMailboxPassword((IRecipientSession)base.DataSession, this.DataObject, null, new Task.ErrorLoggerDelegate(base.WriteError));
			}
			TaskLogger.LogExit();
		}
Exemple #19
0
 public ResponseMessageConfiguration(CalendarConfiguration calendarConfiguration) : base(calendarConfiguration)
 {
 }