Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        protected override void OnLoad(EventArgs e)
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "Basic.CalendarView.OnLoad");
            EditCalendarItemHelper.ClearUserContextData(base.UserContext);
            this.folderId = QueryStringUtilities.CreateFolderStoreObjectId(base.UserContext.MailboxSession, base.Request, false);
            if (this.folderId == null)
            {
                ExTraceGlobals.CalendarTracer.TraceDebug((long)this.GetHashCode(), "folderId is null, using default folder");
                this.folderId = base.UserContext.CalendarFolderId;
            }
            if (this.folderId == null)
            {
                throw new OwaInvalidRequestException("Invalid folder id");
            }
            StorePropertyDefinition displayName                 = StoreObjectSchema.DisplayName;
            PropertyDefinition      calendarViewType            = ViewStateProperties.CalendarViewType;
            PropertyDefinition      readingPanePosition         = ViewStateProperties.ReadingPanePosition;
            PropertyDefinition      readingPanePositionMultiDay = ViewStateProperties.ReadingPanePositionMultiDay;
            PropertyDefinition      viewWidth     = ViewStateProperties.ViewWidth;
            PropertyDefinition      dailyViewDays = ViewStateProperties.DailyViewDays;

            this.viewType = CalendarViewType.Min;
            string queryStringParameter  = Utilities.GetQueryStringParameter(base.Request, "dy", false);
            string queryStringParameter2 = Utilities.GetQueryStringParameter(base.Request, "mn", false);
            string queryStringParameter3 = Utilities.GetQueryStringParameter(base.Request, "yr", false);
            int    day;
            int    month;
            int    year;

            if (!string.IsNullOrEmpty(queryStringParameter) && int.TryParse(queryStringParameter, out day) && !string.IsNullOrEmpty(queryStringParameter2) && int.TryParse(queryStringParameter2, out month) && !string.IsNullOrEmpty(queryStringParameter3) && int.TryParse(queryStringParameter3, out year))
            {
                try
                {
                    ExDateTime exDateTime = new ExDateTime(base.UserContext.TimeZone, year, month, day);
                    this.days    = new ExDateTime[1];
                    this.days[0] = exDateTime.Date;
                }
                catch (ArgumentOutOfRangeException)
                {
                    base.Infobar.AddMessageLocalized(883484089, InfobarMessageType.Error);
                }
            }
            if (this.days == null)
            {
                this.days    = new ExDateTime[1];
                this.days[0] = DateTimeUtilities.GetLocalTime().Date;
            }
            this.calendarAdapter = new CalendarAdapter(base.UserContext, this.folderId);
            this.calendarAdapter.LoadData(DailyView.QueryProperties, this.days, false, true);
            this.dailyView = new DailyView(base.UserContext, this.calendarAdapter);
            base.OnLoad(e);
            if (base.IsPostFromMyself())
            {
                string formParameter = Utilities.GetFormParameter(base.Request, "hidcmdpst", false);
                if (string.CompareOrdinal(formParameter, "addjnkeml") == 0)
                {
                    if (!base.UserContext.IsJunkEmailEnabled)
                    {
                        throw new OwaInvalidRequestException(LocalizedStrings.GetNonEncoded(552277155));
                    }
                    InfobarMessage infobarMessage = JunkEmailHelper.AddEmailToSendersList(base.UserContext, base.Request);
                    if (infobarMessage != null)
                    {
                        base.Infobar.AddMessage(infobarMessage);
                    }
                }
            }
            base.UserContext.LastClientViewState = new CalendarModuleViewState(this.folderId, this.calendarAdapter.ClassName, this.days[0]);
        }