예제 #1
0
 public JunkEmailOptions(OwaContext owaContext, TextWriter writer) : base(owaContext, writer)
 {
     this.junkEmailRule     = this.userContext.MailboxSession.JunkEmailRule;
     this.isEnabled         = this.userContext.IsJunkEmailEnabled;
     this.isContactsTrusted = this.junkEmailRule.IsContactsFolderTrusted;
     this.safeListsOnly     = this.junkEmailRule.TrustedListsOnly;
     if (Utilities.IsPostRequest(this.request) && !string.IsNullOrEmpty(base.Command))
     {
         this.SaveChanges();
     }
 }
예제 #2
0
        private PreFormActionResponse RedirectToAutoSaveInfo(OwaContext owaContext, MessageItem message)
        {
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse();

            preFormActionResponse.ApplicationElement = ApplicationElement.Item;
            preFormActionResponse.Type   = "IPM.Note";
            preFormActionResponse.Action = "AutoSaveInfo";
            preFormActionResponse.State  = string.Empty;
            preFormActionResponse.AddParameter("id", message.Id.ObjectId.ToBase64String());
            return(preFormActionResponse);
        }
 public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
 {
     if (owaContext == null)
     {
         throw new ArgumentNullException("owaContext");
     }
     applicationElement = ApplicationElement.Item;
     type   = owaContext.FormsRegistryContext.Type;
     state  = owaContext.FormsRegistryContext.State;
     action = owaContext.FormsRegistryContext.Action;
     return(null);
 }
 // Token: 0x060001C1 RID: 449 RVA: 0x00010B64 File Offset: 0x0000ED64
 private static void RedirectToCompose(OwaContext owaContext, PreFormActionResponse response, string errorMessage, MessageItem message)
 {
     if (!string.IsNullOrEmpty(errorMessage))
     {
         owaContext[OwaContextProperty.InfobarMessage] = InfobarMessage.CreateText(errorMessage, InfobarMessageType.Error);
     }
     response.ApplicationElement = ApplicationElement.Item;
     response.Type   = "IPM.Note";
     response.Action = "Open";
     response.State  = "Draft";
     response.AddParameter("id", message.Id.ObjectId.ToBase64String());
 }
예제 #5
0
 public SecondaryNavigation(OwaContext owaContext, StoreObjectId folderId)
 {
     if (owaContext == null)
     {
         throw new ArgumentNullException("owaContext");
     }
     if (folderId == null)
     {
         throw new ArgumentNullException("folderId");
     }
     this.owaContext       = owaContext;
     this.selectedFolderId = folderId;
 }
예제 #6
0
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.Item;
            type   = string.Empty;
            action = string.Empty;
            state  = string.Empty;
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse();
            Item item  = null;
            Item item2 = null;
            Item item3 = null;

            try
            {
                HttpContext httpContext          = owaContext.HttpContext;
                UserContext userContext          = owaContext.UserContext;
                string      queryStringParameter = Utilities.GetQueryStringParameter(httpContext.Request, "fId", true);
                item = ReplyForwardUtilities.GetItemForRequest(owaContext, out item2);
                BodyFormat replyForwardBodyFormat = ReplyForwardUtilities.GetReplyForwardBodyFormat(item, userContext);
                item3 = ReplyForwardUtilities.CreatePostReplyItem(replyForwardBodyFormat, item as PostItem, userContext, Utilities.GetParentFolderId(item2, item));
                item3.Save(SaveMode.ResolveConflicts);
                item3.Load();
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type   = "IPM.Post";
                preFormActionResponse.Action = "PostReply";
                preFormActionResponse.AddParameter("Id", OwaStoreObjectId.CreateFromStoreObject(item3).ToBase64String());
                preFormActionResponse.AddParameter("fId", queryStringParameter);
            }
            finally
            {
                if (item != null)
                {
                    item.Dispose();
                    item = null;
                }
                if (item2 != null)
                {
                    item2.Dispose();
                    item2 = null;
                }
                if (item3 != null)
                {
                    item3.Dispose();
                    item3 = null;
                }
            }
            return(preFormActionResponse);
        }
예제 #7
0
 // Token: 0x06000001 RID: 1 RVA: 0x000020D0 File Offset: 0x000002D0
 public OptionsBase(OwaContext owaContext, TextWriter writer)
 {
     if (owaContext == null)
     {
         throw new ArgumentNullException("owaContext");
     }
     if (writer == null)
     {
         throw new ArgumentNullException("writer");
     }
     this.request     = owaContext.HttpContext.Request;
     this.userContext = owaContext.UserContext;
     this.writer      = writer;
     this.command     = Utilities.GetFormParameter(this.request, "hidcmdpst", false);
 }
예제 #8
0
        private PreFormActionResponse RedirectToCompose(OwaContext owaContext, string errorMessage)
        {
            if (!string.IsNullOrEmpty(errorMessage))
            {
                owaContext[OwaContextProperty.InfobarMessage] = InfobarMessage.CreateText(errorMessage, InfobarMessageType.Error);
            }
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse();

            preFormActionResponse.ApplicationElement = ApplicationElement.Item;
            preFormActionResponse.Type   = owaContext.FormsRegistryContext.Type;
            preFormActionResponse.Action = "Open";
            preFormActionResponse.State  = "Draft";
            preFormActionResponse.AddParameter("id", this.base64ItemId);
            return(preFormActionResponse);
        }
예제 #9
0
 public DatePicker(OwaContext owaContext, StoreObjectId folderId, ExDateTime selectedDate)
 {
     if (folderId == null)
     {
         throw new ArgumentNullException("folderId");
     }
     if (owaContext == null)
     {
         throw new ArgumentNullException("owaContext");
     }
     this.folderId        = folderId;
     this.selectedDate    = (DateTime)selectedDate;
     this.owaContext      = owaContext;
     this.showWeekNumbers = owaContext.UserContext.UserOptions.ShowWeekNumbers;
     this.InitializeDates();
 }
예제 #10
0
 private static void RedirectToCompose(EditContactHelper helper, OwaContext owaContext, PreFormActionResponse response, string errorMessage)
 {
     if (!string.IsNullOrEmpty(errorMessage))
     {
         owaContext[OwaContextProperty.InfobarMessage] = InfobarMessage.CreateText(errorMessage, InfobarMessageType.Error);
     }
     helper.Contact.Load();
     response.ApplicationElement = ApplicationElement.Item;
     response.Type   = "IPM.Contact";
     response.Action = "Open";
     response.State  = "Draft";
     if (helper.Contact.Id != null)
     {
         response.AddParameter("id", helper.Contact.Id.ObjectId.ToBase64String());
     }
 }
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = string.Empty;
            action = string.Empty;
            state  = string.Empty;
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse();
            HttpContext           httpContext           = owaContext.HttpContext;
            string            queryStringParameter      = Utilities.GetQueryStringParameter(httpContext.Request, "lDn", true);
            IRecipientSession recipientSession          = Utilities.CreateADRecipientSession(ConsistencyMode.IgnoreInvalid, owaContext.UserContext);

            Result <ADRawEntry>[] array = recipientSession.FindByLegacyExchangeDNs(new string[]
            {
                queryStringParameter
            }, ItemReadADObjectPreFormAction.recipientQueryProperties);
            if (array == null || array.Length != 1)
            {
                throw new OwaADObjectNotFoundException();
            }
            ADRawEntry data       = array[0].Data;
            ADObjectId adobjectId = null;

            if (data != null)
            {
                adobjectId = (ADObjectId)data[ADObjectSchema.Id];
            }
            if (adobjectId == null)
            {
                throw new OwaADObjectNotFoundException();
            }
            preFormActionResponse.ApplicationElement = ApplicationElement.Item;
            preFormActionResponse.Action             = string.Empty;
            preFormActionResponse.AddParameter("id", Convert.ToBase64String(adobjectId.ObjectGuid.ToByteArray()));
            if (Utilities.IsADDistributionList((MultiValuedProperty <string>)data[ADObjectSchema.ObjectClass]))
            {
                preFormActionResponse.Type = "ADDistList";
            }
            else
            {
                preFormActionResponse.Type = "AD.RecipientType.User";
            }
            return(preFormActionResponse);
        }
예제 #12
0
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = string.Empty;
            state  = string.Empty;
            action = string.Empty;
            Item item  = null;
            Item item2 = null;
            PreFormActionResponse result;

            try
            {
                item = Utilities.GetItemForRequest <Item>(owaContext, out item2, new PropertyDefinition[]
                {
                    StoreObjectSchema.EffectiveRights
                });
                bool flag = ItemUtility.UserCanEditItem(item);
                PreFormActionResponse preFormActionResponse = new PreFormActionResponse();
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type = owaContext.FormsRegistryContext.Type;
                preFormActionResponse.AddParameter("id", Utilities.GetQueryStringParameter(owaContext.HttpContext.Request, "id"));
                if (flag)
                {
                    preFormActionResponse.Action = "Open";
                    preFormActionResponse.State  = "Draft";
                }
                result = preFormActionResponse;
            }
            finally
            {
                if (item != null)
                {
                    item.Dispose();
                    item = null;
                }
                if (item2 != null)
                {
                    item2.Dispose();
                    item2 = null;
                }
            }
            return(result);
        }
예제 #13
0
        // Token: 0x06002594 RID: 9620 RVA: 0x000D9874 File Offset: 0x000D7A74
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.Item;
            type   = "IPM.Note";
            action = this.Action;
            state  = null;
            string           queryStringParameter  = Utilities.GetQueryStringParameter(owaContext.HttpContext.Request, "id", true);
            string           queryStringParameter2 = Utilities.GetQueryStringParameter(owaContext.HttpContext.Request, "t", true);
            UserContext      userContext           = owaContext.UserContext;
            OwaStoreObjectId owaStoreObjectId      = OwaStoreObjectId.CreateFromString(queryStringParameter);

            if (queryStringParameter2 == "IPM.Sharing" && !owaStoreObjectId.IsPublic)
            {
                using (SharingMessageItem item = Utilities.GetItem <SharingMessageItem>(userContext, owaStoreObjectId, new PropertyDefinition[0]))
                {
                    StoreObjectId     parentId          = item.ParentId;
                    bool              flag              = Utilities.IsItemInDefaultFolder(item, DefaultFolderType.JunkEmail);
                    DefaultFolderType defaultFolderType = DefaultFolderType.None;
                    try
                    {
                        defaultFolderType = item.SharedFolderType;
                    }
                    catch (NotSupportedSharingMessageException ex)
                    {
                        ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "Cannot handle this sharing message due to {0}", ex.Message);
                    }
                    if (defaultFolderType == DefaultFolderType.Calendar && !flag)
                    {
                        type = "IPM.Sharing";
                        if (item.IsDraft)
                        {
                            state = "Draft";
                        }
                    }
                }
            }
            return(null);
        }
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            UserContext userContext = owaContext.UserContext;
            HttpRequest request     = owaContext.HttpContext.Request;

            string[] array = null;
            applicationElement = ApplicationElement.Item;
            type   = string.Empty;
            action = string.Empty;
            state  = string.Empty;
            if (!Utilities.IsPostRequest(request))
            {
                return(userContext.LastClientViewState.ToPreFormActionResponse());
            }
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse();
            string        formParameter = Utilities.GetFormParameter(request, "hidAB");
            int           num           = 0;
            StoreObjectId storeObjectId = null;
            string        changeKey     = null;

            string[] array2 = formParameter.Split(new char[]
            {
                ';'
            });
            if (array2 != null && array2.Length > 0)
            {
                if (string.CompareOrdinal(array2[0], "Ad") == 0)
                {
                    num = 1;
                }
                else
                {
                    if (string.CompareOrdinal(array2[0], "Con") != 0)
                    {
                        throw new OwaInvalidRequestException("Invalid search location for addressbook");
                    }
                    num = 2;
                }
            }
            string action2 = owaContext.FormsRegistryContext.Action;

            if (action2 == null)
            {
                throw new OwaInvalidRequestException("Action query string parameter is missing");
            }
            object obj = AddressBookPreFormAction.actionParser.Parse(action2);

            AddressBookPreFormAction.Action action3 = (AddressBookPreFormAction.Action)obj;
            string text = request.Form["chkRcpt"];

            if (!string.IsNullOrEmpty(text))
            {
                array = text.Split(new char[]
                {
                    ','
                });
            }
            AddressBook.Mode mode = AddressBookHelper.TryReadAddressBookMode(request, AddressBook.Mode.None);
            if (AddressBook.IsEditingMode(mode))
            {
                string formParameter2 = Utilities.GetFormParameter(request, "hidid", false);
                changeKey = Utilities.GetFormParameter(request, "hidchk", false);
                if (!string.IsNullOrEmpty(formParameter2))
                {
                    storeObjectId = Utilities.CreateStoreObjectId(userContext.MailboxSession, formParameter2);
                    if (storeObjectId == null)
                    {
                        throw new OwaInvalidRequestException("ItemId cannot be null");
                    }
                }
            }
            switch (action3)
            {
            case AddressBookPreFormAction.Action.Done:
                if (AddressBook.IsEditingMode(mode))
                {
                    using (Item item = AddressBookHelper.GetItem(userContext, mode, storeObjectId, changeKey))
                    {
                        if (array != null && array.Length > 0)
                        {
                            RecipientItemType type2          = RecipientItemType.To;
                            string            formParameter3 = Utilities.GetFormParameter(request, "hidrw");
                            if (!string.IsNullOrEmpty(formParameter3))
                            {
                                int num2;
                                if (!int.TryParse(formParameter3, out num2) || num2 < 1 || num2 > 3)
                                {
                                    type2 = RecipientItemType.To;
                                }
                                else
                                {
                                    type2 = (RecipientItemType)num2;
                                }
                            }
                            if (num == 1)
                            {
                                AddressBookHelper.AddRecipientsToDraft(array, item, type2, userContext);
                            }
                            else if (num == 2)
                            {
                                AddressBookHelper.AddContactsToDraft(item, type2, userContext, array);
                            }
                        }
                        preFormActionResponse = AddressBookHelper.RedirectToEdit(userContext, item, mode);
                        break;
                    }
                }
                throw new OwaInvalidRequestException("This action must be in editing mode");

            case AddressBookPreFormAction.Action.Mail:
                if (array != null && array.Length > 0)
                {
                    using (Item item2 = MessageItem.Create(userContext.MailboxSession, userContext.DraftsFolderId))
                    {
                        item2[ItemSchema.ConversationIndexTracking] = true;
                        if (num == 1)
                        {
                            AddressBookHelper.AddRecipientsToDraft(array, item2, RecipientItemType.To, userContext);
                        }
                        else if (num == 2)
                        {
                            AddressBookHelper.AddContactsToDraft(item2, RecipientItemType.To, userContext, array);
                        }
                        preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                        preFormActionResponse.Type   = "IPM.Note";
                        preFormActionResponse.Action = "Open";
                        preFormActionResponse.State  = "Draft";
                        preFormActionResponse.AddParameter("id", item2.Id.ObjectId.ToBase64String());
                        break;
                    }
                }
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type   = "IPM.Note";
                preFormActionResponse.Action = "New";
                break;

            case AddressBookPreFormAction.Action.MeetingRequest:
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type = "IPM.Appointment";
                if (array != null && array.Length > 0)
                {
                    using (CalendarItemBase calendarItemBase = EditCalendarItemHelper.CreateDraft(userContext, userContext.CalendarFolderId))
                    {
                        calendarItemBase.IsMeeting = true;
                        if (num == 1)
                        {
                            AddressBookHelper.AddRecipientsToDraft(array, calendarItemBase, RecipientItemType.To, userContext);
                        }
                        else if (num == 2)
                        {
                            AddressBookHelper.AddContactsToDraft(calendarItemBase, RecipientItemType.To, userContext, array);
                        }
                        preFormActionResponse.Action = "Open";
                        EditCalendarItemHelper.CreateUserContextData(userContext, calendarItemBase);
                        break;
                    }
                }
                preFormActionResponse.AddParameter("mr", "1");
                preFormActionResponse.Action = "New";
                break;

            case AddressBookPreFormAction.Action.Close:
                if (AddressBook.IsEditingMode(mode))
                {
                    using (Item item3 = AddressBookHelper.GetItem(userContext, mode, storeObjectId, changeKey))
                    {
                        preFormActionResponse = AddressBookHelper.RedirectToEdit(userContext, item3, mode);
                        break;
                    }
                }
                throw new OwaInvalidRequestException("This action must be in editing mode");

            case AddressBookPreFormAction.Action.AddToContacts:
            {
                string type3 = "IPM.Contact";
                string text2 = null;
                if (array == null || array.Length != 1)
                {
                    throw new OwaInvalidRequestException("User must select some recipient to add and can only add one recipient to contacts at one time");
                }
                ADObjectId adobjectId = DirectoryAssistance.ParseADObjectId(array[0]);
                if (adobjectId == null)
                {
                    throw new OwaADObjectNotFoundException();
                }
                IRecipientSession recipientSession = Utilities.CreateADRecipientSession(Culture.GetUserCulture().LCID, true, ConsistencyMode.FullyConsistent, true, userContext);
                ADRecipient       adrecipient      = recipientSession.Read(adobjectId);
                if (adrecipient == null)
                {
                    throw new OwaADObjectNotFoundException();
                }
                using (ContactBase contactBase = ContactUtilities.AddADRecipientToContacts(userContext, adrecipient))
                {
                    if (contactBase != null)
                    {
                        contactBase.Load();
                        text2 = contactBase.Id.ObjectId.ToBase64String();
                        type3 = contactBase.ClassName;
                    }
                }
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type = type3;
                if (text2 != null)
                {
                    preFormActionResponse.Action = "Open";
                    preFormActionResponse.State  = "Draft";
                    preFormActionResponse.AddParameter("id", text2);
                }
                else
                {
                    preFormActionResponse.Action = "New";
                }
                break;
            }

            default:
                throw new OwaInvalidRequestException("Invalid request for addressbook preformaction");
            }
            return(preFormActionResponse);
        }
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = string.Empty;
            state  = string.Empty;
            action = string.Empty;
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse();

            preFormActionResponse.Type = owaContext.FormsRegistryContext.Type;
            preFormActionResponse.ApplicationElement = ApplicationElement.Item;
            bool flag  = false;
            bool flag2 = false;
            CalendarItemBaseData calendarItemBaseData = EditCalendarItemHelper.GetUserContextData(owaContext.UserContext);
            StoreObjectId        storeObjectId        = QueryStringUtilities.CreateItemStoreObjectId(owaContext.UserContext.MailboxSession, owaContext.HttpContext.Request, false);

            if (calendarItemBaseData != null && calendarItemBaseData.Id != null && storeObjectId != null && !calendarItemBaseData.Id.Equals(storeObjectId))
            {
                EditCalendarItemHelper.ClearUserContextData(owaContext.UserContext);
                calendarItemBaseData = null;
            }
            if (calendarItemBaseData != null)
            {
                flag  = calendarItemBaseData.IsOrganizer;
                flag2 = calendarItemBaseData.IsMeeting;
            }
            else
            {
                if (storeObjectId == null)
                {
                    throw new OwaLostContextException("Lost changes since last save.");
                }
                CalendarItemBase calendarItemBase2;
                CalendarItemBase calendarItemBase = calendarItemBase2 = CalendarItemBase.Bind(owaContext.UserContext.MailboxSession, storeObjectId);
                try
                {
                    flag  = calendarItemBase.IsOrganizer();
                    flag2 = calendarItemBase.IsMeeting;
                }
                finally
                {
                    if (calendarItemBase2 != null)
                    {
                        ((IDisposable)calendarItemBase2).Dispose();
                    }
                }
            }
            if (flag2 && !flag)
            {
                preFormActionResponse.Action = "Read";
            }
            else
            {
                preFormActionResponse.Action = "Open";
            }
            string text = "ae,a,t,s";

            for (int i = 0; i < owaContext.HttpContext.Request.QueryString.Count; i++)
            {
                string text2 = owaContext.HttpContext.Request.QueryString.Keys[i];
                if (text.IndexOf(text2, StringComparison.Ordinal) == -1)
                {
                    preFormActionResponse.AddParameter(text2, owaContext.HttpContext.Request.QueryString[text2]);
                }
            }
            return(preFormActionResponse);
        }
        // Token: 0x06000621 RID: 1569 RVA: 0x00030BDC File Offset: 0x0002EDDC
        public static void GenerateEditableMessageBodyAndRenderInfobarMessages(Item item, TextWriter writer, OwaContext owaContext, Infobar infobar)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (infobar == null)
            {
                throw new ArgumentNullException("infobar");
            }
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            UserContext userContext = owaContext.UserContext;

            BodyConversionUtilities.RenderComposeBody(writer, item, userContext);
        }
예제 #17
0
 public CalendarOptions(OwaContext owaContext, TextWriter writer) : base(owaContext, writer)
 {
     this.CommitAndLoad();
 }
예제 #18
0
 public AboutOptions(OwaContext owaContext, TextWriter writer) : base(owaContext, writer)
 {
     this.Load(owaContext);
 }
        // Token: 0x0600061F RID: 1567 RVA: 0x000307CC File Offset: 0x0002E9CC
        public static IList <AttachmentLink> GenerateNonEditableMessageBodyAndRenderInfobarMessages(Item item, TextWriter writer, OwaContext owaContext, Infobar infobar, bool allowWebBeacon, bool forceEnableItemLink, string itemType, string action, string state, bool isEmbedded, string attachmentUrl)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (infobar == null)
            {
                throw new ArgumentNullException("infobar");
            }
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            UserContext           userContext = owaContext.UserContext;
            WebBeaconFilterLevels filterWebBeaconsAndHtmlForms = userContext.Configuration.FilterWebBeaconsAndHtmlForms;
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;
            bool flag4 = false;

            JunkEmailUtilities.GetJunkEmailPropertiesForItem(item, isEmbedded, forceEnableItemLink, userContext, out flag, out flag2, out flag3, out flag4);
            OwaSafeHtmlCallbackBase owaSafeHtmlCallbackBase;

            if (!flag4)
            {
                if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.DisableFilter || allowWebBeacon || Utilities.IsWebBeaconsAllowed(item))
                {
                    owaSafeHtmlCallbackBase = new OwaSafeHtmlAllowWebBeaconCallbacks(item, userContext.IsPublicLogon, isEmbedded, attachmentUrl, owaContext, false);
                }
                else
                {
                    owaSafeHtmlCallbackBase = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, isEmbedded, attachmentUrl, false, owaContext, false);
                }
            }
            else
            {
                owaSafeHtmlCallbackBase = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, isEmbedded, attachmentUrl, true, owaContext, false);
            }
            BodyConversionUtilities.RenderReadBody(writer, item, owaSafeHtmlCallbackBase, flag4);
            bool hasBlockedImages = owaSafeHtmlCallbackBase.HasBlockedImages;

            if (flag)
            {
                if (flag2)
                {
                    infobar.AddMessageText(LocalizedStrings.GetNonEncoded(1581910613) + " " + LocalizedStrings.GetNonEncoded(614784743), InfobarMessageType.Phishing);
                }
                else if (userContext.IsJunkEmailEnabled)
                {
                    infobar.AddMessageText(LocalizedStrings.GetNonEncoded(59853257) + " " + LocalizedStrings.GetNonEncoded(385373859), InfobarMessageType.JunkEmail);
                }
            }
            else if (flag2 && !flag3)
            {
                string s = string.Format(CultureInfo.InvariantCulture, "<a id=\"aIbBlk\" href=\"#\" onclick=\"return onClkBm('{0}', 1, 0)\">{1}</a> {2} ", new object[]
                {
                    itemType,
                    LocalizedStrings.GetHtmlEncoded(-672110188),
                    LocalizedStrings.GetHtmlEncoded(-1020475744)
                });
                string format = "<a href=\"#\" onClick=opnHlp('" + Utilities.JavascriptEncode(Utilities.BuildEhcHref(HelpIdsLight.EmailSafetyLight.ToString())) + "')>{0}</a>";
                string s2     = string.Format(CultureInfo.InvariantCulture, format, new object[]
                {
                    LocalizedStrings.GetHtmlEncoded(338562664)
                });
                infobar.AddMessageHtml(SanitizedHtmlString.Format("{0}{1}{2}", new object[]
                {
                    LocalizedStrings.GetNonEncoded(1581910613),
                    SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s),
                    SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s2)
                }), InfobarMessageType.Phishing);
            }
            else if (hasBlockedImages)
            {
                if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.UserFilterChoice)
                {
                    string s3 = string.Format(CultureInfo.InvariantCulture, "<a id=\"aIbBlk\" href=\"#\" onclick=\"return onClkBm('{0}', 1, 1);\">{1}</a>", new object[]
                    {
                        itemType,
                        LocalizedStrings.GetHtmlEncoded(469213884)
                    });
                    infobar.AddMessageHtml(SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(2063285740), new object[]
                    {
                        SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s3)
                    }), InfobarMessageType.Informational);
                }
                else if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.ForceFilter)
                {
                    infobar.AddMessageLocalized(-1196115124, InfobarMessageType.Informational);
                }
            }
            if (owaSafeHtmlCallbackBase.HasRtfEmbeddedImages)
            {
                infobar.AddMessageLocalized(1338319428, InfobarMessageType.Informational);
            }
            return(owaSafeHtmlCallbackBase.AttachmentLinks);
        }
예제 #20
0
        // Token: 0x06000127 RID: 295 RVA: 0x00009A0C File Offset: 0x00007C0C
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            UserContext userContext = owaContext.UserContext;
            HttpRequest request     = owaContext.HttpContext.Request;

            string[] array = null;
            applicationElement = ApplicationElement.NotSet;
            type   = string.Empty;
            action = string.Empty;
            state  = string.Empty;
            if (!Utilities.IsPostRequest(request))
            {
                return(userContext.LastClientViewState.ToPreFormActionResponse());
            }
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse();
            string queryStringParameter = Utilities.GetQueryStringParameter(request, "a", true);
            object obj = ContactViewPreFormAction.actionParser.Parse(queryStringParameter);

            ContactViewPreFormAction.Action action2 = (ContactViewPreFormAction.Action)obj;
            string text = request.Form["chkRcpt"];

            if (!string.IsNullOrEmpty(text))
            {
                array = text.Split(new char[]
                {
                    ','
                });
            }
            switch (action2)
            {
            case ContactViewPreFormAction.Action.Mail:
                if (array != null && array.Length > 0)
                {
                    using (MessageItem messageItem = MessageItem.Create(userContext.MailboxSession, userContext.DraftsFolderId))
                    {
                        messageItem[ItemSchema.ConversationIndexTracking] = true;
                        AddressBookHelper.AddContactsToDraft(messageItem, RecipientItemType.To, userContext, array);
                        preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                        preFormActionResponse.Type   = "IPM.Note";
                        preFormActionResponse.Action = "Open";
                        preFormActionResponse.State  = "Draft";
                        preFormActionResponse.AddParameter("id", messageItem.Id.ObjectId.ToBase64String());
                        break;
                    }
                }
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type   = "IPM.Note";
                preFormActionResponse.Action = "New";
                break;

            case ContactViewPreFormAction.Action.MeetingRequest:
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type = "IPM.Appointment";
                if (array != null && array.Length > 0)
                {
                    using (CalendarItemBase calendarItemBase = EditCalendarItemHelper.CreateDraft(userContext, userContext.CalendarFolderId))
                    {
                        calendarItemBase.IsMeeting = true;
                        AddressBookHelper.AddContactsToDraft(calendarItemBase, RecipientItemType.To, userContext, array);
                        preFormActionResponse.Action = "Open";
                        EditCalendarItemHelper.CreateUserContextData(userContext, calendarItemBase);
                        break;
                    }
                }
                preFormActionResponse.AddParameter("mr", "1");
                preFormActionResponse.Action = "New";
                break;

            default:
                throw new OwaInvalidRequestException("Invalid request for addressbook preformaction");
            }
            return(preFormActionResponse);
        }
예제 #21
0
 private void Load(OwaContext owaContext)
 {
     this.about = new AboutDetails(owaContext);
 }
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = string.Empty;
            state  = string.Empty;
            action = string.Empty;
            HttpContext httpContext = owaContext.HttpContext;
            UserContext userContext = owaContext.UserContext;
            HttpRequest request     = httpContext.Request;

            if (!Utilities.IsPostRequest(request) && owaContext.FormsRegistryContext.Action != "Prev" && owaContext.FormsRegistryContext.Action != "Next")
            {
                return(userContext.LastClientViewState.ToPreFormActionResponse());
            }
            string storeObjectId;
            string storeObjectId2;

            if (Utilities.IsPostRequest(request))
            {
                storeObjectId  = Utilities.GetFormParameter(request, "hidfldid", true);
                storeObjectId2 = Utilities.GetFormParameter(request, "hidid", true);
            }
            else
            {
                storeObjectId  = Utilities.GetQueryStringParameter(request, "fId", true);
                storeObjectId2 = Utilities.GetQueryStringParameter(request, "id", true);
            }
            StoreObjectId folderId       = Utilities.CreateStoreObjectId(userContext.MailboxSession, storeObjectId);
            StoreObjectId storeObjectId3 = Utilities.CreateStoreObjectId(userContext.MailboxSession, storeObjectId2);

            ItemOperations.Result result = null;
            string action2;

            if ((action2 = owaContext.FormsRegistryContext.Action) != null)
            {
                if (!(action2 == "Prev"))
                {
                    if (!(action2 == "Next"))
                    {
                        if (!(action2 == "Del"))
                        {
                            if (!(action2 == "Junk"))
                            {
                                if (!(action2 == "NotJunk"))
                                {
                                    goto IL_1FA;
                                }
                                if (!userContext.IsJunkEmailEnabled)
                                {
                                    throw new OwaInvalidRequestException(LocalizedStrings.GetNonEncoded(552277155));
                                }
                                owaContext[OwaContextProperty.InfobarMessage] = JunkEmailHelper.MarkAsNotJunk(userContext, new StoreObjectId[]
                                {
                                    storeObjectId3
                                });
                                userContext.ForceNewSearch = true;
                            }
                            else
                            {
                                if (!userContext.IsJunkEmailEnabled)
                                {
                                    throw new OwaInvalidRequestException(LocalizedStrings.GetNonEncoded(552277155));
                                }
                                owaContext[OwaContextProperty.InfobarMessage] = JunkEmailHelper.MarkAsJunk(userContext, new StoreObjectId[]
                                {
                                    storeObjectId3
                                });
                                userContext.ForceNewSearch = true;
                            }
                        }
                        else
                        {
                            result = ItemOperations.DeleteItem(userContext, storeObjectId3, folderId);
                            userContext.ForceNewSearch = true;
                        }
                    }
                    else
                    {
                        result = ItemOperations.GetNextViewItem(userContext, ItemOperations.Action.Next, storeObjectId3, folderId);
                    }
                }
                else
                {
                    result = ItemOperations.GetNextViewItem(userContext, ItemOperations.Action.Prev, storeObjectId3, folderId);
                }
                return(ItemOperations.GetPreFormActionResponse(userContext, result));
            }
IL_1FA:
            throw new OwaInvalidRequestException("Unknown command");
        }
 // Token: 0x06001F30 RID: 7984 RVA: 0x000B32CA File Offset: 0x000B14CA
 public static void RenderCategories(OwaContext owaContext, TextWriter writer, Item item)
 {
     CategorySwatch.RenderCategories(owaContext, writer, item, item.Session);
 }
        // Token: 0x06000301 RID: 769 RVA: 0x0001B08C File Offset: 0x0001928C
        private static bool DoMove(StoreObjectId folderId, StoreObjectId[] itemIds, string[] itemClassNames, OwaContext owaContext)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("OwaContext");
            }
            UserContext userContext = owaContext.UserContext;
            Folder      folder      = null;
            Exception   ex          = null;

            try
            {
                folder = Folder.Bind(userContext.MailboxSession, folderId, new PropertyDefinition[]
                {
                    StoreObjectSchema.ContainerClass
                });
            }
            catch (StoragePermanentException ex2)
            {
                ex = ex2;
            }
            catch (StorageTransientException ex3)
            {
                ex = ex3;
            }
            if (ex != null)
            {
                InfobarMessage.PutExceptionInfoIntoContextInfobarMessage(ex, owaContext);
                ((InfobarMessage)owaContext[OwaContextProperty.InfobarMessage]).IsActionResult = true;
                return(false);
            }
            bool flag = true;

            if (folder.ClassName != null)
            {
                for (int i = 0; i < itemClassNames.Length; i++)
                {
                    if (!MoveItemPreFormAction.IsMoveAllowed(itemClassNames[i], folder.ClassName))
                    {
                        flag = false;
                        break;
                    }
                }
            }
            folder.Dispose();
            if (!flag)
            {
                MoveItemPreFormAction.AddInfobarMessageToContext(432946224, InfobarMessageType.Error, owaContext);
                return(false);
            }
            AggregateOperationResult aggregateOperationResult = userContext.MailboxSession.Move(folderId, itemIds);
            OperationResult          operationResult          = aggregateOperationResult.OperationResult;

            if (operationResult == OperationResult.Succeeded)
            {
                MoveItemPreFormAction.AddInfobarMessageToContext(-1303045509, InfobarMessageType.Informational, owaContext);
                return(true);
            }
            if (operationResult == OperationResult.PartiallySucceeded)
            {
                MoveItemPreFormAction.AddInfobarMessageToContext(-324890159, InfobarMessageType.Error, owaContext);
                return(false);
            }
            MoveItemPreFormAction.AddInfobarMessageToContext(-842347964, InfobarMessageType.Error, owaContext);
            return(false);
        }
        // Token: 0x06001F31 RID: 7985 RVA: 0x000B32DC File Offset: 0x000B14DC
        public static void RenderCategories(OwaContext owaContext, TextWriter writer, IStorePropertyBag storePropertyBag, StoreSession storeSession)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (storePropertyBag == null)
            {
                throw new ArgumentNullException("storePropertyBag");
            }
            string[] property = ItemUtility.GetProperty <string[]>(storePropertyBag, ItemSchema.Categories, null);
            string   value    = owaContext.UserContext.IsRtl ? "rtl" : "ltr";
            int      num      = 0;

            if (property != null && 0 < property.Length)
            {
                MasterCategoryList masterCategoryList = null;
                try
                {
                    if (storeSession != null && owaContext.UserContext.IsOtherMailbox(storeSession))
                    {
                        masterCategoryList = owaContext.UserContext.GetMasterCategoryList(storeSession as MailboxSession);
                    }
                    else
                    {
                        masterCategoryList = owaContext.UserContext.GetMasterCategoryList();
                    }
                }
                catch (QuotaExceededException ex)
                {
                    ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "CategorySwatch.RenderCategories: Failed. Exception: {0}", ex.Message);
                    return;
                }
                if (masterCategoryList != null)
                {
                    for (int i = 0; i < property.Length; i++)
                    {
                        writer.Write("<span class=\"spanCatContainer\" dir=\"");
                        writer.Write(value);
                        writer.Write("\">");
                        CategorySwatch.RenderSwatch(writer, masterCategoryList[property[i]]);
                        writer.Write("&nbsp;");
                        Utilities.SanitizeHtmlEncode(property[i], writer);
                        if (i < property.Length - 1)
                        {
                            writer.Write("; ");
                        }
                        writer.Write("</span><wbr>");
                        num++;
                    }
                }
            }
            if (num == 0)
            {
                writer.Write("<span class=\"spanCatContainer catAfter\" dir=\"");
                writer.Write(value);
                writer.Write("\">");
                int legacyColoredFlag = ItemUtility.GetLegacyColoredFlag(storePropertyBag);
                if (0 < legacyColoredFlag && legacyColoredFlag < CategorySwatch.FlagCategory.Length)
                {
                    CategorySwatch.RenderSwatch(writer, (ItemColor)legacyColoredFlag);
                    writer.Write("<span id=\"vaM\">");
                    writer.Write(SanitizedHtmlString.FromStringId(CategorySwatch.FlagCategory[legacyColoredFlag]));
                    writer.Write("</span>");
                }
                writer.Write("</span>");
            }
        }
        // Token: 0x060001E9 RID: 489 RVA: 0x000128F8 File Offset: 0x00010AF8
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type             = string.Empty;
            action           = string.Empty;
            state            = string.Empty;
            this.userContext = owaContext.UserContext;
            this.httpRequest = owaContext.HttpContext.Request;
            if (!Utilities.IsPostRequest(this.httpRequest))
            {
                return(this.userContext.LastClientViewState.ToPreFormActionResponse());
            }
            this.folderManagementHelper = new FolderManagementHelper(owaContext);
            this.module = RequestParser.GetNavigationModuleFromQueryString(this.httpRequest, NavigationModule.Mail, true);
            if ((this.module == NavigationModule.Calendar && !this.userContext.IsFeatureEnabled(Feature.Calendar)) || (this.module == NavigationModule.Contacts && !this.userContext.IsFeatureEnabled(Feature.Contacts)))
            {
                throw new OwaSegmentationException("The " + this.module.ToString() + " feature is disabled");
            }
            this.folderId = RequestParser.GetFolderIdFromQueryString(this.httpRequest, true);
            string action2;

            if ((action2 = owaContext.FormsRegistryContext.Action) != null)
            {
                PreFormActionResponse preFormActionResponse;
                if (!(action2 == "Create"))
                {
                    if (!(action2 == "Rename"))
                    {
                        if (!(action2 == "Move"))
                        {
                            if (!(action2 == "Delete"))
                            {
                                goto IL_152;
                            }
                            preFormActionResponse = this.ExecuteDeleteAction();
                        }
                        else
                        {
                            preFormActionResponse = this.ExecuteMoveAction();
                        }
                    }
                    else
                    {
                        preFormActionResponse = this.ExecuteRenameAction();
                    }
                }
                else
                {
                    preFormActionResponse = this.ExecuteCreateAction();
                }
                if (owaContext[OwaContextProperty.InfobarMessage] != null)
                {
                    ((InfobarMessage)owaContext[OwaContextProperty.InfobarMessage]).IsActionResult = true;
                }
                preFormActionResponse.ApplicationElement = ApplicationElement.Dialog;
                preFormActionResponse.Type = "FolderManagement";
                PreFormActionResponse preFormActionResponse2 = preFormActionResponse;
                string name = "m";
                int    num  = (int)this.module;
                preFormActionResponse2.AddParameter(name, num.ToString());
                preFormActionResponse.AddParameter("fid", this.folderId.ToBase64String());
                return(preFormActionResponse);
            }
IL_152:
            throw new OwaInvalidRequestException("Invalid action for folder management preformaction");
        }
        // Token: 0x06000302 RID: 770 RVA: 0x0001B1B0 File Offset: 0x000193B0
        private static void AddInfobarMessageToContext(Strings.IDs messageStringId, InfobarMessageType type, OwaContext owaContext)
        {
            InfobarMessage infobarMessage = InfobarMessage.CreateLocalized(messageStringId, type);

            infobarMessage.IsActionResult = true;
            owaContext[OwaContextProperty.InfobarMessage] = infobarMessage;
        }
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext", "owaContext is null.");
            }
            if (owaContext.HttpContext == null)
            {
                throw new ArgumentNullException("owaContext", "owaContext.HttpContext is null.");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = null;
            state  = null;
            action = null;
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse();

            preFormActionResponse.ApplicationElement = ApplicationElement.Item;
            preFormActionResponse.Type   = "IPM.Appointment";
            preFormActionResponse.Action = string.Empty;
            preFormActionResponse.State  = string.Empty;
            this.request     = owaContext.HttpContext.Request;
            this.userContext = owaContext.UserContext;
            InfobarMessage infobarMessage = null;
            StoreObjectId  storeObjectId  = null;
            string         changeKey      = null;
            string         action2        = owaContext.FormsRegistryContext.Action;
            string         text;

            if (string.Equals(action2, "New", StringComparison.Ordinal))
            {
                text = "new";
            }
            else
            {
                if (!Utilities.IsPostRequest(this.request))
                {
                    return(this.userContext.LastClientViewState.ToPreFormActionResponse());
                }
                text = Utilities.GetFormParameter(this.request, "hidcmdpst");
                string formParameter = Utilities.GetFormParameter(this.request, "hidid", false);
                changeKey = Utilities.GetFormParameter(this.request, "hidchk", false);
                if (!string.IsNullOrEmpty(formParameter))
                {
                    storeObjectId = Utilities.CreateStoreObjectId(this.userContext.MailboxSession, formParameter);
                }
            }
            StoreObjectId calendarFolderId = EditCalendarItemHelper.GetCalendarFolderId(this.request, this.userContext);
            bool          syncCalendarItem = true;

            if (text.Equals("attch", StringComparison.Ordinal))
            {
                syncCalendarItem = false;
            }
            bool flag = true;

            try
            {
                EditCalendarItemHelper.CalendarItemUpdateFlags storeUpdateFlags = EditCalendarItemHelper.CalendarItemUpdateFlags.None;
                if (!text.Equals("cls", StringComparison.Ordinal))
                {
                    storeUpdateFlags = EditCalendarItemHelper.GetCalendarItem(this.userContext, storeObjectId, calendarFolderId, changeKey, syncCalendarItem, out this.calendarItemBase);
                }
                switch (this.DoAction(text, storeUpdateFlags, ref preFormActionResponse, out infobarMessage))
                {
                case EditCalendarItemPreFormAction.RedirectTo.None:
                    throw new OwaInvalidRequestException("Unhandled redirection.");

                case EditCalendarItemPreFormAction.RedirectTo.AddressBook:
                    preFormActionResponse = EditMessageHelper.RedirectToPeoplePicker(owaContext, this.calendarItemBase, AddressBook.Mode.EditCalendar);
                    EditCalendarItemHelper.CreateUserContextData(this.userContext, this.calendarItemBase);
                    break;

                case EditCalendarItemPreFormAction.RedirectTo.ADPage:
                    preFormActionResponse = EditMessageHelper.RedirectToRecipient(owaContext, this.calendarItemBase, AddressBook.Mode.EditCalendar);
                    EditCalendarItemHelper.CreateUserContextData(this.userContext, this.calendarItemBase);
                    break;

                case EditCalendarItemPreFormAction.RedirectTo.AttachmentManager:
                    if (this.calendarItemBase.Id == null)
                    {
                        CalendarUtilities.SaveCalendarItem(this.calendarItemBase, this.userContext, out infobarMessage);
                    }
                    using (CalendarItemBase calendarItemBase = EditCalendarItemHelper.CreateDraft(this.userContext, null))
                    {
                        CalendarItemBaseData userContextData = EditCalendarItemHelper.GetUserContextData(this.userContext);
                        userContextData.CopyTo(calendarItemBase);
                        string text2;
                        EditCalendarItemHelper.UpdateCalendarItemValues(calendarItemBase, this.userContext, this.request, out text2);
                        EditCalendarItemHelper.CreateUserContextData(this.userContext, calendarItemBase);
                        if (this.calendarItemBase.Id != null)
                        {
                            CalendarItemBaseData userContextData2 = EditCalendarItemHelper.GetUserContextData(this.userContext);
                            userContextData2.Id        = this.calendarItemBase.Id.ObjectId;
                            userContextData2.ChangeKey = this.calendarItemBase.Id.ChangeKeyAsBase64String();
                        }
                    }
                    if (infobarMessage == null)
                    {
                        this.RedirectToAttachmentManager(owaContext, preFormActionResponse);
                    }
                    else
                    {
                        owaContext.PreFormActionData = this.calendarItemBase;
                        flag = false;
                        this.RedirectToEdit(owaContext, infobarMessage, preFormActionResponse);
                    }
                    break;

                case EditCalendarItemPreFormAction.RedirectTo.CalendarDailyView:
                    EditCalendarItemHelper.ClearUserContextData(this.userContext);
                    preFormActionResponse = this.userContext.LastClientViewState.ToPreFormActionResponse();
                    break;

                case EditCalendarItemPreFormAction.RedirectTo.EditCalendarItem:
                    EditCalendarItemHelper.CreateUserContextData(this.userContext, this.calendarItemBase);
                    owaContext.PreFormActionData = this.calendarItemBase;
                    flag = false;
                    this.RedirectToEdit(owaContext, infobarMessage, preFormActionResponse);
                    break;

                case EditCalendarItemPreFormAction.RedirectTo.EditRecurrence:
                    EditCalendarItemHelper.CreateUserContextData(this.userContext, this.calendarItemBase);
                    owaContext.PreFormActionData = CalendarItemBaseData.Create(this.calendarItemBase);
                    preFormActionResponse.Action = "EditRecurrence";
                    if (this.calendarItemBase.IsDirty)
                    {
                        preFormActionResponse.AddParameter("cd", "1");
                    }
                    break;

                case EditCalendarItemPreFormAction.RedirectTo.SchedulingTab:
                    EditCalendarItemHelper.CreateUserContextData(this.userContext, this.calendarItemBase);
                    owaContext.PreFormActionData = this.calendarItemBase;
                    this.RedirectToSchedulingTab(owaContext, infobarMessage, preFormActionResponse);
                    flag = false;
                    break;

                default:
                    throw new OwaInvalidRequestException("Unhandled redirection enum value in EditCalendarItemPreFormAction.");
                }
            }
            catch
            {
                flag = true;
                EditCalendarItemHelper.ClearUserContextData(this.userContext);
                throw;
            }
            finally
            {
                if (flag && this.calendarItemBase != null)
                {
                    this.calendarItemBase.Dispose();
                    this.calendarItemBase = null;
                }
            }
            return(preFormActionResponse);
        }
		// Token: 0x060002E7 RID: 743 RVA: 0x000191C3 File Offset: 0x000173C3
		public MessagingOptions(OwaContext owaContext, TextWriter writer) : base(owaContext, writer)
		{
			this.CommitAndLoad();
		}
예제 #30
0
        // Token: 0x060022C1 RID: 8897 RVA: 0x000C69B8 File Offset: 0x000C4BB8
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = string.Empty;
            action = string.Empty;
            state  = string.Empty;
            Item                  item       = null;
            Item                  item2      = null;
            Item                  item3      = null;
            bool                  flag       = false;
            BodyFormat            bodyFormat = BodyFormat.TextPlain;
            PreFormActionResponse result;

            try
            {
                HttpContext           httpContext           = owaContext.HttpContext;
                UserContext           userContext           = owaContext.UserContext;
                PreFormActionResponse preFormActionResponse = new PreFormActionResponse(httpContext.Request, new string[]
                {
                    "cb",
                    "smime"
                });
                item = ReplyForwardUtilities.GetItemForRequest(owaContext, out item2);
                if (item != null && !ItemUtility.IsForwardSupported(item))
                {
                    throw new OwaInvalidRequestException("Forwarding of such a type item is not supported.");
                }
                CalendarItemBase calendarItemBase = item as CalendarItemBase;
                if (item is Task || item is ContactBase || (calendarItemBase != null && !calendarItemBase.IsMeeting))
                {
                    item3 = ReplyForwardUtilities.CreateForwardMessageWithItemAttached(item, userContext);
                    preFormActionResponse.Action = "New";
                    preFormActionResponse.AddParameter("exdltdrft", "1");
                }
                else
                {
                    bool   flag2 = false;
                    string queryStringParameter = Utilities.GetQueryStringParameter(httpContext.Request, "smime", false);
                    RightsManagedMessageDecryptionStatus decryptionStatus = RightsManagedMessageDecryptionStatus.FeatureDisabled;
                    if (userContext.IsIrmEnabled)
                    {
                        try
                        {
                            flag = Utilities.IrmDecryptForReplyForward(owaContext, ref item, ref item2, ref bodyFormat, out decryptionStatus);
                        }
                        catch (RightsManagementPermanentException exception)
                        {
                            decryptionStatus = RightsManagedMessageDecryptionStatus.CreateFromException(exception);
                        }
                    }
                    if (!flag)
                    {
                        bodyFormat = ReplyForwardUtilities.GetReplyForwardBodyFormat(item, userContext);
                    }
                    bool flag3 = Utilities.IsSMimeControlNeededForEditForm(queryStringParameter, owaContext);
                    flag2 = ((flag3 && Utilities.IsSMime(item)) || flag);
                    bool flag4 = userContext.IsSmsEnabled && ObjectClass.IsSmsMessage(owaContext.FormsRegistryContext.Type);
                    ReplyForwardFlags replyForwardFlags = ReplyForwardFlags.None;
                    if (flag2)
                    {
                        replyForwardFlags |= ReplyForwardFlags.DropBody;
                    }
                    if (flag4 || flag)
                    {
                        replyForwardFlags |= ReplyForwardFlags.DropHeader;
                    }
                    StoreObjectId parentFolderId = Utilities.GetParentFolderId(item2, item);
                    item3 = ReplyForwardUtilities.CreateForwardItem(flag3 ? BodyFormat.TextHtml : bodyFormat, item, replyForwardFlags, userContext, parentFolderId);
                    if (flag)
                    {
                        item3.AttachmentCollection.RemoveAll();
                        using (ItemAttachment itemAttachment = item3.AttachmentCollection.AddExistingItem(item))
                        {
                            itemAttachment.Save();
                            goto IL_205;
                        }
                    }
                    if (Utilities.IsIrmRestrictedAndNotDecrypted(item))
                    {
                        ReplyForwardUtilities.SetAlternateIrmBody(item3, flag3 ? BodyFormat.TextHtml : bodyFormat, userContext, parentFolderId, decryptionStatus, ObjectClass.IsVoiceMessage(item.ClassName));
                        item3.AttachmentCollection.RemoveAll();
                    }
IL_205:
                    preFormActionResponse.Action = "Forward";
                    if (flag2)
                    {
                        preFormActionResponse.AddParameter("srcId", Utilities.GetItemIdQueryString(httpContext.Request));
                        if (Utilities.GetQueryStringParameter(httpContext.Request, "cb", false) == null && Utilities.IsWebBeaconsAllowed(item))
                        {
                            preFormActionResponse.AddParameter("cb", "1");
                        }
                    }
                    if (flag4)
                    {
                        item3.ClassName = "IPM.Note.Mobile.SMS";
                    }
                }
                item3.Save(SaveMode.ResolveConflicts);
                item3.Load();
                ReplyForwardUtilities.DeleteLevelOneAttachments(item3, userContext);
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type = item3.ClassName;
                preFormActionResponse.AddParameter("id", OwaStoreObjectId.CreateFromStoreObject(item3).ToBase64String());
                if (userContext.IsInOtherMailbox(item))
                {
                    preFormActionResponse.AddParameter("fOMF", "1");
                }
                if (flag)
                {
                    preFormActionResponse.AddParameter("fIrmAsAttach", "1");
                }
                result = preFormActionResponse;
            }
            finally
            {
                if (item != null)
                {
                    item.Dispose();
                    item = null;
                }
                if (item2 != null)
                {
                    item2.Dispose();
                    item2 = null;
                }
                if (item3 != null)
                {
                    item3.Dispose();
                    item3 = null;
                }
            }
            return(result);
        }