Beispiel #1
0
        public void RemoveOtherInbox()
        {
            base.ThrowIfCannotActAsOwner();
            OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("Id");

            if (owaStoreObjectId.MailboxOwnerLegacyDN == null)
            {
                throw new OwaInvalidRequestException("Can't find legacyDN information.");
            }
            OtherMailboxConfiguration.RemoveOtherMailbox(base.UserContext, owaStoreObjectId.MailboxOwnerLegacyDN);
            try
            {
                MailboxSession mailboxSession  = owaStoreObjectId.GetSession(base.UserContext) as MailboxSession;
                StoreObjectId  defaultFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.Inbox);
                if (defaultFolderId != null)
                {
                    OwaStoreObjectId owaStoreObjectId2 = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, defaultFolderId);
                    if (base.UserContext.IsPushNotificationsEnabled)
                    {
                        base.UserContext.MapiNotificationManager.UnsubscribeFolderCounts(owaStoreObjectId2, mailboxSession);
                        base.UserContext.MapiNotificationManager.UnsubscribeFolderChanges(owaStoreObjectId2, mailboxSession);
                    }
                    if (base.UserContext.IsPullNotificationsEnabled)
                    {
                        base.UserContext.NotificationManager.DeleteDelegateFolderCountAdvisor(owaStoreObjectId2);
                        base.UserContext.NotificationManager.DeleteOwaConditionAdvisor(owaStoreObjectId2);
                    }
                }
            }
            catch (ObjectNotFoundException arg)
            {
                ExTraceGlobals.CoreCallTracer.TraceDebug <ObjectNotFoundException>(0L, "NavigationNodeEventHandler.RemoveOtherInbox() exception {0}", arg);
            }
        }
Beispiel #2
0
        // Token: 0x06002434 RID: 9268 RVA: 0x000D1444 File Offset: 0x000CF644
        internal static void RenderMailSecondaryNavigation(TextWriter output, UserContext userContext)
        {
            if (output == null)
            {
                throw new ArgumentNullException("output");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            output.Write("<div id=\"divMTrR\">");
            Infobar infobar = new Infobar("divErrMail", "infobar");

            infobar.Render(output);
            NavigationHost.RenderTreeRegionDivStart(output, null);
            NavigationTree    navigationTree;
            MailboxFolderTree mailboxFolderTree;

            MailboxFolderTree[] array;
            bool expandBuddyList;

            NavigationTree.CreateFavoriteAndMailboxTreeAndGetBuddyListStatus(userContext, out navigationTree, out mailboxFolderTree, out array, out expandBuddyList);
            NavigationHost.RenderTreeDivStart(output, "favTr");
            navigationTree.ErrDiv = "divErrMail";
            navigationTree.Render(output);
            NavigationHost.RenderTreeDivEnd(output);
            NavigationHost.RenderTreeDivStart(output, "mailtree");
            mailboxFolderTree.ErrDiv = "divErrMail";
            mailboxFolderTree.Render(output);
            NavigationHost.RenderTreeDivEnd(output);
            if (!userContext.IsExplicitLogon)
            {
                if (userContext.HasArchive)
                {
                    NavigationHost.RenderTreeDivStart(output, "archivetree", "othTr");
                    MailboxFolderTree mailboxFolderTree2 = MailboxFolderTree.CreateStartPageDummyArchiveMailboxFolderTree(userContext);
                    mailboxFolderTree2.ErrDiv = "divErrMail";
                    mailboxFolderTree2.Render(output);
                    NavigationHost.RenderTreeDivEnd(output);
                }
                foreach (OtherMailboxConfigEntry entry in OtherMailboxConfiguration.GetOtherMailboxes(userContext))
                {
                    NavigationHost.RenderOtherMailboxFolderTree(output, userContext, entry, false);
                }
            }
            if (userContext.IsInstantMessageEnabled())
            {
                NavigationHost.RenderTreeDivStart(output, "buddytree");
                NavigationHost.RenderBuddyListTreeControl(output, userContext, expandBuddyList);
                NavigationHost.RenderTreeDivEnd(output);
            }
            NavigationHost.RenderTreeRegionDivEnd(output);
            output.Write("</div>");
            ContextMenu contextMenu = new FolderTreeContextMenu(userContext);

            contextMenu.Render(output);
            if (userContext.IsInstantMessageEnabled())
            {
                ContextMenu contextMenu2 = new BuddyTreeContextMenu(userContext);
                contextMenu2.Render(output);
            }
        }
Beispiel #3
0
        public void OpenOtherUserFolder()
        {
            base.ThrowIfCannotActAsOwner();
            if (base.UserContext.IsExplicitLogon)
            {
                throw new OwaInvalidRequestException("Cannot open other's folder in explict logon mode");
            }
            NavigationNodeGroupSection navigationNodeGroupSection = (NavigationNodeGroupSection)base.GetParameter("GS");

            if (navigationNodeGroupSection == NavigationNodeGroupSection.Contacts || navigationNodeGroupSection == NavigationNodeGroupSection.Tasks)
            {
                throw new OwaInvalidRequestException("Cannot open other's contacts/tasks folder");
            }
            DefaultFolderType defaultFolderType;

            switch (navigationNodeGroupSection)
            {
            case NavigationNodeGroupSection.Mail:
                defaultFolderType = DefaultFolderType.Inbox;
                break;

            case NavigationNodeGroupSection.Calendar:
                defaultFolderType = DefaultFolderType.Calendar;
                break;

            case NavigationNodeGroupSection.Contacts:
                defaultFolderType = DefaultFolderType.Contacts;
                break;

            case NavigationNodeGroupSection.Tasks:
                defaultFolderType = DefaultFolderType.Tasks;
                break;

            default:
                throw new OwaInvalidRequestException("Invalid group section: " + navigationNodeGroupSection.ToString());
            }
            RecipientInfoAC[] array = (RecipientInfoAC[])base.GetParameter("Recips");
            if (array != null && array.Length != 0)
            {
                AutoCompleteCache.UpdateAutoCompleteCacheFromRecipientInfoList(array, base.OwaContext.UserContext);
            }
            if (defaultFolderType != DefaultFolderType.Calendar)
            {
                Folder folder = null;
                if (base.IsParameterSet("RCP"))
                {
                    RecipientInfoAC   recipientInfoAC   = (RecipientInfoAC)base.GetParameter("RCP");
                    ExchangePrincipal exchangePrincipal = null;
                    if (base.UserContext.DelegateSessionManager.TryGetExchangePrincipal(recipientInfoAC.RoutingAddress, out exchangePrincipal))
                    {
                        if (string.Equals(base.UserContext.MailboxSession.MailboxOwnerLegacyDN, exchangePrincipal.LegacyDn, StringComparison.OrdinalIgnoreCase))
                        {
                            throw new OwaEventHandlerException("Cannot open own folder", LocalizedStrings.GetNonEncoded(-1770024075), true);
                        }
                        folder = this.GetOtherUserFolder(exchangePrincipal, defaultFolderType);
                    }
                }
                else
                {
                    if (!base.IsParameterSet("Id"))
                    {
                        throw new OwaInvalidRequestException("Must specific one of recipient and folder Id.");
                    }
                    OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("Id");
                    if (!owaStoreObjectId.IsOtherMailbox)
                    {
                        throw new OwaEventHandlerException("Cannot open own folder", LocalizedStrings.GetNonEncoded(-1770024075), true);
                    }
                    folder = Utilities.GetFolder <Folder>(base.UserContext, owaStoreObjectId, FolderList.FolderTreeQueryProperties);
                }
                try
                {
                    if (folder == null || !Utilities.CanReadItemInFolder(folder))
                    {
                        Strings.IDs localizedId = 1414246128;
                        switch (navigationNodeGroupSection)
                        {
                        case NavigationNodeGroupSection.Mail:
                            localizedId = -236167850;
                            break;

                        case NavigationNodeGroupSection.Contacts:
                            localizedId = -1505241540;
                            break;

                        case NavigationNodeGroupSection.Tasks:
                            localizedId = -65263937;
                            break;
                        }
                        throw new OwaEventHandlerException(LocalizedStrings.GetNonEncoded(995407892), LocalizedStrings.GetNonEncoded(localizedId), true);
                    }
                    MailboxSession mailboxSession = folder.Session as MailboxSession;
                    if (navigationNodeGroupSection == NavigationNodeGroupSection.Mail)
                    {
                        OtherMailboxConfigEntry otherMailboxConfigEntry = OtherMailboxConfiguration.AddOtherMailboxSession(base.UserContext, mailboxSession);
                        if (otherMailboxConfigEntry != null)
                        {
                            NavigationHost.RenderOtherMailboxFolderTree(this.Writer, base.UserContext, otherMailboxConfigEntry, true);
                        }
                    }
                    else
                    {
                        NavigationNodeCollection.AddNonMailFolderToSharedFoldersGroup(base.UserContext, folder, navigationNodeGroupSection);
                        OwaStoreObjectId owaStoreObjectId2 = OwaStoreObjectId.CreateFromStoreObject(folder);
                        NavigationHost.RenderFavoritesAndNavigationTrees(this.Writer, base.UserContext, owaStoreObjectId2, new NavigationNodeGroupSection[]
                        {
                            navigationNodeGroupSection
                        });
                        this.RenderOpenOtherUserFolderReponse(folder.ClassName, owaStoreObjectId2);
                    }
                }
                finally
                {
                    if (folder != null)
                    {
                        folder.Dispose();
                    }
                }
                return;
            }
            if (!base.IsParameterSet("RCP"))
            {
                throw new OwaInvalidRequestException("Recipient is missing for open other user's calendar request");
            }
            this.OpenOtherUserCalendar((RecipientInfoAC)base.GetParameter("RCP"));
        }