コード例 #1
0
 // Token: 0x06000793 RID: 1939 RVA: 0x00039AC0 File Offset: 0x00037CC0
 private static void ThrowIfCannotActAsOwner(UserContext userContext)
 {
     if (!userContext.CanActAsOwner)
     {
         throw new OwaAccessDeniedException(LocalizedStrings.GetNonEncoded(1622692336), true);
     }
 }
コード例 #2
0
        public static void DeleteLevelOneAttachments(Item newItem, UserContext userContext)
        {
            if (newItem == null)
            {
                throw new ArgumentNullException("newItem");
            }
            List <AttachmentId> list = new List <AttachmentId>();

            foreach (AttachmentHandle handle in newItem.AttachmentCollection)
            {
                using (Attachment attachment = newItem.AttachmentCollection.Open(handle))
                {
                    AttachmentPolicy.Level attachmentLevel = AttachmentLevelLookup.GetAttachmentLevel(attachment, userContext);
                    if (attachmentLevel == AttachmentPolicy.Level.Block)
                    {
                        list.Add(attachment.Id);
                    }
                }
            }
            if (list.Count != 0)
            {
                foreach (AttachmentId attachmentId in list)
                {
                    newItem.AttachmentCollection.Remove(attachmentId);
                }
                ConflictResolutionResult conflictResolutionResult = newItem.Save(SaveMode.ResolveConflicts);
                if (conflictResolutionResult.SaveStatus == SaveResult.IrresolvableConflict)
                {
                    newItem.Dispose();
                    newItem = null;
                    throw new OwaSaveConflictException(LocalizedStrings.GetNonEncoded(-482397486), conflictResolutionResult);
                }
            }
            newItem.Load();
        }
コード例 #3
0
ファイル: Error.cs プロジェクト: YHZX2013/exchange_diff
 protected override void OnLoad(EventArgs e)
 {
     this.errorInformation = base.OwaContext.ErrorInformation;
     if (this.errorInformation == null)
     {
         this.errorInformation         = new ErrorInformation();
         this.errorInformation.Message = LocalizedStrings.GetNonEncoded(641346049);
     }
     else if (this.errorInformation.Exception != null)
     {
         Exception ex = this.errorInformation.Exception;
         if (ex is AsyncLocalizedExceptionWrapper)
         {
             ex = AsyncExceptionWrapperHelper.GetRootException(ex);
         }
         try
         {
             base.OwaContext.HttpContext.Response.Headers.Add("X-OWA-Error", ex.GetType().FullName);
         }
         catch (HttpException arg)
         {
             ExTraceGlobals.CoreTracer.TraceDebug <HttpException>(0L, "Exception happened while trying to append error headers. Exception will be ignored: {0}", arg);
         }
     }
     this.OnInit(e);
 }
コード例 #4
0
        // Token: 0x06000716 RID: 1814 RVA: 0x000377E8 File Offset: 0x000359E8
        internal static int SendDocumentContentToHttpStream(HttpContext httpContext, Stream stream, string fileName, string fileExtension, string contentType)
        {
            if (httpContext == null)
            {
                throw new ArgumentNullException("httpContext");
            }
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (string.IsNullOrEmpty(fileName))
            {
                fileName = LocalizedStrings.GetNonEncoded(1797976510);
            }
            if (fileExtension == null)
            {
                fileExtension = string.Empty;
            }
            if (contentType == null)
            {
                contentType = string.Empty;
            }
            bool flag = AttachmentUtility.DoNeedToFilterHtml(contentType, fileExtension, AttachmentPolicy.Level.Unknown, OwaContext.Get(httpContext).UserContext);

            if (flag)
            {
                AttachmentUtility.UpdateContentTypeForNeedToFilter(out contentType, null);
            }
            return(AttachmentHandler.SendDocumentContentToHttpStream(httpContext, stream, fileName, fileExtension, contentType, false, null, BlockStatus.DontKnow, AttachmentPolicy.Level.Unknown, flag));
        }
コード例 #5
0
        internal static PolicyConfiguration GetPolicyConfigurationFromAD(IConfigurationSession session, ADObjectId owaMailboxPolicyId)
        {
            OwaMailboxPolicy[] array            = session.Find <OwaMailboxPolicy>(owaMailboxPolicyId, QueryScope.Base, null, null, 1);
            OwaMailboxPolicy   owaMailboxPolicy = null;

            if (array != null && array.Length == 1)
            {
                owaMailboxPolicy = array[0];
            }
            if (owaMailboxPolicy == null)
            {
                ExTraceGlobals.PolicyConfigurationTracer.TraceError <ADObjectId>(0L, LocalizedStrings.GetNonEncoded(246332502), owaMailboxPolicyId);
                return(null);
            }
            PolicyConfiguration policyConfiguration = new PolicyConfiguration();

            policyConfiguration.PhoneticSupportEnabled = owaMailboxPolicy.PhoneticSupportEnabled;
            AttachmentPolicy.Level treatUnknownTypeAs = ConfigurationBase.AttachmentActionToLevel(new AttachmentBlockingActions?(owaMailboxPolicy.ActionForUnknownFileAndMIMETypes));
            AttachmentPolicy       attachmentPolicy   = new AttachmentPolicy(owaMailboxPolicy.BlockedFileTypes.ToArray(), owaMailboxPolicy.BlockedMimeTypes.ToArray(), owaMailboxPolicy.ForceSaveFileTypes.ToArray(), owaMailboxPolicy.ForceSaveMimeTypes.ToArray(), owaMailboxPolicy.AllowedFileTypes.ToArray(), owaMailboxPolicy.AllowedMimeTypes.ToArray(), treatUnknownTypeAs, owaMailboxPolicy.DirectFileAccessOnPublicComputersEnabled, owaMailboxPolicy.DirectFileAccessOnPrivateComputersEnabled, owaMailboxPolicy.ForceWebReadyDocumentViewingFirstOnPublicComputers, owaMailboxPolicy.ForceWebReadyDocumentViewingFirstOnPrivateComputers, owaMailboxPolicy.WebReadyDocumentViewingOnPublicComputersEnabled, owaMailboxPolicy.WebReadyDocumentViewingOnPrivateComputersEnabled, owaMailboxPolicy.WebReadyFileTypes.ToArray(), owaMailboxPolicy.WebReadyMimeTypes.ToArray(), owaMailboxPolicy.WebReadyDocumentViewingSupportedFileTypes.ToArray(), owaMailboxPolicy.WebReadyDocumentViewingSupportedMimeTypes.ToArray(), owaMailboxPolicy.WebReadyDocumentViewingForAllSupportedTypes);

            policyConfiguration.AttachmentPolicy      = attachmentPolicy;
            policyConfiguration.DefaultClientLanguage = owaMailboxPolicy.DefaultClientLanguage;
            policyConfiguration.LogonAndErrorLanguage = owaMailboxPolicy.LogonAndErrorLanguage;
            policyConfiguration.DefaultTheme          = owaMailboxPolicy.DefaultTheme;
            policyConfiguration.SetPhotoURL           = owaMailboxPolicy.SetPhotoURL;
            int segmentationBits  = (int)owaMailboxPolicy[OwaMailboxPolicySchema.ADMailboxFolderSet];
            int segmentationBits2 = (int)owaMailboxPolicy[OwaMailboxPolicySchema.ADMailboxFolderSet2];

            policyConfiguration.SegmentationFlags    = Utilities.SetSegmentationFlags(segmentationBits, segmentationBits2);
            policyConfiguration.OutboundCharset      = owaMailboxPolicy.OutboundCharset;
            policyConfiguration.UseGB18030           = owaMailboxPolicy.UseGB18030;
            policyConfiguration.UseISO885915         = owaMailboxPolicy.UseISO885915;
            policyConfiguration.InstantMessagingType = ((owaMailboxPolicy.InstantMessagingType != null) ? owaMailboxPolicy.InstantMessagingType.Value : InstantMessagingTypeOptions.None);
            return(policyConfiguration);
        }
コード例 #6
0
        public NavigationNodeFolder AddFolderToDefaultGroup(UserContext userContext, NavigationNodeGroupType groupType, Folder folder, bool isSharedFolder)
        {
            this.ThrowIfSaved();
            if (!NavigationNodeCollection.IsDefaultGroupType(groupType))
            {
                throw new ArgumentOutOfRangeException("Invalid default group type:" + groupType.ToString());
            }
            this.ThrowIfNonMailGroupSectionNotSupported();
            NavigationNodeCollection.ThrowIfGroupSectionNotMatchFolderClass(this.navigationNodeGroupSection, folder.ClassName);
            MailboxSession mailboxSession = folder.Session as MailboxSession;

            if (mailboxSession == null)
            {
                throw new ArgumentException("Should not add a folder that doesn't belong to a mailbox session.");
            }
            string text;

            if (isSharedFolder)
            {
                text = Utilities.GetMailboxOwnerDisplayName(mailboxSession);
                if (!Utilities.IsSpecialFolderForSession(mailboxSession, folder.Id.ObjectId))
                {
                    text = string.Format(LocalizedStrings.GetNonEncoded(-83764036), text, folder.DisplayName);
                }
            }
            else
            {
                text = folder.DisplayName;
            }
            return(this.AddFolderToGroup(this.GetDefaultGroup(groupType), folder, userContext, text, isSharedFolder ? NavigationNodeType.SharedFolder : NavigationNodeType.NormalFolder));
        }
コード例 #7
0
 // Token: 0x06000E65 RID: 3685 RVA: 0x0005BC5F File Offset: 0x00059E5F
 protected void ThrowIfCannotActAsOwner()
 {
     if (!this.UserContext.CanActAsOwner)
     {
         throw new OwaAccessDeniedException(LocalizedStrings.GetNonEncoded(1622692336), true);
     }
 }
コード例 #8
0
        // Token: 0x06001C51 RID: 7249 RVA: 0x000A2620 File Offset: 0x000A0820
        public static SanitizedHtmlString GetNonEncoded(Strings.IDs id)
        {
            SanitizedHtmlString sanitizedHtmlString = new SanitizedHtmlString(LocalizedStrings.GetNonEncoded(id));

            sanitizedHtmlString.DecreeToBeTrusted();
            return(sanitizedHtmlString);
        }
コード例 #9
0
        // Token: 0x06000D78 RID: 3448 RVA: 0x00059A84 File Offset: 0x00057C84
        internal static void CreateAndLoadConfigurationManager()
        {
            OwaConfigurationManager owaConfigurationManager = new OwaConfigurationManager();

            if (Globals.OwaVDirType == OWAVDirType.OWA)
            {
                try
                {
                    if (owaConfigurationManager == null)
                    {
                        throw new OwaInvalidConfigurationException(LocalizedStrings.GetNonEncoded(940832921));
                    }
                    OwaConfigurationManager.InitializeConfigurationManager();
                    OwaConfigurationManager.instance = owaConfigurationManager;
                    OwaConfigurationManager.LoadConfiguration();
                    if (Globals.ListenAdNotifications)
                    {
                        OwaConfigurationManager.instance.RegisterConfigurationChangeNotification();
                    }
                    return;
                }
                catch (Exception ex)
                {
                    throw new OwaInvalidConfigurationException(ex.Message, ex);
                }
            }
            OwaConfigurationManager.instance      = owaConfigurationManager;
            owaConfigurationManager.configuration = new CalendarVDirConfiguration();
        }
コード例 #10
0
 internal static string GetDefaultGroupSubject(NavigationNodeGroupType groupType, NavigationNodeGroupSection groupSection)
 {
     if (groupSection == NavigationNodeGroupSection.First)
     {
         return(LocalizedStrings.GetNonEncoded(364750115));
     }
     return(LocalizedStrings.GetNonEncoded(NavigationNodeCollection.localizedGroupNames[groupSection][(int)groupType]));
 }
コード例 #11
0
        private static void ThrowIfWebParts()
        {
            UserContext userContext = UserContextManager.GetUserContext();

            if (userContext.IsWebPartRequest && userContext.MailboxSession.LogonType == LogonType.Delegated)
            {
                throw new OwaOperationNotSupportedException(LocalizedStrings.GetNonEncoded(236298055));
            }
        }
コード例 #12
0
        // Token: 0x0600071E RID: 1822 RVA: 0x00037D64 File Offset: 0x00035F64
        private string GetSubject(Item item)
        {
            string text = item.TryGetProperty(ItemSchema.Subject) as string;

            if (string.IsNullOrEmpty(text))
            {
                text = LocalizedStrings.GetNonEncoded(730745110);
            }
            return(text);
        }
コード例 #13
0
        // Token: 0x0600071C RID: 1820 RVA: 0x00037B9C File Offset: 0x00035D9C
        private void ProcessAttachment(Attachment attachment, HttpContext httpContext, BlockStatus blockStatus)
        {
            if (attachment == null)
            {
                throw new ArgumentNullException("attachment");
            }
            OwaContext  owaContext  = OwaContext.Get(httpContext);
            UserContext userContext = owaContext.UserContext;
            Stream      stream      = null;

            try
            {
                StreamAttachmentBase streamAttachment = AttachmentUtility.GetStreamAttachment(attachment);
                if (streamAttachment == null)
                {
                    ExTraceGlobals.AttachmentHandlingTracer.TraceError((long)this.GetHashCode(), "AttachmentHandler.ProcessAttachment: attachment is not derived from AttachmentStream");
                }
                else
                {
                    AttachmentPolicy.Level attachmentLevel = AttachmentLevelLookup.GetAttachmentLevel(streamAttachment, userContext);
                    if (attachmentLevel == AttachmentPolicy.Level.Block)
                    {
                        Utilities.TransferToErrorPage(owaContext, LocalizedStrings.GetNonEncoded(-2000404449), LocalizedStrings.GetNonEncoded(-615885395));
                    }
                    else
                    {
                        string fileName = AttachmentUtility.CalculateAttachmentName(streamAttachment.DisplayName, streamAttachment.FileName);
                        string text     = streamAttachment.FileExtension;
                        if (text == null)
                        {
                            text = string.Empty;
                        }
                        string empty       = string.Empty;
                        bool   contentType = this.GetContentType(httpContext, streamAttachment, attachmentLevel, out empty);
                        bool   isInline    = this.GetIsInline(streamAttachment, attachmentLevel);
                        stream = AttachmentUtility.GetStream(streamAttachment);
                        if (stream == null)
                        {
                            ExTraceGlobals.AttachmentHandlingTracer.TraceError((long)this.GetHashCode(), "AttachmentHandler.ProcessAttachment: Image conversion of OLE attachment failure");
                        }
                        else
                        {
                            AttachmentHandler.SendDocumentContentToHttpStream(httpContext, stream, fileName, text, empty, isInline, streamAttachment.TextCharset, blockStatus, attachmentLevel, contentType);
                        }
                    }
                }
            }
            finally
            {
                if (stream != null)
                {
                    stream.Dispose();
                }
            }
        }
コード例 #14
0
        public static void ThrowIfMeetingResponseInvalid(MeetingMessage meetingMessage)
        {
            MeetingUtilities.ThrowIfWebParts();
            MeetingRequest meetingRequest = meetingMessage as MeetingRequest;

            if (meetingRequest != null && meetingRequest.IsMailboxOwnerTheSender())
            {
                throw new OwaOperationNotSupportedException(LocalizedStrings.GetNonEncoded(679811893));
            }
            MeetingUtilities.ThrowIfInArchiveMailbox(meetingMessage);
        }
コード例 #15
0
 public static void ThrowIfMeetingResponseInvalid(CalendarItemBase calendarItemBase)
 {
     MeetingUtilities.ThrowIfWebParts();
     if (calendarItemBase.IsOrganizer())
     {
         throw new OwaOperationNotSupportedException(LocalizedStrings.GetNonEncoded(679811893));
     }
     if (calendarItemBase.IsCancelled)
     {
         throw new OwaOperationNotSupportedException("Cannot respond to a cancelled meeting.");
     }
     MeetingUtilities.ThrowIfInArchiveMailbox(calendarItemBase);
 }
コード例 #16
0
        private static SanitizedHtmlString GetOfficeDownloadAnchor(CultureInfo userCulture)
        {
            SanitizedHtmlString sanitizedHtmlString = SanitizedHtmlString.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>", new object[]
            {
                LocalizedStrings.GetNonEncoded(1124412272),
                LocalizedStrings.GetNonEncoded(34768154)
            });

            return(SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(-539149404, userCulture), new object[]
            {
                sanitizedHtmlString
            }));
        }
コード例 #17
0
        protected void RenderVariableSaveAttachmentToDiskMessage()
        {
            string input = string.Empty;

            if (base.UserContext.IsBasicExperience)
            {
                input = LocalizedStrings.GetNonEncoded(-353246432);
            }
            else
            {
                input = base.GetSaveAttachmentToDiskMessage(687430467);
            }
            RenderingUtilities.RenderStringVariable(base.SanitizingResponse, "a_sL2Aw", input);
        }
コード例 #18
0
        internal static InstantMessageGroup Create(string id, string name, InstantMessageGroupType type)
        {
            InstantMessageGroup instantMessageGroup = new InstantMessageGroup();

            instantMessageGroup.Id       = id;
            instantMessageGroup.Name     = name;
            instantMessageGroup.Type     = type;
            instantMessageGroup.Expanded = false;
            if (name == "~")
            {
                instantMessageGroup.Name = LocalizedStrings.GetNonEncoded(-1499962683);
                instantMessageGroup.Type = InstantMessageGroupType.OtherContacts;
            }
            return(instantMessageGroup);
        }
コード例 #19
0
        public static void SaveItem(Item item, params PropertyDefinition[] properties)
        {
            ConflictResolutionResult conflictResolutionResult = item.Save(SaveMode.ResolveConflicts);

            if (conflictResolutionResult.SaveStatus == SaveResult.IrresolvableConflict)
            {
                ExTraceGlobals.CalendarTracer.TraceDebug(0L, "Saving item failed due to conflict resolution.");
                throw new OwaSaveConflictException(LocalizedStrings.GetNonEncoded(-482397486), conflictResolutionResult);
            }
            item.Load(properties);
            if (Globals.ArePerfCountersEnabled)
            {
                OwaSingleCounters.ItemsUpdated.Increment();
            }
        }
コード例 #20
0
        // Token: 0x06000B9D RID: 2973 RVA: 0x0005158C File Offset: 0x0004F78C
        public static void SetLinkEnabled(Item item, params PropertyDefinition[] prefetchProperties)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            item.OpenAsReadWrite();
            item[ItemSchema.LinkEnabled] = true;
            ConflictResolutionResult conflictResolutionResult = item.Save(SaveMode.ResolveConflicts);

            if (conflictResolutionResult.SaveStatus == SaveResult.IrresolvableConflict)
            {
                throw new OwaSaveConflictException(LocalizedStrings.GetNonEncoded(-482397486), conflictResolutionResult);
            }
            item.Load(prefetchProperties);
        }
コード例 #21
0
 // Token: 0x0600025D RID: 605 RVA: 0x00015358 File Offset: 0x00013558
 protected string GetSaveAttachmentToDiskMessage(Strings.IDs attachmentMessageId)
 {
     Strings.IDs localizedId;
     if (this.SessionContext.BrowserType == BrowserType.IE)
     {
         localizedId = 1297545050;
     }
     else if (this.SessionContext.BrowserType == BrowserType.Safari)
     {
         localizedId = 175065296;
     }
     else
     {
         localizedId = -1815684119;
     }
     return(string.Format(LocalizedStrings.GetNonEncoded(attachmentMessageId), LocalizedStrings.GetNonEncoded(localizedId)));
 }
コード例 #22
0
        private static string CreatePostReplyForwardHeader(BodyFormat bodyFormat, Item item, UserContext userContext, string postToFolderName)
        {
            PostItem postItem = item as PostItem;

            if (postItem == null)
            {
                throw new ArgumentException("OWA logic error . CreatePostReplyForwardheader is called on a non-PostItem item.");
            }
            if (postToFolderName == null)
            {
                throw new ArgumentNullException("postToFolderName");
            }
            if (string.Empty == postToFolderName)
            {
                throw new ArgumentException("postToFolderName should not be empty. ");
            }
            StringBuilder stringBuilder = new StringBuilder();
            bool          outputHtml    = BodyFormat.TextHtml == bodyFormat;

            if (postItem.Sender != null)
            {
                if (Utilities.IsOnBehalfOf(postItem.Sender, postItem.From))
                {
                    stringBuilder.Append(string.Format(LocalizedStrings.GetHtmlEncoded(-1426120402), ReplyForwardUtilities.GetParticipantDisplayString(postItem.Sender, outputHtml), ReplyForwardUtilities.GetParticipantDisplayString(postItem.From, outputHtml)));
                }
                else
                {
                    ReplyForwardUtilities.AppendParticipantDisplayString(postItem.Sender, stringBuilder, outputHtml);
                }
            }
            string fromLabel = string.Empty;

            switch (bodyFormat)
            {
            case BodyFormat.TextPlain:
                fromLabel = LocalizedStrings.GetNonEncoded(-1376223345);
                return(ReplyForwardUtilities.CreatePostTextReplyForwardHeader(postItem, userContext, fromLabel, stringBuilder.ToString(), postToFolderName));

            case BodyFormat.TextHtml:
                fromLabel = LocalizedStrings.GetHtmlEncoded(-1376223345);
                return(ReplyForwardUtilities.CreatePostHtmlReplyForwardHeader(postItem, userContext, fromLabel, stringBuilder.ToString(), postToFolderName));

            default:
                throw new ArgumentException("Unsupported body format");
            }
        }
コード例 #23
0
        public static Item CreatePostReplyItem(BodyFormat bodyFormat, PostItem item, UserContext userContext, StoreObjectId parentFolderId)
        {
            PostItem postItem = null;
            bool     flag     = true;

            try
            {
                string bodyPrefix = ReplyForwardUtilities.CreateReplyForwardHeader(bodyFormat, item, userContext, parentFolderId);
                string legacyDN   = null;
                OwaStoreObjectIdType owaStoreObjectIdType = Utilities.GetOwaStoreObjectIdType(userContext, item);
                if (owaStoreObjectIdType == OwaStoreObjectIdType.OtherUserMailboxObject)
                {
                    legacyDN = Utilities.GetMailboxSessionLegacyDN(item);
                }
                OwaStoreObjectId destinationFolderId        = OwaStoreObjectId.CreateFromFolderId(parentFolderId, owaStoreObjectIdType, legacyDN);
                OwaStoreObjectId scratchPadForImplicitDraft = Utilities.GetScratchPadForImplicitDraft(StoreObjectType.Post, destinationFolderId);
                try
                {
                    ReplyForwardConfiguration replyForwardConfiguration = new ReplyForwardConfiguration(bodyFormat);
                    replyForwardConfiguration.ConversionOptionsForSmime = Utilities.CreateInboundConversionOptions(userContext);
                    replyForwardConfiguration.AddBodyPrefix(bodyPrefix);
                    postItem = item.ReplyToFolder(scratchPadForImplicitDraft.GetSession(userContext), scratchPadForImplicitDraft.StoreObjectId, replyForwardConfiguration);
                }
                catch (StoragePermanentException ex)
                {
                    if (ex.InnerException is MapiExceptionNoCreateRight)
                    {
                        throw new OwaAccessDeniedException(LocalizedStrings.GetNonEncoded(995407892), ex);
                    }
                    throw ex;
                }
                ReplyForwardUtilities.CopyMessageClassificationProperties(item, postItem, userContext);
                Utilities.SetPostSender(postItem, userContext, Utilities.IsPublic(item));
                postItem.ConversationTopic = item.ConversationTopic;
                flag = false;
            }
            finally
            {
                if (flag && postItem != null)
                {
                    postItem.Dispose();
                    postItem = null;
                }
            }
            return(postItem);
        }
コード例 #24
0
        public static string GetReceivedOnBehalfOfDisplayName(MeetingMessage meetingMessage)
        {
            if (meetingMessage == null)
            {
                throw new ArgumentNullException("meetingMessage");
            }
            string result = LocalizedStrings.GetNonEncoded(-1018465893);

            if (meetingMessage.ReceivedRepresenting == null || string.IsNullOrEmpty(meetingMessage.ReceivedRepresenting.DisplayName))
            {
                result = LocalizedStrings.GetNonEncoded(-595380497);
            }
            else
            {
                result = meetingMessage.ReceivedRepresenting.DisplayName;
            }
            return(result);
        }
コード例 #25
0
        public static CalendarItemBase TryPreProcessCalendarItem(MeetingMessage meetingMessage, UserContext userContext, bool doCalendarItemSave)
        {
            if (meetingMessage == null)
            {
                throw new ArgumentNullException("meetingMessage");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            CalendarItemBase calendarItemBase = null;

            meetingMessage.OpenAsReadWrite();
            try
            {
                ExTraceGlobals.CalendarTracer.TraceDebug <string>(0L, "Retreiving calendar item associated with meeting request. Value = '{0}'", (meetingMessage.Id != null) ? meetingMessage.Id.ObjectId.ToBase64String() : "null");
                calendarItemBase = meetingMessage.PreProcess(userContext.CalendarSettings.AddNewRequestsTentatively, userContext.CalendarSettings.ProcessExternalMeetingMessages, userContext.CalendarSettings.DefaultReminderTime);
                if (doCalendarItemSave && calendarItemBase != null)
                {
                    Utilities.ValidateCalendarItemBaseStoreObject(calendarItemBase);
                }
                if (meetingMessage.IsDirty)
                {
                    MeetingUtilities.SaveItem(meetingMessage, new PropertyDefinition[0]);
                }
            }
            catch (CorrelationFailedException ex)
            {
                ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Calendar item associated with meeting request could not be found.  Exception: {0}", ex.Message);
            }
            catch (CalendarProcessingException ex2)
            {
                ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Calendar item associated with meeting request could not be found.  Exception: {0}", ex2.Message);
            }
            catch (StoragePermanentException ex3)
            {
                ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Calendar item associated with meeting request could not be found.  Exception: {0}", ex3.Message);
            }
            catch (ConnectionFailedTransientException innerException)
            {
                throw new OwaAccessDeniedException(LocalizedStrings.GetNonEncoded(995407892), innerException);
            }
            return(calendarItemBase);
        }
コード例 #26
0
        internal override bool FilterRequest(object source, EventArgs e, RequestEventType eventType)
        {
            HttpApplication httpApplication = (HttpApplication)source;
            HttpContext     context         = httpApplication.Context;
            HttpRequest     request         = context.Request;
            Configuration   configuration   = OwaConfigurationManager.Configuration;

            if (!Utilities.IsOwaUrl(request.Url, OwaUrl.AuthPost, true) || configuration == null)
            {
                return(false);
            }
            if (configuration.FormsAuthenticationEnabled)
            {
                if (eventType == RequestEventType.BeginRequest)
                {
                    this.SimulateBasicAuthenticationHeader(context);
                }
                else
                {
                    if (eventType != RequestEventType.PostAuthorizeRequest)
                    {
                        throw new OwaInvalidOperationException("FBASingleSignOn was unexpectedly called");
                    }
                    HttpResponse    response        = context.Response;
                    WindowsIdentity windowsIdentity = context.User.Identity as WindowsIdentity;
                    if (windowsIdentity != null && !windowsIdentity.IsAnonymous)
                    {
                        this.TransferToAuthDll(httpApplication);
                        return(true);
                    }
                    OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_WebConfigAuthenticationIncorrect, string.Empty, new object[]
                    {
                        HttpRuntime.AppDomainAppPath
                    });
                    Utilities.RewritePathToError(OwaContext.Current, LocalizedStrings.GetNonEncoded(-1556449487));
                }
            }
            else
            {
                Utilities.EndResponse(context, HttpStatusCode.BadRequest);
            }
            return(false);
        }
コード例 #27
0
        public static SanitizedHtmlString GetAttendeeResponseCountMessage(CalendarItemBase calendarItemBase)
        {
            int num  = 0;
            int num2 = 0;
            int num3 = 0;

            foreach (Attendee attendee in calendarItemBase.AttendeeCollection)
            {
                switch (attendee.ResponseType)
                {
                case ResponseType.Tentative:
                    num2++;
                    break;

                case ResponseType.Accept:
                    num++;
                    break;

                case ResponseType.Decline:
                    num3++;
                    break;
                }
            }
            SanitizedHtmlString result;

            if (num == 0 && num2 == 0 && num3 == 0)
            {
                result = SanitizedHtmlString.FromStringId(-518767563);
            }
            else
            {
                string response  = MeetingUtilities.GetResponse(num, LocalizedStrings.GetNonEncoded(-1438005858), LocalizedStrings.GetNonEncoded(-171859085), Strings.MoreThenOneAttendeeAccepted);
                string response2 = MeetingUtilities.GetResponse(num2, LocalizedStrings.GetNonEncoded(-409971733), LocalizedStrings.GetNonEncoded(-1184021704), Strings.MoreThenOneAttendeeTentativelyAccepted);
                string response3 = MeetingUtilities.GetResponse(num3, LocalizedStrings.GetNonEncoded(161551623), LocalizedStrings.GetNonEncoded(1194482770), Strings.MoreThenOneAttendeeDeclined);
                result = SanitizedHtmlString.Format(LocalizedStrings.GetNonEncoded(-1080172631), new object[]
                {
                    response,
                    response2,
                    response3
                });
            }
            return(result);
        }
コード例 #28
0
        private static string CreatePostTextReplyForwardHeader(PostItem item, UserContext userContext, string fromLabel, string from, string postToFolderName)
        {
            StringBuilder stringBuilder = new StringBuilder(100);

            if (userContext.IsFeatureEnabled(Feature.Signature) && userContext.UserOptions.AutoAddSignature)
            {
                stringBuilder.Append(userContext.UserOptions.SignatureText);
            }
            stringBuilder.Append("\n");
            stringBuilder.Append("\n________________________________________\n");
            if (!string.IsNullOrEmpty(from))
            {
                stringBuilder.Append(fromLabel);
                stringBuilder.Append(" ");
                stringBuilder.Append(from);
                stringBuilder.Append("\n");
            }
            item.TryGetProperty(ItemSchema.SentTime);
            ExDateTime postedTime = item.PostedTime;

            stringBuilder.Append(LocalizedStrings.GetNonEncoded(1890363921));
            stringBuilder.Append(" ");
            stringBuilder.AppendFormat(Strings.SentTime, item.PostedTime.ToLongDateString(), item.PostedTime.ToString(userContext.UserOptions.TimeFormat));
            stringBuilder.Append("\n");
            stringBuilder.Append(LocalizedStrings.GetNonEncoded(737701919));
            stringBuilder.Append(" ");
            stringBuilder.Append(postToFolderName);
            stringBuilder.Append("\n");
            stringBuilder.Append(LocalizedStrings.GetNonEncoded(-1239615092));
            stringBuilder.Append(" ");
            string value = null;

            if (item.Subject != null)
            {
                value = item.ConversationTopic;
            }
            stringBuilder.Append(value);
            stringBuilder.Append("\n");
            return(stringBuilder.ToString());
        }
コード例 #29
0
        // Token: 0x06001918 RID: 6424 RVA: 0x00091F88 File Offset: 0x00090188
        private bool CheckFolderIsSupported(Folder folder)
        {
            string text = folder.ClassName;

            if (string.IsNullOrEmpty(text))
            {
                text = "IPF.Note";
            }
            if (Utilities.GetFolderProperty <EffectiveRights>(folder, StoreObjectSchema.EffectiveRights, EffectiveRights.None) == EffectiveRights.None)
            {
                this.owaContext.ErrorInformation = new ErrorInformation(LocalizedStrings.GetNonEncoded(-1925343075), OwaEventHandlerErrorCode.WebPartContentsPermissionsError);
                return(false);
            }
            if (this.IsBasicClient() && Utilities.IsPublic(folder))
            {
                this.owaContext.ErrorInformation = new ErrorInformation(LocalizedStrings.GetNonEncoded(807691393), OwaEventHandlerErrorCode.WebPartAccessPublicFolderViaOwaBasicError);
                return(false);
            }
            if (ObjectClass.IsNotesFolder(text) || ObjectClass.IsJournalFolder(text))
            {
                this.owaContext.ErrorInformation = new ErrorInformation(LocalizedStrings.GetNonEncoded(1063985686), OwaEventHandlerErrorCode.WebPartUnsupportedFolderTypeError);
                return(false);
            }
            if (this.IsBasicClient() && ObjectClass.IsTaskFolder(text))
            {
                this.owaContext.ErrorInformation = new ErrorInformation(LocalizedStrings.GetNonEncoded(-1065897770), OwaEventHandlerErrorCode.WebPartTaskFolderError);
                return(false);
            }
            if (this.IsBasicClient() && ObjectClass.IsCalendarFolder(text))
            {
                this.owaContext.ErrorInformation = new ErrorInformation(LocalizedStrings.GetNonEncoded(-765983365), OwaEventHandlerErrorCode.WebPartCalendarFolderError);
                return(false);
            }
            if ((folder.Id.ObjectId.ObjectType == StoreObjectType.SearchFolder && !this.userContext.IsFeatureEnabled(Feature.SearchFolders)) || (Utilities.IsDefaultFolder(folder, DefaultFolderType.JunkEmail) && !this.userContext.IsFeatureEnabled(Feature.JunkEMail)) || this.IsFeatureSegmentedOut(text))
            {
                this.owaContext.ErrorInformation = new ErrorInformation(LocalizedStrings.GetNonEncoded(-1242252459), OwaEventHandlerErrorCode.WebPartSegmentationError);
                return(false);
            }
            return(true);
        }
コード例 #30
0
        // Token: 0x06000791 RID: 1937 RVA: 0x00039894 File Offset: 0x00037A94
        private static Dictionary <DefaultCalendarColor, string> MapColorNames()
        {
            Dictionary <DefaultCalendarColor, string> dictionary = new Dictionary <DefaultCalendarColor, string>();

            dictionary[DefaultCalendarColor.NoneSet]        = LocalizedStrings.GetNonEncoded(-789554764);
            dictionary[DefaultCalendarColor.Auto]           = LocalizedStrings.GetNonEncoded(185042824);
            dictionary[DefaultCalendarColor.Brown]          = LocalizedStrings.GetNonEncoded(1091142534);
            dictionary[DefaultCalendarColor.BrightGreen]    = LocalizedStrings.GetNonEncoded(1509769609);
            dictionary[DefaultCalendarColor.Purple]         = LocalizedStrings.GetNonEncoded(-415545442);
            dictionary[DefaultCalendarColor.TaupeDarkGrey]  = LocalizedStrings.GetNonEncoded(-2088323323);
            dictionary[DefaultCalendarColor.KhakiGreen]     = LocalizedStrings.GetNonEncoded(-40076381);
            dictionary[DefaultCalendarColor.CoralPink]      = LocalizedStrings.GetNonEncoded(173435619);
            dictionary[DefaultCalendarColor.GrassGreen]     = LocalizedStrings.GetNonEncoded(-242192433);
            dictionary[DefaultCalendarColor.PeriwinkleBlue] = LocalizedStrings.GetNonEncoded(16181640);
            dictionary[DefaultCalendarColor.TealGreen]      = LocalizedStrings.GetNonEncoded(-1942954909);
            dictionary[DefaultCalendarColor.Magenta]        = LocalizedStrings.GetNonEncoded(-195962327);
            dictionary[DefaultCalendarColor.DarkBlue]       = LocalizedStrings.GetNonEncoded(-1300826558);
            dictionary[DefaultCalendarColor.SageGreen]      = LocalizedStrings.GetNonEncoded(-2009804245);
            dictionary[DefaultCalendarColor.CamelBrown]     = LocalizedStrings.GetNonEncoded(66432428);
            dictionary[DefaultCalendarColor.ElectricBlue]   = LocalizedStrings.GetNonEncoded(916435529);
            dictionary[DefaultCalendarColor.Cinnamon]       = LocalizedStrings.GetNonEncoded(1001882251);
            return(dictionary);
        }