Exemple #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (Utilities.GetQueryStringParameter(base.Request, "atttyp", false) != null && Utilities.GetQueryStringParameter(base.Request, "atttyp", false) == "embdd")
            {
                this.isEmbeddedItem = true;
            }
            string text  = null;
            string text2 = null;

            this.itemId = QueryStringUtilities.CreateItemStoreObjectId(base.UserContext.MailboxSession, base.Request, false);
            if (this.itemId == null)
            {
                if (Utilities.IsPostRequest(base.Request))
                {
                    text  = Utilities.GetFormParameter(base.Request, "hidid", false);
                    text2 = Utilities.GetFormParameter(base.Request, "hidchk", false);
                }
                if (!string.IsNullOrEmpty(text2))
                {
                    this.itemStoreId = Utilities.CreateItemId(base.UserContext.MailboxSession, text, text2);
                }
                if (!string.IsNullOrEmpty(text))
                {
                    this.itemId = Utilities.CreateStoreObjectId(base.UserContext.MailboxSession, text);
                }
            }
        }
        private bool LoadMessage()
        {
            StoreObjectId storeObjectId = QueryStringUtilities.CreateItemStoreObjectId(base.UserContext.MailboxSession, base.Request, false);

            if (storeObjectId != null)
            {
                base.Item = (this.message = Utilities.GetItem <MessageItem>(base.UserContext, storeObjectId, new PropertyDefinition[0]));
                return(false);
            }
            string formParameter  = Utilities.GetFormParameter(base.Request, "hidid", false);
            string formParameter2 = Utilities.GetFormParameter(base.Request, "hidchk", false);

            if (Utilities.IsPostRequest(base.Request) && !string.IsNullOrEmpty(formParameter) && !string.IsNullOrEmpty(formParameter2))
            {
                storeObjectId = Utilities.CreateStoreObjectId(base.UserContext.MailboxSession, formParameter);
                base.Item     = (this.message = Utilities.GetItem <MessageItem>(base.UserContext, storeObjectId, formParameter2, new PropertyDefinition[0]));
            }
            if (this.message == null)
            {
                string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "email", false);
                if (!string.IsNullOrEmpty(queryStringParameter))
                {
                    StoreObjectId storeObjectId2 = null;
                    if (MailToParser.TryParseMailTo(queryStringParameter, base.UserContext, out storeObjectId2))
                    {
                        storeObjectId = storeObjectId2;
                        base.Item     = (this.message = Utilities.GetItem <MessageItem>(base.UserContext, storeObjectId, new PropertyDefinition[0]));
                    }
                }
            }
            return(true);
        }
        // Token: 0x0600027E RID: 638 RVA: 0x000154FC File Offset: 0x000136FC
        protected override void OnLoad(EventArgs e)
        {
            this.callTracer.TraceDebug((long)this.GetHashCode(), "ListViewPage.OnLoad");
            this.errorMessage = string.Empty;
            this.folderId     = QueryStringUtilities.CreateFolderStoreObjectId(base.UserContext.MailboxSession, base.Request, false);
            if (this.folderId == null)
            {
                this.algorithmTracer.TraceDebug((long)this.GetHashCode(), "folderId is null, using default folder");
                this.folderId = this.DefaultFolderId;
            }
            else if (!Folder.IsFolderId(this.folderId))
            {
                throw new OwaInvalidRequestException("The given Id is not a valid folder Id. Folder Id:" + this.folderId);
            }
            bool newSearch = base.UserContext.ForceNewSearch;

            this.GetSearchStringAndScope();
            bool      flag      = false;
            ColumnId  value     = this.DefaultSortedColumn;
            SortOrder sortOrder = this.DefaultSortOrder;

            if (base.IsPostFromMyself())
            {
                string formParameter = Utilities.GetFormParameter(base.Request, "hidcmdpst", false);
                string key;
                if ((key = formParameter) != null)
                {
                    if (< PrivateImplementationDetails > { 30BFC313 - DE03 - 42E1 - 890C - A081E6097637 }.$$method0x6000270 - 1 == null)
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "ctx");
            int    num;

            if (!int.TryParse(queryStringParameter, out num))
            {
                throw new OwaInvalidRequestException("Context parameter is having invalid format");
            }
            if (num < 0 || num > 4)
            {
                throw new OwaInvalidRequestException("Invalid context value in the querystring parameter");
            }
            this.viewMode = (AddressBook.Mode)num;
            if (this.viewMode == AddressBook.Mode.None)
            {
                this.viewMode = AddressBook.Mode.Lookup;
            }
            if (base.IsPostFromMyself())
            {
                this.action              = Utilities.GetFormParameter(base.Request, "hidcmdpst", false);
                this.searchString        = Utilities.GetFormParameter(base.Request, "hidss", false);
                this.pageNumber          = RequestParser.TryGetIntValueFromForm(base.Request, "hidpg", 1);
                this.sortColumn          = (ColumnId)RequestParser.TryGetIntValueFromForm(base.Request, "hidcid", 11);
                this.sortOrder           = (SortOrder)RequestParser.TryGetIntValueFromForm(base.Request, "hidso", 1);
                this.addressBookToSearch = Utilities.GetFormParameter(base.Request, "hidAB", false);
                if (string.IsNullOrEmpty(this.addressBookToSearch))
                {
                    throw new OwaInvalidRequestException("addressbookGuid can't be null");
                }
                this.recipientWell = (RecipientItemType)RequestParser.TryGetIntValueFromForm(base.Request, "hidrw", 1);
            }
            else
            {
                this.searchString = Utilities.GetQueryStringParameter(base.Request, "sch", false);
                if (!string.IsNullOrEmpty(this.searchString))
                {
                    Utilities.VerifySearchCanaryInGetRequest(base.Request);
                }
                this.pageNumber          = RequestParser.TryGetIntValueFromQueryString(base.Request, "pg", 1);
                this.sortColumn          = (ColumnId)RequestParser.TryGetIntValueFromQueryString(base.Request, "cid", 11);
                this.sortOrder           = (SortOrder)RequestParser.TryGetIntValueFromQueryString(base.Request, "so", 1);
                this.addressBookToSearch = Utilities.GetQueryStringParameter(base.Request, "ab", false);
                this.recipientWell       = (RecipientItemType)RequestParser.TryGetIntValueFromQueryString(base.Request, "rw", 1);
            }
            this.GetSearchLocation();
            if (AddressBook.IsEditingMode(this.viewMode))
            {
                if (!base.IsPostFromMyself())
                {
                    bool          required = this.viewMode != AddressBook.Mode.EditCalendar;
                    StoreObjectId itemId   = QueryStringUtilities.CreateItemStoreObjectId(base.UserContext.MailboxSession, base.Request, required);
                    base.Item = AddressBookHelper.GetItem(base.UserContext, this.viewMode, itemId, null);
                }
                else
                {
                    StoreObjectId itemId2       = null;
                    string        formParameter = Utilities.GetFormParameter(base.Request, "hidid", true);
                    if (!string.IsNullOrEmpty(formParameter))
                    {
                        itemId2 = Utilities.CreateStoreObjectId(base.UserContext.MailboxSession, formParameter);
                    }
                    string formParameter2 = Utilities.GetFormParameter(base.Request, "hidchk", true);
                    base.Item = AddressBookHelper.GetItem(base.UserContext, this.viewMode, itemId2, formParameter2);
                    string a;
                    if ((a = this.action) != null)
                    {
                        if (!(a == "addrcp"))
                        {
                            if (a == "rmrcp")
                            {
                                int intValueFromForm = RequestParser.GetIntValueFromForm(base.Request, "hidri");
                                if (this.viewMode == AddressBook.Mode.EditMessage || this.viewMode == AddressBook.Mode.EditMeetingResponse)
                                {
                                    if (intValueFromForm >= 0 && intValueFromForm < this.Message.Recipients.Count)
                                    {
                                        this.Message.Recipients.RemoveAt(intValueFromForm);
                                        AddressBookHelper.SaveItem(base.Item);
                                    }
                                }
                                else if (this.viewMode == AddressBook.Mode.EditCalendar)
                                {
                                    CalendarUtilities.RemoveAttendeeAt(this.CalendarItemBase, intValueFromForm);
                                    EditCalendarItemHelper.CreateUserContextData(base.UserContext, this.CalendarItemBase);
                                }
                            }
                        }
                        else
                        {
                            int num2 = RequestParser.TryGetIntValueFromQueryString(base.Request, "rt", 1);
                            if (num2 == 1)
                            {
                                this.type = RecipientItemType.To;
                            }
                            else if (num2 == 2)
                            {
                                this.type = RecipientItemType.Cc;
                            }
                            else if (num2 == 3)
                            {
                                this.type = RecipientItemType.Bcc;
                            }
                            string text = base.Request.Form["chkRcpt"];
                            if (!string.IsNullOrEmpty(text))
                            {
                                this.ids = text.Split(new char[]
                                {
                                    ','
                                });
                                if (this.searchLocation == AddressBook.SearchLocation.AddressBook)
                                {
                                    AddressBookHelper.AddRecipientsToDraft(this.ids, base.Item, this.type, base.UserContext);
                                }
                                else
                                {
                                    AddressBookHelper.AddContactsToDraft(base.Item, this.type, base.UserContext, this.ids);
                                }
                            }
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(this.searchString))
            {
                this.searchString = this.searchString.Trim();
                if (this.searchString.Length > Globals.MaxSearchStringLength)
                {
                    throw new OwaInvalidRequestException("Search string length is more than 256 characters");
                }
            }
            if (this.pageNumber == 0)
            {
                this.pageNumber = 1;
            }
            this.firstItemOnPage = (this.pageNumber - 1) * base.UserContext.UserOptions.BasicViewRowCount + 1;
            this.lastItemOnPage  = this.firstItemOnPage + base.UserContext.UserOptions.BasicViewRowCount - 1;
            this.CreateListView();
            if (AddressBook.IsEditingMode(this.viewMode) || !string.IsNullOrEmpty(this.searchString))
            {
                base.UserContext.LastClientViewState = new AddressBookSearchViewState(base.UserContext.LastClientViewState, this.viewMode, this.addressBookToSearch, this.searchString, this.pageNumber, (base.Item == null || base.Item.Id == null) ? null : base.Item.Id.ObjectId, (base.Item == null || base.Item.Id == null) ? null : base.Item.Id.ChangeKeyAsBase64String(), this.recipientWell, this.sortColumn, this.sortOrder);
                return;
            }
            base.UserContext.LastClientViewState = new AddressBookViewState(base.UserContext.LastClientViewState, this.viewMode, this.pageNumber, (base.Item == null || base.Item.Id == null) ? null : base.Item.Id.ObjectId, (base.Item == null || base.Item.Id == null) ? null : base.Item.Id.ChangeKeyAsBase64String(), this.recipientWell, this.sortColumn, this.sortOrder);
        }
Exemple #5
0
 public static StoreObjectId CreateFolderStoreObjectId(MailboxSession mailboxSession, HttpRequest httpRequest)
 {
     return(QueryStringUtilities.CreateStoreObjectId(mailboxSession, httpRequest, "id", true));
 }
Exemple #6
0
 public static StoreObjectId CreateItemStoreObjectId(MailboxSession mailboxSession, HttpRequest httpRequest, bool required)
 {
     return(QueryStringUtilities.CreateStoreObjectId(mailboxSession, httpRequest, "id", required));
 }
Exemple #7
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]);
        }