// Token: 0x06002FBF RID: 12223 RVA: 0x00115BA4 File Offset: 0x00113DA4
        public static void GeneratePrintMessageBody(Item item, TextWriter writer, OwaContext owaContext, bool isEmbeddedItem, string embeddedItemUrl, bool forceAllowWebBeacon, bool forceEnableItemLink)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("context");
            }
            UserContext           userContext = owaContext.UserContext;
            WebBeaconFilterLevels filterWebBeaconsAndHtmlForms = userContext.Configuration.FilterWebBeaconsAndHtmlForms;
            bool flag = JunkEmailUtilities.IsJunkOrPhishing(item, isEmbeddedItem, forceEnableItemLink, userContext);
            OwaSafeHtmlCallbackBase callBack;

            if (!flag)
            {
                if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.DisableFilter || forceAllowWebBeacon || (!Utilities.IsPublic(item) && Utilities.IsWebBeaconsAllowed(item)))
                {
                    callBack = new OwaSafeHtmlAllowWebBeaconCallbacks(item, userContext.IsPublicLogon, isEmbeddedItem, embeddedItemUrl, owaContext, false);
                }
                else
                {
                    callBack = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, isEmbeddedItem, embeddedItemUrl, false, owaContext, false);
                }
            }
            else
            {
                callBack = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, isEmbeddedItem, embeddedItemUrl, true, owaContext, false);
            }
            BodyConversionUtilities.RenderReadBody(writer, item, callBack, flag);
        }
Пример #2
0
        protected void CreateAttachmentHelpers(AttachmentWellType wellType)
        {
            if (JunkEmailUtilities.IsJunkOrPhishing(this.Item, this.IsEmbeddedItem, base.UserContext))
            {
                this.shouldRenderAttachmentWell = false;
                return;
            }
            this.attachmentWellRenderObjects = AttachmentWell.GetAttachmentInformation(this.Item, this.AttachmentLinks, base.UserContext.IsPublicLogon, this.IsEmbeddedItem);
            if (this.attachmentWellRenderObjects != null && this.attachmentWellRenderObjects.Count > 0 && Utilities.IsClearSigned(this.Item))
            {
                AttachmentUtility.RemoveSmimeAttachment(this.attachmentWellRenderObjects);
            }
            if (this.Item is Contact)
            {
                OwaForm.RemoveContactPhoto(this.attachmentWellRenderObjects);
            }
            InfobarRenderingHelper infobarRenderingHelper = new InfobarRenderingHelper(this.attachmentWellRenderObjects);

            if (wellType == AttachmentWellType.ReadOnly && infobarRenderingHelper.HasLevelOneAndBlock)
            {
                this.infobar.AddMessageText(string.Format(CultureInfo.InvariantCulture, LocalizedStrings.GetNonEncoded(-824680214), new object[]
                {
                    infobarRenderingHelper.FileNameStringForLevelOneAndBlock
                }), InfobarMessageType.Informational);
            }
            else if (wellType != AttachmentWellType.ReadOnly && infobarRenderingHelper.HasLevelOneAndBlock)
            {
                this.infobar.AddMessageLocalized(-2118248931, InfobarMessageType.Informational);
            }
            bool flag = AttachmentUtility.IsOutLine(this.attachmentWellRenderObjects);

            this.shouldRenderAttachmentWell = (wellType == AttachmentWellType.ReadWrite || (flag && wellType == AttachmentWellType.ReadOnly && (infobarRenderingHelper.HasLevelTwo || infobarRenderingHelper.HasLevelThree || infobarRenderingHelper.HasWebReadyFirst)));
        }
Пример #3
0
        public void SaveOptions()
        {
            bool isEnabled         = (bool)base.GetParameter("fEnbl");
            bool isContactsTrusted = (bool)base.GetParameter("fTrstCnt");
            bool safeListsOnly     = (bool)base.GetParameter("fSfOnly");

            JunkEmailUtilities.SaveOptions(isEnabled, isContactsTrusted, safeListsOnly, base.UserContext);
        }
Пример #4
0
 internal IRMItemHelper(MessageItem message, UserContext userContext, bool isPreviewForm, bool isEmbeddedItem)
 {
     this.message        = message;
     this.userContext    = userContext;
     this.isPreviewForm  = isPreviewForm;
     this.isEmbeddedItem = isEmbeddedItem;
     this.isIrmMessageInJunkEmailFolder = (message.IsRestricted && JunkEmailUtilities.IsInJunkEmailFolder(message, isEmbeddedItem, userContext));
 }
Пример #5
0
        // Token: 0x06000290 RID: 656 RVA: 0x00016A08 File Offset: 0x00014C08
        private void Remove()
        {
            string formParameter  = Utilities.GetFormParameter(this.request, "hidlst");
            string formParameter2 = Utilities.GetFormParameter(this.request, "sel" + formParameter);

            JunkEmailUtilities.Remove(formParameter2.Split(new char[]
            {
                ','
            }), JunkEmailHelper.GetListType(formParameter), this.userContext);
            this.junkEmailRule = this.userContext.MailboxSession.JunkEmailRule;
        }
Пример #6
0
        // Token: 0x060006A4 RID: 1700 RVA: 0x000344C4 File Offset: 0x000326C4
        internal static InfobarMessage AddEmailToSendersList(UserContext userContext, HttpRequest httpRequest)
        {
            string formParameter  = Utilities.GetFormParameter(httpRequest, "hidsndrslst");
            string formParameter2 = Utilities.GetFormParameter(httpRequest, "hidsndreml");
            string messageText;

            if (JunkEmailUtilities.Add(formParameter2, JunkEmailHelper.GetListType(formParameter), userContext, false, out messageText))
            {
                return(InfobarMessage.CreateText(messageText, InfobarMessageType.Informational));
            }
            return(InfobarMessage.CreateText(messageText, InfobarMessageType.Error));
        }
Пример #7
0
        protected void RenderMessageViewItemMetaDataExpandos(TextWriter writer)
        {
            this.InternalRenderItemMetaDataExpandos(writer);
            if (!this.DataSource.GetItemProperty <bool>(MessageItemSchema.IsRead, true))
            {
                writer.Write(" ");
                writer.Write("read");
                writer.Write("=\"0\"");
            }
            bool itemProperty = this.DataSource.GetItemProperty <bool>(MessageItemSchema.IsDraft, false);

            if (itemProperty)
            {
                writer.Write(" ");
                writer.Write("s");
                writer.Write("=\"Draft\"");
            }
            if (this.viewDescriptor.ContainsColumn(ColumnId.FlagDueDate) || this.viewDescriptor.ContainsColumn(ColumnId.ContactFlagDueDate))
            {
                this.RenderFlagState(writer);
            }
            writer.Write(" ");
            writer.Write("fPhsh");
            int  itemProperty2 = this.DataSource.GetItemProperty <int>(ItemSchema.EdgePcl, 1);
            bool itemProperty3 = this.DataSource.GetItemProperty <bool>(ItemSchema.LinkEnabled, false);

            if (JunkEmailUtilities.IsSuspectedPhishingItem(itemProperty2) && !itemProperty3)
            {
                writer.Write("=1");
            }
            else
            {
                writer.Write("=0");
            }
            bool itemProperty4 = this.DataSource.GetItemProperty <bool>(StoreObjectSchema.IsRestricted, false);

            if (itemProperty4 && base.UserContext.IsIrmEnabled)
            {
                ContentRight itemProperty5 = (ContentRight)this.DataSource.GetItemProperty <int>(MessageItemSchema.DRMRights, 0);
                RenderingUtilities.RenderExpando(writer, "fRplR", itemProperty5.IsUsageRightGranted(ContentRight.Reply) ? 0 : 1);
                RenderingUtilities.RenderExpando(writer, "fRAR", itemProperty5.IsUsageRightGranted(ContentRight.ReplyAll) ? 0 : 1);
                RenderingUtilities.RenderExpando(writer, "fFR", itemProperty5.IsUsageRightGranted(ContentRight.Forward) ? 0 : 1);
            }
            if (ConversationUtilities.IsConversationExcludedType(this.DataSource.GetItemClass()))
            {
                RenderingUtilities.RenderExpando(writer, "fExclCnv", 1);
            }
            this.RenderMeetingRequestExpandos(writer);
            if (this.RenderLastModifiedTime)
            {
                this.RenderLastModifiedTimeExpando(writer);
            }
        }
Пример #8
0
        // Token: 0x06002B6F RID: 11119 RVA: 0x000F3A30 File Offset: 0x000F1C30
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.Message = base.Initialize <MessageItem>(new PropertyDefinition[]
            {
                MessageItemSchema.IsRead,
                BodySchema.Codepage,
                BodySchema.InternetCpid,
                MessageItemSchema.MessageAudioNotes,
                MessageItemSchema.SenderTelephoneNumber,
                ItemSchema.FlagStatus,
                ItemSchema.FlagCompleteTime,
                MessageItemSchema.ReplyTime,
                MessageItemSchema.RequireProtectedPlayOnPhone,
                ItemSchema.UtcDueDate,
                ItemSchema.UtcStartDate,
                ItemSchema.ReminderDueBy,
                ItemSchema.ReminderIsSet,
                StoreObjectSchema.EffectiveRights
            });
            this.IrmItemHelper = new IRMItemHelper(this.Message, base.UserContext, base.IsPreviewForm, base.IsEmbeddedItem);
            using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
            {
                this.isUMEnabled          = umclientCommon.IsUMEnabled();
                this.isPlayOnPhoneEnabled = umclientCommon.IsPlayOnPhoneEnabled();
            }
            this.IrmItemHelper.IrmDecryptIfRestricted();
            bool isSuspectedPhishingItem = false;
            bool isLinkEnabled           = false;
            bool flag = false;

            this.isMacintoshPlatform = (Utilities.GetBrowserPlatform(base.Request.UserAgent) == BrowserPlatform.Macintosh);
            JunkEmailUtilities.GetJunkEmailPropertiesForItem(this.Message, base.IsEmbeddedItem, base.ForceEnableItemLink, base.UserContext, out this.isInJunkEmailFolder, out isSuspectedPhishingItem, out isLinkEnabled, out flag);
            this.toolbar             = new ReadMessageToolbar(base.IsInDeleteItems, base.IsEmbeddedItem, this.Message, this.isInJunkEmailFolder, isSuspectedPhishingItem, isLinkEnabled, false, this.IrmItemHelper.IsReplyRestricted, this.IrmItemHelper.IsReplyAllRestricted, this.IrmItemHelper.IsForwardRestricted, this.IrmItemHelper.IsPrintRestricted);
            this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
            this.recipientWell       = new MessageRecipientWell(this.Message);
            if (flag)
            {
                this.bodyMarkup = Markup.PlainText;
            }
            InfobarMessageBuilder.AddImportance(this.infobar, this.Message);
            InfobarMessageBuilder.AddFlag(this.infobar, this.Message, base.UserContext);
            InfobarMessageBuilder.AddSensitivity(this.infobar, this.Message);
            if (base.UserContext.IsIrmEnabled && Utilities.IsIrmRestrictedAndDecrypted(this.Message))
            {
                InfobarMessageBuilder.AddIrmInformation(this.infobar, this.Message, base.IsPreviewForm, false, false, false);
            }
            if (!this.Message.IsRead && !base.IsPreviewForm && !base.IsEmbeddedItem)
            {
                this.Message.MarkAsRead(Utilities.ShouldSuppressReadReceipt(base.UserContext, this.Message), false);
            }
        }
Пример #9
0
        public void Remove()
        {
            string[] array = ((string)base.GetParameter("sRE")).Split(new char[]
            {
                '|'
            });
            for (int i = 0; i < array.Length; i++)
            {
                array[i] = HttpUtility.HtmlDecode(array[i]);
            }
            JunkEmailListType junkEmailListType = (JunkEmailListType)base.GetParameter("iLT");

            JunkEmailUtilities.Remove(array, junkEmailListType, base.UserContext);
        }
Пример #10
0
        // Token: 0x06002ADE RID: 10974 RVA: 0x000F1774 File Offset: 0x000EF974
        protected void InitializeReadMessageFormElements()
        {
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;

            JunkEmailUtilities.GetJunkEmailPropertiesForItem(this.Message, base.IsEmbeddedItem, base.ForceEnableItemLink, base.UserContext, out this.isInJunkEmailFolder, out flag, out flag2, out flag3);
            this.isSuspectedPhishingItemWithoutLinkEnabled = (flag && !flag2);
            this.toolbar             = new ReadMessageToolbar(base.IsInDeleteItems, base.IsEmbeddedItem, this.Message, this.isInJunkEmailFolder, flag, flag2, true, this.IrmItemHelper != null && this.IrmItemHelper.IsReplyRestricted, this.IrmItemHelper != null && this.IrmItemHelper.IsReplyAllRestricted, this.IrmItemHelper != null && this.IrmItemHelper.IsForwardRestricted, this.IrmItemHelper != null && this.IrmItemHelper.IsPrintRestricted);
            this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
            if (flag3)
            {
                this.bodyMarkup = Markup.PlainText;
            }
            this.recipientWell = new MessageRecipientWell(this.Message);
            RenderingUtilities.RenderReplyForwardMessageStatus(this.Message, this.infobar, base.UserContext);
        }
Пример #11
0
        private T Initialize <T>(bool itemRequired, bool forceAsMessageItem, params PropertyDefinition[] prefetchProperties) where T : Item
        {
            object obj             = null;
            object preFormActionId = base.OwaContext.PreFormActionId;

            if (preFormActionId != null)
            {
                OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)preFormActionId;
                obj = Utilities.GetItem <T>(base.UserContext, owaStoreObjectId, forceAsMessageItem, prefetchProperties);
            }
            else if (this.isEmbeddedItem)
            {
                obj = Utilities.GetItemForRequest <T>(base.OwaContext, out this.parentItem, forceAsMessageItem, prefetchProperties);
            }
            else if (this.itemStoreId != null)
            {
                obj = Utilities.GetItem <T>(base.UserContext, this.itemStoreId, forceAsMessageItem, prefetchProperties);
            }
            else if (this.itemId != null)
            {
                obj = Utilities.GetItem <T>(base.UserContext, this.itemId, forceAsMessageItem, prefetchProperties);
            }
            else if (itemRequired)
            {
                throw new OwaInvalidRequestException("Missing 'id' URL parameter or 'hidid' form parameter");
            }
            this.item = (obj as Item);
            if (this.isEmbeddedItem && this.parentItem != null)
            {
                this.itemId = this.parentItem.Id.ObjectId;
                this.attachmentWellFlags |= AttachmentWell.AttachmentWellFlags.RenderEmbeddedAttachment;
            }
            if (!this.isEmbeddedItem)
            {
                if (this.IsRequestCallbackForPhishing && this.item != null)
                {
                    JunkEmailUtilities.SetLinkEnabled(this.item, prefetchProperties);
                }
                Utilities.SetWebBeaconPolicy(this.IsRequestCallbackForWebBeacons, this.item, prefetchProperties);
            }
            if (obj == null)
            {
                return(default(T));
            }
            return((T)((object)obj));
        }
        // Token: 0x060021EB RID: 8683 RVA: 0x000C1C68 File Offset: 0x000BFE68
        protected override OwaQueryStringParameters GetDefaultItemParameters()
        {
            IListViewDataSource dataSource = ((VirtualListView2)this.listView).DataSource;

            if (dataSource.RangeCount < 1 || Utilities.IsPublic(this.Folder))
            {
                return(null);
            }
            OwaQueryStringParameters owaQueryStringParameters = new OwaQueryStringParameters();

            dataSource.MoveToItem(0);
            bool   flag          = Utilities.IsDefaultFolder(this.Folder, DefaultFolderType.JunkEmail);
            int    itemProperty  = dataSource.GetItemProperty <int>(ItemSchema.EdgePcl, 1);
            bool   itemProperty2 = dataSource.GetItemProperty <bool>(ItemSchema.LinkEnabled, false);
            bool   flag2         = JunkEmailUtilities.IsSuspectedPhishingItem(itemProperty) && !itemProperty2;
            string itemClass     = dataSource.GetItemClass();

            if (ObjectClass.IsOfClass(itemClass, "IPM.Sharing") && !flag && !flag2)
            {
                owaQueryStringParameters.SetApplicationElement("PreFormAction");
                owaQueryStringParameters.Action = "Preview";
            }
            else
            {
                owaQueryStringParameters.SetApplicationElement("Item");
                owaQueryStringParameters.Action = "Preview";
            }
            if ((!flag && !flag2) || ObjectClass.IsOfClass(itemClass, "IPM.Conversation"))
            {
                bool     itemProperty3 = dataSource.GetItemProperty <bool>(MessageItemSchema.IsDraft, false);
                bool     itemProperty4 = dataSource.GetItemProperty <bool>(MessageItemSchema.HasBeenSubmitted, false);
                TaskType itemProperty5 = (TaskType)dataSource.GetItemProperty <int>(TaskSchema.TaskType, 0);
                bool     flag3         = TaskUtilities.IsAssignedTaskType(itemProperty5);
                owaQueryStringParameters.ItemClass = itemClass;
                if ((itemProperty3 && !itemProperty4) || ObjectClass.IsContact(itemClass) || ObjectClass.IsDistributionList(itemClass))
                {
                    owaQueryStringParameters.State = "Draft";
                }
                else if (ObjectClass.IsTask(itemClass) && flag3)
                {
                    owaQueryStringParameters.State = "Assigned";
                }
            }
            owaQueryStringParameters.Id = dataSource.GetItemId();
            return(owaQueryStringParameters);
        }
Пример #13
0
        public void Add()
        {
            string            email             = HttpUtility.HtmlDecode((string)base.GetParameter("sNE"));
            JunkEmailListType junkEmailListType = (JunkEmailListType)base.GetParameter("iLT");
            bool   isFromOptions = (bool)base.GetParameter("fFrmOpt");
            string empty         = string.Empty;
            bool   flag          = false;

            if (!JunkEmailUtilities.Add(email, junkEmailListType, base.UserContext, isFromOptions, out empty))
            {
                flag = true;
            }
            if (flag)
            {
                this.Writer.Write("<div id=fErr>1</div>");
            }
            this.Writer.Write("<div id=sMsg>{0}</div>", Utilities.HtmlEncode(empty));
        }
Пример #14
0
        public void Edit()
        {
            string            oldEmail          = HttpUtility.HtmlDecode((string)base.GetParameter("sOE"));
            string            newEmail          = HttpUtility.HtmlDecode((string)base.GetParameter("sNE"));
            JunkEmailListType junkEmailListType = (JunkEmailListType)base.GetParameter("iLT");
            string            empty             = string.Empty;
            bool flag = false;

            if (!JunkEmailUtilities.Edit(oldEmail, newEmail, junkEmailListType, base.UserContext, true, out empty))
            {
                flag = true;
            }
            if (flag)
            {
                this.Writer.Write("<div id=fErr>1</div>");
            }
            this.Writer.Write("<div id=sMsg>{0}</div>", Utilities.HtmlEncode(empty));
        }
Пример #15
0
        public void AddSender()
        {
            JunkEmailListType junkEmailListType = (JunkEmailListType)base.GetParameter("iLT");
            string            text = (string)base.GetParameter("sId");
            bool flag = (bool)base.GetParameter("fDmn");

            if (OwaStoreObjectId.CreateFromString(text).IsConversationId)
            {
                return;
            }
            string s                 = string.Empty;
            bool   flag2             = false;
            string senderSmtpAddress = Utilities.GetSenderSmtpAddress(text, base.UserContext);

            if (string.IsNullOrEmpty(senderSmtpAddress))
            {
                flag2 = true;
                s     = LocalizedStrings.GetNonEncoded(-562376136);
            }
            else
            {
                int num = senderSmtpAddress.IndexOf('@');
                if (num < 0)
                {
                    flag2 = true;
                    s     = LocalizedStrings.GetNonEncoded(-562376136);
                }
                else
                {
                    int length = senderSmtpAddress.Length;
                    if (!JunkEmailUtilities.Add(flag ? senderSmtpAddress.Substring(num, length - num) : senderSmtpAddress, junkEmailListType, base.UserContext, false, out s))
                    {
                        flag2 = true;
                    }
                }
            }
            if (flag2)
            {
                this.Writer.Write("<div id=fErr>1</div>");
            }
            this.Writer.Write("<div id=sMsg>{0}</div>", Utilities.HtmlEncode(s));
        }
Пример #16
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.post = base.Initialize <PostItem>(ReadPost.prefetchProperties);
            if (!base.IsPreviewForm && !base.IsEmbeddedItem)
            {
                this.post.MarkAsRead(false);
            }
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;

            JunkEmailUtilities.GetJunkEmailPropertiesForItem(this.post, base.IsEmbeddedItem, base.ForceEnableItemLink, base.UserContext, out this.isInJunkmailFolder, out flag, out flag2, out flag3);
            this.isSuspectedPhishingItemWithoutLinkEnabled = (flag && !flag2);
            this.toolbar = new ReadPostToolbar(base.IsEmbeddedItem, base.Item);
            InfobarMessageBuilder.AddImportance(this.infobar, this.post);
            InfobarMessageBuilder.AddSensitivity(this.infobar, this.post);
            InfobarMessageBuilder.AddFlag(this.infobar, this.post, base.UserContext);
            InfobarMessageBuilder.AddCompliance(base.UserContext, this.infobar, this.post, false);
        }
Пример #17
0
        // Token: 0x0600028E RID: 654 RVA: 0x000168D8 File Offset: 0x00014AD8
        private void Add()
        {
            string formParameter = Utilities.GetFormParameter(this.request, "hidlst");
            string text          = Utilities.GetFormParameter(this.request, "txt" + formParameter).Trim();

            if (string.IsNullOrEmpty(text))
            {
                return;
            }
            string message;

            if (JunkEmailUtilities.Add(text, JunkEmailHelper.GetListType(formParameter), this.userContext, true, out message))
            {
                base.SetInfobarMessage(message, InfobarMessageType.Informational);
                this.junkEmailRule = this.userContext.MailboxSession.JunkEmailRule;
                return;
            }
            base.SetInfobarMessage(message, InfobarMessageType.Error);
            this.initialInputs[formParameter] = text;
        }
Пример #18
0
        internal T Initialize <T>(bool itemRequired, bool forceAsMessageItem, string id, string action, params PropertyDefinition[] prefetchProperties) where T : Item
        {
            object obj             = null;
            object preFormActionId = this.OwaContext.PreFormActionId;

            if (preFormActionId != null)
            {
                OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)preFormActionId;
                obj = Utilities.GetItem <T>(this.UserContext, owaStoreObjectId, forceAsMessageItem, prefetchProperties);
            }
            else if (!string.IsNullOrEmpty(id))
            {
                obj = Utilities.GetItemById <T>(this.OwaContext, out this.parentItem, id, forceAsMessageItem, prefetchProperties);
            }
            else if (itemRequired)
            {
                throw new OwaInvalidRequestException("Missing 'id' URL parameter");
            }
            this.item = (obj as Item);
            this.isEmbeddedItemInNonSMimeItem = (Utilities.GetQueryStringParameter(this.Request, "attcnt", false) != null);
            this.isEmbeddedItemInSMimeMessage = (Utilities.GetQueryStringParameter(this.Request, "smemb", false) != null);
            this.isPreviewForm = (action != null && action.Equals("Preview"));
            if (this.item != null && !this.IsEmbeddedItem && !this.IsPublicItem)
            {
                if (this.IsRequestCallbackForPhishing)
                {
                    JunkEmailUtilities.SetLinkEnabled(this.item, prefetchProperties);
                }
                Utilities.SetWebBeaconPolicy(this.IsRequestCallbackForWebBeacons, this.item, prefetchProperties);
                if (this.IsRequestCallbackForRemoveIRM)
                {
                    Utilities.IrmRemoveRestriction(this.item, this.UserContext);
                }
            }
            if (obj == null)
            {
                return(default(T));
            }
            return((T)((object)obj));
        }
Пример #19
0
        // Token: 0x0600028D RID: 653 RVA: 0x000167C0 File Offset: 0x000149C0
        private void SaveChanges()
        {
            string formParameter = Utilities.GetFormParameter(this.request, "rdoJnk", false);

            this.isEnabled = (formParameter != null && formParameter == "1");
            if (this.isEnabled)
            {
                this.isContactsTrusted = (Utilities.GetFormParameter(this.request, "chkTrstCnt", false) != null);
                this.safeListsOnly     = (Utilities.GetFormParameter(this.request, "chkSfOnly", false) != null);
            }
            string command;

            if ((command = base.Command) != null)
            {
                if (command == "a")
                {
                    this.Add();
                    return;
                }
                if (command == "e")
                {
                    this.Edit();
                    return;
                }
                if (command == "r")
                {
                    this.Remove();
                    return;
                }
                if (command == "save")
                {
                    JunkEmailUtilities.SaveOptions(this.isEnabled, this.isContactsTrusted, this.safeListsOnly, this.userContext);
                    base.SetSavedSuccessfully(true);
                    this.junkEmailRule = this.userContext.MailboxSession.JunkEmailRule;
                    return;
                }
            }
            throw new OwaInvalidRequestException("Unknown command");
        }
Пример #20
0
        // Token: 0x06002916 RID: 10518 RVA: 0x000E8828 File Offset: 0x000E6A28
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "t");

            this.MeetingPageWriterFactory(queryStringParameter, e);
            JunkEmailUtilities.GetJunkEmailPropertiesForItem(base.Item, base.IsEmbeddedItem, base.ForceEnableItemLink, base.UserContext, out this.isInJunkEmailFolder, out this.isSuspectedPhishingItem, out this.itemLinkEnabled, out this.isJunkOrPhishing);
            if (this.isJunkOrPhishing)
            {
                this.bodyMarkup = Markup.PlainText;
            }
            if (!ObjectClass.IsCalendarItemCalendarItemOccurrenceOrRecurrenceException(queryStringParameter) && !base.IsPreviewForm)
            {
                MeetingMessage meetingMessage = base.Item as MeetingMessage;
                if (meetingMessage == null)
                {
                    throw new OwaInvalidOperationException("Item must be of MeetingMessage type");
                }
                if (meetingMessage != null && !meetingMessage.IsRead)
                {
                    meetingMessage.MarkAsRead(Utilities.ShouldSuppressReadReceipt(base.UserContext, meetingMessage), false);
                }
            }
            object obj = base.Item.TryGetProperty(ItemSchema.SentTime);

            if (obj != null && !(obj is PropertyError))
            {
                this.sentTime = (ExDateTime)obj;
            }
            if (this.sharedFromOlderVersion)
            {
                this.meetingPageWriter.FormInfobar.AddMessage(SanitizedHtmlString.Format(LocalizedStrings.GetNonEncoded(1896884103), new object[]
                {
                    this.receiverDisplayName
                }), InfobarMessageType.Informational);
            }
        }
Пример #21
0
        protected void RenderMessageViewItemMetaDataExpandos(TextWriter writer)
        {
            this.InternalRenderItemMetaDataExpandos(writer);
            if (!this.DataSource.GetItemProperty <bool>(MessageItemSchema.IsRead, true))
            {
                writer.Write(" ");
                writer.Write("read");
                writer.Write("=\"0\"");
            }
            bool itemProperty  = this.DataSource.GetItemProperty <bool>(MessageItemSchema.IsDraft, false);
            bool itemProperty2 = this.DataSource.GetItemProperty <bool>(MessageItemSchema.HasBeenSubmitted, false);

            if (itemProperty && !itemProperty2)
            {
                writer.Write(" ");
                writer.Write("s");
                writer.Write("=\"Draft\"");
            }
            if (this.viewDescriptor.ContainsColumn(ColumnId.FlagDueDate) || this.viewDescriptor.ContainsColumn(ColumnId.ContactFlagDueDate))
            {
                this.RenderFlagState(writer);
            }
            writer.Write(" ");
            writer.Write("fPhsh");
            int  itemProperty3 = this.DataSource.GetItemProperty <int>(ItemSchema.EdgePcl, 1);
            bool itemProperty4 = this.DataSource.GetItemProperty <bool>(ItemSchema.LinkEnabled, false);

            if (JunkEmailUtilities.IsSuspectedPhishingItem(itemProperty3) && !itemProperty4)
            {
                writer.Write("=1");
            }
            else
            {
                writer.Write("=0");
            }
            this.RenderMeetingRequestExpandos(writer);
        }
Пример #22
0
 // Token: 0x06000602 RID: 1538 RVA: 0x00030312 File Offset: 0x0002E512
 public void RenderHeaderToolbar()
 {
     ReadMessageToolbarUtility.BuildHeaderToolbar(base.UserContext, base.Response.Output, base.IsEmbeddedItem, this.message, this.isJunk, JunkEmailUtilities.IsSuspectedPhishingItem(this.message), JunkEmailUtilities.IsItemLinkEnabled(this.message));
 }
        // 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);
        }
        // Token: 0x06002FBE RID: 12222 RVA: 0x00115A4C File Offset: 0x00113C4C
        public static bool GenerateEditableMessageBodyAndRenderInfobarMessages(Item item, TextWriter writer, NewItemType newItemType, OwaContext owaContext, ref bool shouldPromptUserOnFormLoad, ref bool hasInlineImages, Infobar infobar, bool allowWebBeacon, Markup markup)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (infobar == null)
            {
                throw new ArgumentNullException("infobar");
            }
            if (owaContext == null)
            {
                throw new ArgumentNullException("context");
            }
            UserContext userContext = owaContext.UserContext;
            OwaSafeHtmlOutboundCallbacks owaSafeHtmlOutboundCallbacks = null;
            WebBeaconFilterLevels        filterWebBeaconsAndHtmlForms = userContext.Configuration.FilterWebBeaconsAndHtmlForms;
            bool flag = false;

            if (item != null)
            {
                flag = JunkEmailUtilities.IsJunkOrPhishing(item, false, userContext);
                if (!flag)
                {
                    if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.DisableFilter || allowWebBeacon || (!Utilities.IsPublic(item) && Utilities.IsWebBeaconsAllowed(item)))
                    {
                        owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlAllowWebBeaconCallbacks(item, userContext.IsPublicLogon, owaContext, true);
                    }
                    else if (filterWebBeaconsAndHtmlForms != WebBeaconFilterLevels.DisableFilter && (newItemType == NewItemType.Reply || newItemType == NewItemType.Forward || newItemType == NewItemType.ExplicitDraft || newItemType == NewItemType.PostReply) && !allowWebBeacon)
                    {
                        owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlRemoveWebBeaconCallbacks(item, userContext.IsPublicLogon, owaContext, true);
                    }
                    else
                    {
                        owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, false, owaContext, true);
                    }
                }
                else
                {
                    owaSafeHtmlOutboundCallbacks = new OwaSafeHtmlOutboundCallbacks(item, userContext.IsPublicLogon, true, owaContext, true);
                }
            }
            if (flag)
            {
                markup = Markup.PlainText;
            }
            BodyConversionUtilities.RenderComposeBody(writer, item, owaSafeHtmlOutboundCallbacks, userContext, markup);
            if (owaSafeHtmlOutboundCallbacks != null)
            {
                hasInlineImages = owaSafeHtmlOutboundCallbacks.HasInlineImages;
            }
            if (item != null)
            {
                if (!flag && (owaSafeHtmlOutboundCallbacks.HasBlockedImages || owaSafeHtmlOutboundCallbacks.HasBlockedForms))
                {
                    if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.UserFilterChoice)
                    {
                        shouldPromptUserOnFormLoad = true;
                    }
                    else if (filterWebBeaconsAndHtmlForms == WebBeaconFilterLevels.ForceFilter)
                    {
                        infobar.AddMessage(SanitizedHtmlString.FromStringId(-1196115124), InfobarMessageType.Informational, "divIbImg");
                    }
                }
                if (owaSafeHtmlOutboundCallbacks.HasRtfEmbeddedImages)
                {
                    infobar.AddMessage(1338319428, InfobarMessageType.Informational);
                }
                if (!ObjectClass.IsCalendarItemCalendarItemOccurrenceOrRecurrenceException(item.ClassName))
                {
                    return(owaSafeHtmlOutboundCallbacks.ApplyAttachmentsUpdates(item));
                }
            }
            return(false);
        }
        // Token: 0x06002FBB RID: 12219 RVA: 0x001156A4 File Offset: 0x001138A4
        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("context");
            }
            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);
            OwaSafeHtmlOutboundCallbacks owaSafeHtmlOutboundCallbacks;

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

            if (flag)
            {
                if (flag2)
                {
                    infobar.AddMessage(SanitizedHtmlString.Format("{0} {1}", new object[]
                    {
                        LocalizedStrings.GetNonEncoded(1581910613),
                        LocalizedStrings.GetNonEncoded(-2026026928)
                    }), InfobarMessageType.Phishing);
                }
                else if (userContext.IsJunkEmailEnabled)
                {
                    infobar.AddMessage(SanitizedHtmlString.Format("{0} {1}", new object[]
                    {
                        LocalizedStrings.GetNonEncoded(59853257),
                        LocalizedStrings.GetNonEncoded(-2129859766)
                    }), InfobarMessageType.JunkEmail);
                }
            }
            else if (flag2 && !flag3)
            {
                string s = "<a id=\"aIbBlk\" href=\"#\"" + SanitizedHtmlString.Format("_sIT=\"{0}\" _sAct=\"{1}\" _iSt=\"{2}\" _fPhsh=1 _fAWB={3}", new object[]
                {
                    itemType,
                    action,
                    state,
                    allowWebBeacon ? 1 : 0
                }) + string.Format(CultureInfo.InvariantCulture, ">{0}</a> {1} ", new object[]
                {
                    LocalizedStrings.GetHtmlEncoded(-672110188),
                    LocalizedStrings.GetHtmlEncoded(-1020475744)
                });
                string s2 = string.Format(CultureInfo.InvariantCulture, "<a href=\"#\" " + Utilities.GetScriptHandler("onclick", "opnHlp(\"" + Utilities.JavascriptEncode(Utilities.BuildEhcHref(HelpIdsLight.EmailSafetyLight.ToString())) + "\");") + ">{0}</a>", new object[]
                {
                    LocalizedStrings.GetHtmlEncoded(338562664)
                });
                infobar.AddMessage(SanitizedHtmlString.Format("{0}{1}{2}", new object[]
                {
                    SanitizedHtmlString.FromStringId(1581910613),
                    SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s),
                    SanitizedHtmlString.GetSanitizedStringWithoutEncoding(s2)
                }), InfobarMessageType.Phishing);
            }
            else if (flag5)
            {
                infobar.AddMessage(BodyConversionUtilities.GetWebBeaconBlockedInfobarMessage(filterWebBeaconsAndHtmlForms, SanitizedHtmlString.Format("_sIT=\"{0}\" _sAct=\"{1}\" _iSt=\"{2}\" _fPhsh={3} _fAWB=1", new object[]
                {
                    itemType,
                    action,
                    state,
                    forceEnableItemLink ? 1 : 0
                }).ToString()), InfobarMessageType.Informational);
            }
            if (owaSafeHtmlOutboundCallbacks.HasRtfEmbeddedImages)
            {
                infobar.AddMessage(1338319428, InfobarMessageType.Informational);
            }
            return(owaSafeHtmlOutboundCallbacks.AttachmentLinks);
        }
Пример #26
0
        // Token: 0x060006A3 RID: 1699 RVA: 0x00034310 File Offset: 0x00032510
        internal static InfobarMessage MarkAsNotJunk(UserContext userContext, params StoreObjectId[] ids)
        {
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            if (ids == null)
            {
                throw new ArgumentNullException("ids");
            }
            InfobarMessage result = null;
            string         defaultFolderDisplayName = Utilities.GetDefaultFolderDisplayName(userContext.MailboxSession, DefaultFolderType.Inbox);

            if (ids.Length == 1)
            {
                SanitizedHtmlString sanitizedHtmlString = SanitizedHtmlString.Empty;
                string text;
                try
                {
                    text = Utilities.GetSenderSmtpAddress(ids[0].ToBase64String(), userContext);
                }
                catch (ObjectNotFoundException)
                {
                    text = null;
                }
                if (!string.IsNullOrEmpty(text) && userContext.IsJunkEmailEnabled && !JunkEmailUtilities.IsInternalToOrganization(text, userContext))
                {
                    sanitizedHtmlString = JunkEmailHelper.BuildAddToListLinkString(JunkEmailListType.SafeSenders, text);
                }
                AggregateOperationResult aggregateOperationResult = userContext.MailboxSession.Move(userContext.InboxFolderId, ids);
                if (aggregateOperationResult.OperationResult == OperationResult.Succeeded)
                {
                    if (SanitizedStringBase <OwaHtml> .IsNullOrEmpty(sanitizedHtmlString))
                    {
                        result = InfobarMessage.CreateText(string.Format(LocalizedStrings.GetNonEncoded(-1881687711), defaultFolderDisplayName, sanitizedHtmlString), InfobarMessageType.Informational);
                    }
                    else
                    {
                        result = InfobarMessage.CreateHtml(SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(-1881687711), new object[]
                        {
                            defaultFolderDisplayName,
                            sanitizedHtmlString
                        }), InfobarMessageType.Informational);
                    }
                }
                else if (SanitizedStringBase <OwaHtml> .IsNullOrEmpty(sanitizedHtmlString))
                {
                    result = InfobarMessage.CreateText(string.Format(LocalizedStrings.GetNonEncoded(300728662), sanitizedHtmlString), InfobarMessageType.Informational);
                }
                else
                {
                    result = InfobarMessage.CreateHtml(SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(300728662), new object[]
                    {
                        sanitizedHtmlString
                    }), InfobarMessageType.Informational);
                }
            }
            else
            {
                AggregateOperationResult aggregateOperationResult2 = userContext.MailboxSession.Move(userContext.InboxFolderId, ids);
                switch (aggregateOperationResult2.OperationResult)
                {
                case OperationResult.Succeeded:
                    result = InfobarMessage.CreateText(string.Format(LocalizedStrings.GetNonEncoded(1632419544), defaultFolderDisplayName), InfobarMessageType.Informational);
                    break;

                case OperationResult.Failed:
                    result = InfobarMessage.CreateLocalized(1682703853, InfobarMessageType.Informational);
                    break;

                case OperationResult.PartiallySucceeded:
                    result = InfobarMessage.CreateLocalized(521322677, InfobarMessageType.Informational);
                    break;
                }
            }
            return(result);
        }
Пример #27
0
 internal static bool ShouldRenderReadReceiptNoticeInfobar(UserContext userContext, IStorePropertyBag storePropertyBag)
 {
     if (userContext == null)
     {
         throw new ArgumentNullException("userContext");
     }
     if (storePropertyBag == null)
     {
         throw new ArgumentNullException("storePropertyBag");
     }
     return(userContext.UserOptions.ReadReceipt == ReadReceiptResponse.DoNotAutomaticallySend && ItemUtility.GetProperty <bool>(storePropertyBag, MessageItemSchema.IsReadReceiptPending, false) && !JunkEmailUtilities.IsInJunkEmailFolder(storePropertyBag, false, userContext));
 }
Пример #28
0
 private bool IsPhishingItemWithEnabledLinks()
 {
     return(base.IsSuspectedPhishingItem && !JunkEmailUtilities.IsItemLinkEnabled(this.meetingRequest));
 }