// 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);
        }
Example #2
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());
        }
Example #3
0
        private static string CreatePostHtmlReplyForwardHeader(PostItem item, UserContext userContext, string fromLabel, string fromHtmlMarkup, string postToFolderName)
        {
            StringBuilder stringBuilder = new StringBuilder(150);

            stringBuilder.Append("<HR tabindex=\"-1\">");
            stringBuilder.Append("<DIV id=divRplyFwdMsg>");
            stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "<FONT FACE=\"{0}\" size=\"2\">", new object[]
            {
                Utilities.GetDefaultFontName()
            });
            if (!string.IsNullOrEmpty(fromHtmlMarkup))
            {
                stringBuilder.Append("<B>");
                stringBuilder.Append(fromLabel);
                stringBuilder.Append("</B> ");
                stringBuilder.Append(fromHtmlMarkup);
                stringBuilder.Append("<BR>");
            }
            ExDateTime postedTime = item.PostedTime;

            stringBuilder.Append("<B>");
            stringBuilder.Append(LocalizedStrings.GetHtmlEncoded(1890363921));
            stringBuilder.Append("</B> ");
            stringBuilder.AppendFormat(Utilities.HtmlEncode(Strings.SentTime), item.PostedTime.ToLongDateString(), item.PostedTime.ToString(userContext.UserOptions.TimeFormat));
            stringBuilder.Append("<BR>");
            stringBuilder.Append("<B>");
            stringBuilder.Append(LocalizedStrings.GetHtmlEncoded(737701919));
            stringBuilder.Append("</B> ");
            Utilities.HtmlEncode(postToFolderName, stringBuilder);
            stringBuilder.Append("<BR>");
            stringBuilder.Append("<B>");
            stringBuilder.Append(LocalizedStrings.GetHtmlEncoded(-1239615092));
            stringBuilder.Append("</B> ");
            Utilities.HtmlEncode(item.ConversationTopic, stringBuilder);
            stringBuilder.Append("<BR>");
            stringBuilder.Append("</FONT><BR></DIV>");
            stringBuilder.Append("</DIV>");
            return(stringBuilder.ToString());
        }
 public void RenderOpenLink(TextWriter output)
 {
     if (output == null)
     {
         throw new ArgumentNullException("output");
     }
     AttachmentPolicy.Level levelForAttachment = AttachmentLevelLookup.GetLevelForAttachment(this.fileExtension, this.mimeType, this.owaContext.UserContext);
     output.Write("<span id=\"spnLnk\" tabindex=\"-1\">");
     SmallIconManager.RenderFileIcon(output, this.owaContext.UserContext, this.fileExtension, "tbLh", new string[0]);
     output.Write("<span class=\"tbLh\">");
     if (levelForAttachment == AttachmentPolicy.Level.ForceSave || levelForAttachment == AttachmentPolicy.Level.Allow)
     {
         output.Write("<a id=\"lnk\" href=\"");
         output.Write(this.openLink);
         output.Write("\" target=_blank onclick=\"");
         output.Write("return onClkAtmt(");
         output.Write((int)levelForAttachment);
         output.Write(")\" title=\"");
         Utilities.HtmlEncode(this.fileName, output);
         output.Write("\">");
         Utilities.HtmlEncode(AttachmentUtility.TrimAttachmentDisplayName(this.fileName, null, false), output);
         output.Write("</a>");
     }
     else
     {
         Utilities.HtmlEncode(AttachmentUtility.TrimAttachmentDisplayName(this.fileName, null, false), output);
     }
     if (this.fileSize > 0L)
     {
         output.Write(this.owaContext.UserContext.DirectionMark);
         output.Write(" ");
         output.Write(LocalizedStrings.GetHtmlEncoded(6409762));
         Utilities.RenderSizeWithUnits(output, this.fileSize, true);
         output.Write(this.owaContext.UserContext.DirectionMark);
         output.Write(LocalizedStrings.GetHtmlEncoded(-1023695022));
     }
     output.Write("</span></span>");
 }
Example #5
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);
        }
Example #6
0
        public static void ProcessReminders(UserContext userContext, TextWriter writer)
        {
            ExDateTime localTime = DateTimeUtilities.GetLocalTime(userContext);
            int        num       = (int)localTime.Bias.TotalMinutes;

            if (num != userContext.RemindersTimeZoneOffset)
            {
                userContext.RemindersTimeZoneOffset = num;
            }
            writer.Write("rmNotfy(");
            writer.Write(num);
            writer.Write(", 1, \"");
            Utilities.JavascriptEncode(DateTimeUtilities.GetJavascriptDate(localTime), writer);
            writer.Write("\", \"");
            bool reminderItems = RemindersRenderingUtilities.GetReminderItems(userContext, localTime, writer);

            if (reminderItems)
            {
                writer.Write("\", \"");
                Utilities.JavascriptEncode(LocalizedStrings.GetHtmlEncoded(-1707229168), writer);
            }
            writer.Write("\");");
        }
Example #7
0
        // Token: 0x060011FD RID: 4605 RVA: 0x0006D26C File Offset: 0x0006B46C
        private bool CheckAndHandleWebException40X(WebException webException, Exception outerException)
        {
            if (webException.Status != WebExceptionStatus.ProtocolError)
            {
                return(false);
            }
            HttpWebResponse httpWebResponse = (HttpWebResponse)webException.Response;

            if (httpWebResponse.StatusCode == HttpStatusCode.Forbidden)
            {
                OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorSslConnection, base.OwaContext.SecondCasUri.ToString(), new object[]
                {
                    base.OwaContext.LocalHostName,
                    base.OwaContext.SecondCasUri.ToString(),
                    base.OwaContext.SecondCasUri.ToString()
                });
                OwaProxyException exception = new OwaProxyException("The CAS server is most likely not configured for SSL (it returned a 403)", LocalizedStrings.GetNonEncoded(-750997814), outerException, false);
                this.asyncResult.CompleteRequest(false, exception);
                return(true);
            }
            if (httpWebResponse.StatusCode == HttpStatusCode.Unauthorized)
            {
                OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorAuthenticationToCas2Failure, base.OwaContext.SecondCasUri.ToString(), new object[]
                {
                    base.OwaContext.LocalHostName,
                    base.OwaContext.SecondCasUri.ToString()
                });
                OwaProxyException exception2 = new OwaProxyException("The proxy CAS failed to authenticate to the second CAS (it returned a 401)", LocalizedStrings.GetNonEncoded(-1102013722), outerException, false);
                this.asyncResult.CompleteRequest(false, exception2);
                return(true);
            }
            return(false);
        }
Example #8
0
        // Token: 0x060011ED RID: 4589 RVA: 0x0006C540 File Offset: 0x0006A740
        private void SendProxyPingRequestCallback(IAsyncResult asyncResult)
        {
            ExTraceGlobals.ProxyCallTracer.TraceDebug((long)this.GetHashCode(), "ProxyEventHandler.SendProxyPingRequestCallback");
            try
            {
                HttpWebResponse httpWebResponse = this.proxyPingRequest.EndSend(asyncResult);
                if (httpWebResponse.StatusCode == (HttpStatusCode)242)
                {
                    ExTraceGlobals.ProxyTracer.TraceDebug((long)this.GetHashCode(), "Proxy ping succeeded");
                    try
                    {
                        ServerVersion serverVersion = null;
                        if (!this.EnsureCasCompatibility(httpWebResponse, out serverVersion))
                        {
                            ExTraceGlobals.ProxyCallTracer.TraceDebug((long)this.GetHashCode(), "CAS versions are not compatible");
                            OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorCASCompatibility, base.OwaContext.SecondCasUri.ToString(), new object[]
                            {
                                base.OwaContext.LocalHostName,
                                Globals.LocalHostVersion.ToString(),
                                base.OwaContext.SecondCasUri.Uri.Host,
                                serverVersion.ToString()
                            });
                            throw new OwaProxyException("Cas servers have incompatible versions", LocalizedStrings.GetNonEncoded(-1191925045));
                        }
                        goto IL_113;
                    }
                    finally
                    {
                        httpWebResponse.Close();
                        httpWebResponse = null;
                    }
                    goto IL_F4;
IL_113:
                    goto IL_15E;
                }
IL_F4:
                ExTraceGlobals.ProxyTracer.TraceDebug((long)this.GetHashCode(), "The proxy ping didn't succeed, streaming the response directly to the client...");
                this.CopyProxyResponse(httpWebResponse);
                return;
            }
            catch (OwaAsyncOperationException ex)
            {
                WebException ex2 = ex.InnerException as WebException;
                if (ex2 != null)
                {
                    this.HandleProxyPingWebException(ex2, ex);
                    return;
                }
                this.asyncResult.CompleteRequest(false, ex);
                return;
            }
            catch (WebException ex3)
            {
                this.HandleProxyPingWebException(ex3, ex3);
                return;
            }
            catch (Exception exception)
            {
                this.asyncResult.CompleteRequest(false, exception);
                return;
            }
IL_15E:
            base.OwaContext.SecondCasUri.ProxyPingResult = ProxyPingResult.Compatible;
            try
            {
                this.SendProxyRequest();
            }
            catch (Exception exception2)
            {
                this.asyncResult.CompleteRequest(false, exception2);
            }
        }
        // Token: 0x06000B82 RID: 2946 RVA: 0x00050390 File Offset: 0x0004E590
        public static string GetDisplayString(string itemType)
        {
            switch (itemType)
            {
            case "IPM.Appointment":
                return(LocalizedStrings.GetNonEncoded(-1218353654));

            case "IPM.Note.Microsoft.Approval.Request":
                return(LocalizedStrings.GetNonEncoded(-1921998649));

            case "IPM.Note.Microsoft.Approval.Reply.Approve":
                return(LocalizedStrings.GetNonEncoded(2134275567));

            case "IPM.Note.Microsoft.Approval.Reply.Reject":
                return(LocalizedStrings.GetNonEncoded(617284623));

            case "IPM.Conflict.Folder":
                return(LocalizedStrings.GetNonEncoded(-949566239));

            case "IPM.Conflict.Message":
                return(LocalizedStrings.GetNonEncoded(-1125004178));

            case "IPM.Contact":
                return(LocalizedStrings.GetNonEncoded(1212144717));

            case "REPORT.IPM.Note.DR":
                return(LocalizedStrings.GetNonEncoded(-673778217));

            case "REPORT.REPORT.IPM.Note.DR.NDR":
                return(LocalizedStrings.GetNonEncoded(-1214411457));

            case "IPM.NOTE.SECURE.SIGN":
                return(LocalizedStrings.GetNonEncoded(-1744898725));

            case "IPM.Note.Secure.Sign.Reply":
                return(LocalizedStrings.GetNonEncoded(-1638959343));

            case "IPM.DistList":
                return(LocalizedStrings.GetNonEncoded(-257188171));

            case "IPM.Document":
                return(LocalizedStrings.GetNonEncoded(1894440736));

            case "IPM.Document.Outlook.Template":
                return(LocalizedStrings.GetNonEncoded(936058579));

            case "IPM.Note.Exchange.Security.Enrollment":
                return(LocalizedStrings.GetNonEncoded(-1728547674));

            case "IPM.Note.Microsoft.Fax.CA":
                return(LocalizedStrings.GetNonEncoded(441553720));

            case "IPM.Schedule.Meeting.Resp.Pos":
                return(LocalizedStrings.GetNonEncoded(-1480422595));

            case "REPORT.IPM.Schedule.Meeting.Resp.Pos.NDR":
                return(LocalizedStrings.GetNonEncoded(1578126677));

            case "IPM.Schedule.Meeting.Canceled":
                return(LocalizedStrings.GetNonEncoded(-1395325573));

            case "REPORT.IPM.Schedule.Meeting.Canceled.NDR":
                return(LocalizedStrings.GetNonEncoded(2117886819));

            case "IPM.Schedule.Meeting.Resp.Neg":
                return(LocalizedStrings.GetNonEncoded(1577758192));

            case "REPORT.IPM.Schedule.Meeting.Resp.Neg.NDR":
                return(LocalizedStrings.GetNonEncoded(501159136));

            case "IPM.Schedule.Meeting.Request":
                return(LocalizedStrings.GetNonEncoded(715990345));

            case "REPORT.IPM.Schedule.Meeting.Request.DR":
                return(LocalizedStrings.GetNonEncoded(1722709255));

            case "REPORT.IPM.Schedule.Meeting.Request.NDR":
                return(LocalizedStrings.GetNonEncoded(723650401));

            case "REPORT.IPM.Schedule.Meeting.Request.IPNRN":
                return(LocalizedStrings.GetNonEncoded(247246403));

            case "IPM.Schedule.Meeting.Resp.Tent":
                return(LocalizedStrings.GetNonEncoded(418650720));

            case "REPORT.IPM.Schedule.Meeting.Resp.Tent.NDR":
                return(LocalizedStrings.GetNonEncoded(1657585888));

            case "IPM.Note":
                return(LocalizedStrings.GetNonEncoded(375540844));

            case "IPM.Microsoft.Answer":
                return(LocalizedStrings.GetNonEncoded(1418057561));

            case "REPORT.IPM.Microsoft.Answer.NDR":
                return(LocalizedStrings.GetNonEncoded(-2092364623));

            case "IPM.Document.Microsoft Internet Mail Message":
                return(LocalizedStrings.GetNonEncoded(569182364));

            case "REPORT.IPM.Note.NDR":
                return(LocalizedStrings.GetNonEncoded(-240308911));

            case "IPM.OCTEL.VOICE":
                return(LocalizedStrings.GetNonEncoded(1324666722));

            case "REPORT.IPM.OCTEL.VOICE.NDR":
                return(LocalizedStrings.GetNonEncoded(1751917506));

            case "IPM.Note.Rules.OofTemplate.Microsoft":
                return(LocalizedStrings.GetNonEncoded(-445260260));

            case "IPM.Outlook.Recall":
                return(LocalizedStrings.GetNonEncoded(-1730664879));

            case "IPM.Post":
                return(LocalizedStrings.GetNonEncoded(1671058613));

            case "REPORT.IPM.Note.IPNNRN":
                return(LocalizedStrings.GetNonEncoded(1317782997));

            case "REPORT.REPORT.IPM.Note.IPNNRN.NDR":
                return(LocalizedStrings.GetNonEncoded(-383020123));

            case "REPORT.IPM.Note.IPNRN":
                return(LocalizedStrings.GetNonEncoded(-44453782));

            case "IPM.Recall":
                return(LocalizedStrings.GetNonEncoded(-1875477896));

            case "IPM.Recall.Report.Failure":
                return(LocalizedStrings.GetNonEncoded(-2103299596));

            case "IPM.Recall.Report.Success":
                return(LocalizedStrings.GetNonEncoded(-1247003399));

            case "IPM.Sharing":
                return(LocalizedStrings.GetNonEncoded(-958660555));

            case "IPM.Note.SMIME":
                return(LocalizedStrings.GetNonEncoded(-1021771534));

            case "IPM.Note.SMIME.MultipartSigned":
                return(LocalizedStrings.GetNonEncoded(-246092698));

            case "IPM.Note.Mobile.SMS":
                return(LocalizedStrings.GetNonEncoded(629771022));

            case "IPM.Task":
                return(LocalizedStrings.GetNonEncoded(-2113219524));

            case "IPM.TaskRequest":
                return(LocalizedStrings.GetNonEncoded(2041022245));

            case "IPM.TaskRequest.Accept":
                return(LocalizedStrings.GetNonEncoded(-791766735));

            case "REPORT.IPM.TaskRequest.Accept.NDR":
                return(LocalizedStrings.GetNonEncoded(-1588693551));

            case "IPM.TaskRequest.Decline":
                return(LocalizedStrings.GetNonEncoded(1476481161));

            case "REPORT.IPM.TaskRequest.Decline.NDR":
                return(LocalizedStrings.GetNonEncoded(61479553));

            case "REPORT.IPM.TaskRequest.NDR":
                return(LocalizedStrings.GetNonEncoded(561961253));

            case "IPM.TaskRequest.Update":
                return(LocalizedStrings.GetNonEncoded(332739048));

            case "REPORT.IPM.TaskRequest.Update.NDR":
                return(LocalizedStrings.GetNonEncoded(-707557640));

            case "IPM.Note.Microsoft.Voicemail.UM":
            case "IPM.Note.Microsoft.Voicemail.UM.CA":
            case "IPM.Note.Microsoft.Exchange.Voice.UM":
            case "IPM.Note.Microsoft.Exchange.Voice.UM.CA":
            case "IPM.Note.rpmsg.Microsoft.Voicemail.UM":
            case "IPM.Note.rpmsg.Microsoft.Voicemail.UM.CA":
                return(LocalizedStrings.GetNonEncoded(-1757037630));
            }
            return(LocalizedStrings.GetNonEncoded(-1718015515));
        }
Example #10
0
        public static CalendarItemBase UpdateCalendarItem(MeetingRequest meetingRequest)
        {
            if (meetingRequest == null)
            {
                throw new ArgumentNullException("meetingRequest");
            }
            MeetingUtilities.ThrowIfMeetingResponseInvalid(meetingRequest);
            CalendarItemBase calendarItemBase = null;

            try
            {
                try
                {
                    ExTraceGlobals.CalendarTracer.TraceDebug <string>(0L, "Retreiving calendar item associated with meeting request. Value = '{0}'", (meetingRequest.Id != null && meetingRequest.Id.ObjectId != null) ? meetingRequest.Id.ObjectId.ToBase64String() : "null");
                    if (meetingRequest.IsOutOfDate())
                    {
                        throw new OwaOperationNotSupportedException(LocalizedStrings.GetNonEncoded(-1085726012));
                    }
                    calendarItemBase = meetingRequest.UpdateCalendarItem(true);
                    if (calendarItemBase == null)
                    {
                        throw new OwaInvalidOperationException("meetingRequest.UpdateCalendarItem returns null.");
                    }
                    calendarItemBase.Load();
                }
                catch (CorrelationFailedException ex)
                {
                    ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Calendar item associated with meeting request could not be found.  Exception: {0}", ex.Message);
                    throw;
                }
                catch (StoragePermanentException ex2)
                {
                    ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Calendar item associated with meeting request could not be found.  Exception: {0}", ex2.Message);
                    throw;
                }
                catch (InvalidOperationException ex3)
                {
                    if (ex3.Message == ServerStrings.ExOrganizerCannotCallUpdateCalendarItem)
                    {
                        throw new OwaOperationNotSupportedException(LocalizedStrings.GetNonEncoded(679811893));
                    }
                    throw;
                }
                try
                {
                    MeetingUtilities.SaveItem(meetingRequest, new PropertyDefinition[]
                    {
                        MeetingMessageSchema.CalendarProcessed,
                        StoreObjectSchema.ParentItemId
                    });
                }
                catch (OwaSaveConflictException ex4)
                {
                    ExTraceGlobals.CalendarDataTracer.TraceDebug <string>(0L, "Calendar item associated with meeting request could not be saved.  Exception: {0}", ex4.Message);
                    throw;
                }
            }
            catch
            {
                if (calendarItemBase != null)
                {
                    calendarItemBase.Dispose();
                    calendarItemBase = null;
                }
                throw;
            }
            if (Globals.ArePerfCountersEnabled)
            {
                OwaSingleCounters.ItemsCreated.Increment();
            }
            return(calendarItemBase);
        }
Example #11
0
        protected ADUser CreateADUserBySid()
        {
            ADUser aduser = this.CreateADRecipientBySid() as ADUser;

            if (aduser == null)
            {
                throw new OwaExplicitLogonException(string.Format("The SID {0} is an object in AD database but it is not an user", this.UserSid), LocalizedStrings.GetNonEncoded(-1332692688), null);
            }
            return(aduser);
        }
 public static string GetFileAsString(FileAsMapping enumValue)
 {
     return(LocalizedStrings.GetNonEncoded(ContactUtilities.fileAsEnumToStringMap[enumValue]));
 }
        // Token: 0x06000D66 RID: 3430 RVA: 0x00059670 File Offset: 0x00057870
        internal override MailboxSession CreateMailboxSession(IExchangePrincipal exchangePrincipal, CultureInfo cultureInfo, HttpRequest clientRequest)
        {
            ExTraceGlobals.CoreCallTracer.TraceDebug(0L, "OwaClientSecurityContextIdentity.CreateMailboxSession");
            MailboxSession result;

            try
            {
                MailboxSession mailboxSession = MailboxSession.Open(exchangePrincipal, this.clientSecurityContext, cultureInfo, "Client=OWA;Action=ViaProxy");
                GccUtils.SetStoreSessionClientIPEndpointsFromHttpRequest(mailboxSession, clientRequest);
                result = mailboxSession;
            }
            catch (AccessDeniedException innerException)
            {
                throw new OwaExplicitLogonException("User has no access rights to the mailbox", LocalizedStrings.GetNonEncoded(882888134), innerException);
            }
            return(result);
        }
Example #14
0
 // Token: 0x060011FF RID: 4607 RVA: 0x0006D3A4 File Offset: 0x0006B5A4
 private void HandleWebExceptionDefault(WebException webException, Exception outerException)
 {
     if (webException.Status == WebExceptionStatus.TrustFailure)
     {
         OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorSslTrustFailure, base.OwaContext.SecondCasUri.ToString(), new object[]
         {
             base.OwaContext.LocalHostName,
             base.OwaContext.SecondCasUri.ToString()
         });
         OwaProxyException exception = new OwaProxyException("Error establishing SSL connection", LocalizedStrings.GetNonEncoded(-750997814), outerException, false);
         this.asyncResult.CompleteRequest(false, exception);
         return;
     }
     this.asyncResult.CompleteRequest(false, outerException);
 }
Example #15
0
        private static string CreateHtmlReplyForwardHeader(Item item, UserContext userContext, string fromLabel, string fromHtmlMarkup, string toLabel, string ccLabel, IList <IRecipientBase> toRecipients, IList <IRecipientBase> ccRecipients)
        {
            StringBuilder stringBuilder = new StringBuilder(150);

            stringBuilder.Append("<HR tabindex=\"-1\">");
            stringBuilder.Append("<DIV id=divRplyFwdMsg>");
            stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "<FONT FACE=\"{0}\" size=\"2\" color=\"#000000\">", new object[]
            {
                Utilities.GetDefaultFontName()
            });
            if (!string.IsNullOrEmpty(fromHtmlMarkup))
            {
                stringBuilder.Append("<B>");
                stringBuilder.Append(fromLabel);
                stringBuilder.Append("</B> ");
                stringBuilder.Append(fromHtmlMarkup);
                stringBuilder.Append("<BR>");
            }
            object obj = item.TryGetProperty(ItemSchema.SentTime);

            if (obj != null && obj is ExDateTime)
            {
                ExDateTime exDateTime = (ExDateTime)obj;
                stringBuilder.Append("<B>");
                stringBuilder.Append(LocalizedStrings.GetHtmlEncoded(295620541));
                stringBuilder.Append("</B> ");
                stringBuilder.AppendFormat(Utilities.HtmlEncode(Strings.SentTime), exDateTime.ToLongDateString(), exDateTime.ToString(userContext.UserOptions.TimeFormat));
                stringBuilder.Append("<BR>");
            }
            if (0 < toRecipients.Count)
            {
                stringBuilder.Append("<B>");
                stringBuilder.Append(toLabel);
                stringBuilder.Append("</B> ");
                int num = 0;
                foreach (IRecipientBase recipientBase in toRecipients)
                {
                    num++;
                    Utilities.HtmlEncode(recipientBase.Participant.DisplayName, stringBuilder);
                    if (num < toRecipients.Count)
                    {
                        stringBuilder.Append("; ");
                    }
                }
                stringBuilder.Append("<BR>");
            }
            if (0 < ccRecipients.Count)
            {
                stringBuilder.Append("<B>");
                stringBuilder.Append(ccLabel);
                stringBuilder.Append("</B> ");
                int num2 = 0;
                foreach (IRecipientBase recipientBase2 in ccRecipients)
                {
                    num2++;
                    Utilities.HtmlEncode(recipientBase2.Participant.DisplayName, stringBuilder);
                    if (num2 < ccRecipients.Count)
                    {
                        stringBuilder.Append("; ");
                    }
                }
                stringBuilder.Append("<BR>");
            }
            stringBuilder.Append("<B>");
            stringBuilder.Append(LocalizedStrings.GetHtmlEncoded(-881075747));
            stringBuilder.Append("</B> ");
            string text = item.TryGetProperty(ItemSchema.Subject) as string;

            if (text == null)
            {
                text = string.Empty;
            }
            Utilities.HtmlEncode(text, stringBuilder);
            stringBuilder.Append("<BR>");
            if (ReplyForwardUtilities.IsMeetingItem(item))
            {
                stringBuilder.Append("<B>");
                stringBuilder.Append(LocalizedStrings.GetHtmlEncoded(-524211323));
                stringBuilder.Append("</B> ");
                Utilities.HtmlEncode(Utilities.GenerateWhen(item), stringBuilder);
                stringBuilder.Append("<BR><B>");
                stringBuilder.Append(LocalizedStrings.GetHtmlEncoded(1666265192));
                stringBuilder.Append("</B> ");
                string text2 = item.TryGetProperty(CalendarItemBaseSchema.Location) as string;
                if (!string.IsNullOrEmpty(text2))
                {
                    Utilities.HtmlEncode(text2, stringBuilder);
                }
                stringBuilder.Append("<BR>");
            }
            stringBuilder.Append("</FONT><BR></DIV>");
            stringBuilder.Append("</DIV>");
            return(stringBuilder.ToString());
        }
Example #16
0
 // Token: 0x0600126D RID: 4717 RVA: 0x000706F4 File Offset: 0x0006E8F4
 internal static void EnsureProxyUrlSslPolicy(OwaContext owaContext, ProxyUri secondCasUri)
 {
     if (!OwaRegistryKeys.AllowProxyingWithoutSsl && secondCasUri.Uri.Scheme != Uri.UriSchemeHttps)
     {
         OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorSslConnection, secondCasUri.ToString(), new object[]
         {
             owaContext.LocalHostName,
             secondCasUri.ToString(),
             secondCasUri.ToString()
         });
         throw new OwaProxyException(string.Format("The URI found for proxying does not start with \"https\". Value={0}", secondCasUri.ToString()), LocalizedStrings.GetNonEncoded(-750997814));
     }
 }
Example #17
0
        // Token: 0x06000818 RID: 2072 RVA: 0x0003BA7C File Offset: 0x00039C7C
        internal Configuration(IConfigurationSession session, string virtualDirectory, string webSiteName, ADObjectId vDirADObjectId, bool isPhoneticSupportEnabled)
        {
            base.PhoneticSupportEnabled = isPhoneticSupportEnabled;
            if (Globals.IsPreCheckinApp)
            {
                this.ExpirationTime = DateTime.UtcNow + Configuration.expirationPeriod;
                this.LoadPreCheckInVdirConfiguration();
                return;
            }
            ADOwaVirtualDirectory adowaVirtualDirectory = session.Read <ADOwaVirtualDirectory>(vDirADObjectId);

            if (adowaVirtualDirectory == null)
            {
                string message = string.Format(LocalizedStrings.GetNonEncoded(-1166886287), virtualDirectory, webSiteName);
                throw new OwaInvalidConfigurationException(message);
            }
            this.formsAuthenticationEnabled = (adowaVirtualDirectory.InternalAuthenticationMethods.Contains(AuthenticationMethod.Fba) ? 1 : 0);
            AttachmentPolicy.Level treatUnknownTypeAs = ConfigurationBase.AttachmentActionToLevel(adowaVirtualDirectory.ActionForUnknownFileAndMIMETypes);
            AttachmentPolicy       attachmentPolicy   = new AttachmentPolicy(adowaVirtualDirectory.BlockedFileTypes.ToArray(), adowaVirtualDirectory.BlockedMimeTypes.ToArray(), adowaVirtualDirectory.ForceSaveFileTypes.ToArray(), adowaVirtualDirectory.ForceSaveMimeTypes.ToArray(), adowaVirtualDirectory.AllowedFileTypes.ToArray(), adowaVirtualDirectory.AllowedMimeTypes.ToArray(), treatUnknownTypeAs, adowaVirtualDirectory.DirectFileAccessOnPublicComputersEnabled.Value, adowaVirtualDirectory.DirectFileAccessOnPrivateComputersEnabled.Value, adowaVirtualDirectory.ForceWebReadyDocumentViewingFirstOnPublicComputers.Value, adowaVirtualDirectory.ForceWebReadyDocumentViewingFirstOnPrivateComputers.Value, adowaVirtualDirectory.WebReadyDocumentViewingOnPublicComputersEnabled.Value, adowaVirtualDirectory.WebReadyDocumentViewingOnPrivateComputersEnabled.Value, adowaVirtualDirectory.WebReadyFileTypes.ToArray(), adowaVirtualDirectory.WebReadyMimeTypes.ToArray(), adowaVirtualDirectory.WebReadyDocumentViewingSupportedFileTypes.ToArray(), adowaVirtualDirectory.WebReadyDocumentViewingSupportedMimeTypes.ToArray(), adowaVirtualDirectory.WebReadyDocumentViewingForAllSupportedTypes.Value);

            base.AttachmentPolicy             = attachmentPolicy;
            base.DefaultClientLanguage        = adowaVirtualDirectory.DefaultClientLanguage.Value;
            this.filterWebBeaconsAndHtmlForms = adowaVirtualDirectory.FilterWebBeaconsAndHtmlForms.Value;
            base.LogonAndErrorLanguage        = adowaVirtualDirectory.LogonAndErrorLanguage;
            this.logonFormat                            = adowaVirtualDirectory.LogonFormat;
            this.defaultDomain                          = adowaVirtualDirectory.DefaultDomain;
            this.notificationInterval                   = (adowaVirtualDirectory.NotificationInterval ?? 120);
            this.sessionTimeout                         = (adowaVirtualDirectory.UserContextTimeout ?? 60);
            this.redirectToOptimalOWAServer             = (adowaVirtualDirectory.RedirectToOptimalOWAServer == true);
            base.DefaultTheme                           = adowaVirtualDirectory.DefaultTheme;
            base.SetPhotoURL                            = adowaVirtualDirectory.SetPhotoURL;
            this.clientAuthCleanupLevel                 = adowaVirtualDirectory.ClientAuthCleanupLevel;
            this.imCertificateThumbprint                = adowaVirtualDirectory.InstantMessagingCertificateThumbprint;
            this.imServerName                           = adowaVirtualDirectory.InstantMessagingServerName;
            this.isSMimeEnabledOnCurrentServerr         = (adowaVirtualDirectory.SMimeEnabled ?? false);
            this.documentAccessAllowedServers           = adowaVirtualDirectory.RemoteDocumentsAllowedServers.ToArray();
            this.documentAccessBlockedServers           = adowaVirtualDirectory.RemoteDocumentsBlockedServers.ToArray();
            this.documentAccessInternalDomainSuffixList = adowaVirtualDirectory.RemoteDocumentsInternalDomainSuffixList.ToArray();
            RemoteDocumentsActions?remoteDocumentsActions = adowaVirtualDirectory.RemoteDocumentsActionForUnknownServers;

            if (remoteDocumentsActions != null)
            {
                if (remoteDocumentsActions == RemoteDocumentsActions.Allow)
                {
                    this.remoteDocumentsActionForUnknownServers = RemoteDocumentsActions.Allow;
                }
                else
                {
                    this.remoteDocumentsActionForUnknownServers = RemoteDocumentsActions.Block;
                }
            }
            base.InternalAuthenticationMethod = ConfigurationBase.GetAuthenticationMethod(adowaVirtualDirectory[ADVirtualDirectorySchema.InternalAuthenticationMethodFlags]);
            base.ExternalAuthenticationMethod = ConfigurationBase.GetAuthenticationMethod(adowaVirtualDirectory[ADVirtualDirectorySchema.ExternalAuthenticationMethodFlags]);
            base.Exchange2003Url    = adowaVirtualDirectory.Exchange2003Url;
            base.LegacyRedirectType = LegacyRedirectTypeOptions.Silent;
            int segmentationBits  = (int)adowaVirtualDirectory[ADOwaVirtualDirectorySchema.ADMailboxFolderSet];
            int segmentationBits2 = (int)adowaVirtualDirectory[ADOwaVirtualDirectorySchema.ADMailboxFolderSet2];

            base.SegmentationFlags = Utilities.SetSegmentationFlags(segmentationBits, segmentationBits2);
            if (adowaVirtualDirectory.OutboundCharset != null)
            {
                base.OutboundCharset = adowaVirtualDirectory.OutboundCharset.Value;
            }
            if (adowaVirtualDirectory.UseGB18030 != null && adowaVirtualDirectory.UseGB18030.Value)
            {
                base.UseGB18030 = true;
            }
            else
            {
                base.UseGB18030 = false;
            }
            if (adowaVirtualDirectory.UseISO885915 != null && adowaVirtualDirectory.UseISO885915.Value)
            {
                base.UseISO885915 = true;
            }
            else
            {
                base.UseISO885915 = false;
            }
            base.InstantMessagingType           = ((adowaVirtualDirectory.InstantMessagingType != null) ? adowaVirtualDirectory.InstantMessagingType.Value : InstantMessagingTypeOptions.None);
            this.defaultAcceptedDomain          = session.GetDefaultAcceptedDomain();
            this.publicFoldersEnabledOnThisVdir = (adowaVirtualDirectory.PublicFoldersEnabled ?? false);
            this.ExpirationTime = DateTime.UtcNow + Configuration.expirationPeriod;
            OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ConfigurationSettingsUpdated, string.Empty, new object[]
            {
                virtualDirectory,
                webSiteName
            });
        }
Example #18
0
        // Token: 0x06000FDA RID: 4058 RVA: 0x00062BB0 File Offset: 0x00060DB0
        private void OnAuthenticateRequest(object sender, EventArgs e)
        {
            ExTraceGlobals.CoreCallTracer.TraceDebug(0L, "OwaModule.OnAuthenticateRequest");
            HttpApplication httpApplication = (HttpApplication)sender;

            if (this.ShouldInterceptRequest(httpApplication.Context, false))
            {
                HttpContext context = httpApplication.Context;
                if (UrlUtilities.IsWacRequest(httpApplication.Context.Request))
                {
                    context.User = new WindowsPrincipal(WindowsIdentity.GetAnonymous());
                    context.SkipAuthorization = true;
                }
                this.WriteOutlookSessionCookieIfNeeded(context);
                OwaContext owaContext = OwaContext.Create(context);
                OwaContext.Set(context, owaContext);
                bool flag = false;
                this.requestInspector.OnBeginRequest(sender, e, out flag);
                if (flag)
                {
                    return;
                }
                if (Globals.FilterETag && VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).OwaDeployment.FilterETag.Enabled)
                {
                    context.Request.Headers.Remove("ETag");
                }
                ExTraceGlobals.RequestTracer.TraceDebug <string, string>((long)owaContext.GetHashCode(), "Request: {0} {1}", context.Request.HttpMethod, context.Request.Url.LocalPath);
                owaContext.TraceRequestId = Trace.TraceCasStart(CasTraceEventType.Owa);
                string arg;
                if (!Utilities.ValidateRequest(context, out arg))
                {
                    ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "Request is invalid, will not continue processing. Reason = {0}", arg);
                    Utilities.EndResponse(context, HttpStatusCode.BadRequest);
                }
                if (!Globals.IsInitialized)
                {
                    ExTraceGlobals.CoreTracer.TraceError(0L, "Can't process this request because the application wasn't succesfully initialized");
                    lock (this.firstFailedInitRequestLock)
                    {
                        if (this.firstFailedInitRequest != null)
                        {
                            if (ExDateTime.UtcNow.Subtract(this.firstFailedInitRequest.Value).TotalMilliseconds > 30000.0)
                            {
                                OwaDiagnostics.Logger.LogEvent(ClientsEventLogConstants.Tuple_OwaRestartingAfterFailedLoad, string.Empty, new object[0]);
                                AppDomain.Unload(Thread.GetDomain());
                            }
                        }
                        else
                        {
                            this.firstFailedInitRequest = new ExDateTime?(ExDateTime.UtcNow);
                        }
                    }
                    Utilities.RewritePathToError(owaContext, LocalizedStrings.GetNonEncoded(-1556449487), Globals.InitializationError.Message);
                    return;
                }
            }
            else if (this.IsBasicRequest(httpApplication.Context.Request))
            {
                Utilities.EndResponse(httpApplication.Context, HttpStatusCode.BadRequest);
            }
        }
Example #19
0
        // Token: 0x06001201 RID: 4609 RVA: 0x0006D43C File Offset: 0x0006B63C
        private bool CheckAndHandleConnectionFailure(WebException webException, Exception outerException)
        {
            ExTraceGlobals.ProxyCallTracer.TraceDebug((long)this.GetHashCode(), "ProxyEventHandler.HandleConnectionFailure");
            if (outerException == null)
            {
                outerException = webException;
            }
            if (!ProxyEventHandler.IsConnectionFailure(webException))
            {
                return(false);
            }
            ExTraceGlobals.ProxyTracer.TraceDebug((long)this.GetHashCode(), "The proxy attempt failed, so we'll fail over to another CAS");
            this.attemptedProxyUriCount++;
            if (base.OwaContext.ProxyUriQueue.Count == 1 || this.attemptedProxyUriCount > base.OwaContext.ProxyUriQueue.Count)
            {
                OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorCASFailoverAllAttemptsFailed, base.OwaContext.SecondCasUri.ToString(), new object[]
                {
                    base.OwaContext.LocalHostName,
                    base.OwaContext.SecondCasUri.ToString(),
                    string.Format("webExceptionStatus={0}", webException.Status)
                });
                OwaProxyException exception = new OwaProxyException("None of the CAS servers are responding", LocalizedStrings.GetNonEncoded(-200732695), outerException, false);
                this.asyncResult.CompleteRequest(false, exception);
                return(true);
            }
            ProxyUri secondCasUri = base.OwaContext.SecondCasUri;

            this.GetNextFailoverCas();
            OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorCASFailoverTryNextOne, secondCasUri.ToString(), new object[]
            {
                base.OwaContext.LocalHostName,
                secondCasUri.ToString(),
                base.OwaContext.SecondCasUri.ToString(),
                string.Format("webExceptionStatus={0}", webException.Status)
            });
            bool result;

            try
            {
                this.SendProxyRequest();
                result = true;
            }
            catch (Exception exception2)
            {
                this.asyncResult.CompleteRequest(false, exception2);
                result = true;
            }
            return(result);
        }
Example #20
0
        private static string CreateTextReplyForwardHeader(Item item, UserContext userContext, string fromLabel, string from, string toLabel, string ccLabel, IList <IRecipientBase> toRecipients, IList <IRecipientBase> ccRecipients)
        {
            StringBuilder stringBuilder = new StringBuilder(100);

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

            if (obj != null && obj is ExDateTime)
            {
                ExDateTime exDateTime = (ExDateTime)obj;
                stringBuilder.Append(LocalizedStrings.GetNonEncoded(295620541));
                stringBuilder.Append(" ");
                stringBuilder.AppendFormat(Strings.SentTime, exDateTime.ToLongDateString(), exDateTime.ToString(userContext.UserOptions.TimeFormat));
                stringBuilder.Append("\n");
            }
            if (0 < toRecipients.Count)
            {
                stringBuilder.Append(toLabel);
                stringBuilder.Append(" ");
                int num = 0;
                foreach (IRecipientBase recipientBase in toRecipients)
                {
                    num++;
                    stringBuilder.Append(recipientBase.Participant.DisplayName);
                    if (num < toRecipients.Count)
                    {
                        stringBuilder.Append("; ");
                    }
                }
                stringBuilder.Append("\n");
            }
            if (0 < ccRecipients.Count)
            {
                stringBuilder.Append(ccLabel);
                stringBuilder.Append(" ");
                int num2 = 0;
                foreach (IRecipientBase recipientBase2 in ccRecipients)
                {
                    num2++;
                    stringBuilder.Append(recipientBase2.Participant.DisplayName);
                    if (num2 < ccRecipients.Count)
                    {
                        stringBuilder.Append("; ");
                    }
                }
                stringBuilder.Append("\n");
            }
            stringBuilder.Append(LocalizedStrings.GetNonEncoded(-881075747));
            stringBuilder.Append(" ");
            string text = item.TryGetProperty(ItemSchema.Subject) as string;

            if (text == null)
            {
                text = string.Empty;
            }
            stringBuilder.Append(text);
            stringBuilder.Append("\n");
            if (ReplyForwardUtilities.IsMeetingItem(item))
            {
                stringBuilder.Append(LocalizedStrings.GetNonEncoded(-524211323));
                stringBuilder.Append(" ");
                stringBuilder.Append(Utilities.GenerateWhen(item));
                stringBuilder.Append("\n");
                stringBuilder.Append(LocalizedStrings.GetNonEncoded(1666265192));
                stringBuilder.Append(" ");
                string value = item.TryGetProperty(CalendarItemBaseSchema.Location) as string;
                if (!string.IsNullOrEmpty(value))
                {
                    stringBuilder.Append(value);
                }
                stringBuilder.Append("\n");
            }
            return(stringBuilder.ToString());
        }
        public static string GetPropertyStringFromPhoneNumberType(PhoneNumberType type)
        {
            switch (type)
            {
            case PhoneNumberType.AssistantPhone:
                return(LocalizedStrings.GetNonEncoded(-1816252206));

            case PhoneNumberType.BusinessPhone:
                return(LocalizedStrings.GetNonEncoded(346027136));

            case PhoneNumberType.BusinessPhone2:
                return(LocalizedStrings.GetNonEncoded(873918106));

            case PhoneNumberType.BusinessFax:
                return(LocalizedStrings.GetNonEncoded(-11305699));

            case PhoneNumberType.Callback:
                return(LocalizedStrings.GetNonEncoded(-646524091));

            case PhoneNumberType.CarPhone:
                return(LocalizedStrings.GetNonEncoded(159631176));

            case PhoneNumberType.CompanyMainPhone:
                return(LocalizedStrings.GetNonEncoded(-1918812500));

            case PhoneNumberType.HomeFax:
                return(LocalizedStrings.GetNonEncoded(1180016964));

            case PhoneNumberType.HomePhone:
                return(LocalizedStrings.GetNonEncoded(-1844864953));

            case PhoneNumberType.HomePhone2:
                return(LocalizedStrings.GetNonEncoded(1714659233));

            case PhoneNumberType.Isdn:
                return(LocalizedStrings.GetNonEncoded(57098496));

            case PhoneNumberType.MobilePhone:
                return(LocalizedStrings.GetNonEncoded(1158653436));

            case PhoneNumberType.OtherFax:
                return(LocalizedStrings.GetNonEncoded(-679895069));

            case PhoneNumberType.OtherPhone:
                return(LocalizedStrings.GetNonEncoded(-582599340));

            case PhoneNumberType.Pager:
                return(LocalizedStrings.GetNonEncoded(-1779142331));

            case PhoneNumberType.PrimaryPhone:
                return(LocalizedStrings.GetNonEncoded(1442239260));

            case PhoneNumberType.RadioPhone:
                return(LocalizedStrings.GetNonEncoded(-166006211));

            case PhoneNumberType.Telex:
                return(LocalizedStrings.GetNonEncoded(1096044911));

            case PhoneNumberType.TtyTddPhone:
                return(LocalizedStrings.GetNonEncoded(-1028516975));

            default:
                throw new ArgumentOutOfRangeException("type", "Phone number type is invalid");
            }
        }
Example #22
0
        internal static string CreateReplyForwardHeader(BodyFormat bodyFormat, Item item, UserContext userContext, StoreObjectId parentFolderId)
        {
            MessageItem      messageItem      = item as MessageItem;
            PostItem         postItem         = item as PostItem;
            CalendarItemBase calendarItemBase = item as CalendarItemBase;

            if (messageItem == null && calendarItemBase == null && postItem == null)
            {
                throw new ArgumentException("HTML reply forward headers can only be created for MessageItem and CalendarItemBase or PostItem. ");
            }
            if (postItem != null)
            {
                if (parentFolderId == null)
                {
                    throw new ArgumentNullException("parentFolderId");
                }
                string parentFolderName = Utilities.GetParentFolderName(item, parentFolderId, userContext);
                return(ReplyForwardUtilities.CreatePostReplyForwardHeader(bodyFormat, item, userContext, parentFolderName));
            }
            else
            {
                IList <IRecipientBase> toRecipients = null;
                IList <IRecipientBase> ccRecipients = null;
                string        fromLabel             = string.Empty;
                StringBuilder stringBuilder         = new StringBuilder();
                string        toLabel = string.Empty;
                string        ccLabel = string.Empty;
                bool          flag    = bodyFormat == BodyFormat.TextHtml;
                if (messageItem != null)
                {
                    fromLabel = (flag ? LocalizedStrings.GetHtmlEncoded(-1376223345) : LocalizedStrings.GetNonEncoded(-1376223345));
                    if (messageItem.Sender != null)
                    {
                        if (Utilities.IsOnBehalfOf(messageItem.Sender, messageItem.From))
                        {
                            stringBuilder.Append(string.Format(LocalizedStrings.GetHtmlEncoded(-1426120402), ReplyForwardUtilities.GetParticipantDisplayString(messageItem.Sender, flag), ReplyForwardUtilities.GetParticipantDisplayString(messageItem.From, flag)));
                        }
                        else
                        {
                            ReplyForwardUtilities.AppendParticipantDisplayString(messageItem.Sender, stringBuilder, flag);
                        }
                    }
                    toLabel      = (flag ? LocalizedStrings.GetHtmlEncoded(-829627742) : LocalizedStrings.GetNonEncoded(-829627742));
                    ccLabel      = (flag ? LocalizedStrings.GetHtmlEncoded(-798075995) : LocalizedStrings.GetNonEncoded(-798075995));
                    toRecipients = ReplyForwardUtilities.GetMessageRecipientCollection(RecipientItemType.To, messageItem);
                    ccRecipients = ReplyForwardUtilities.GetMessageRecipientCollection(RecipientItemType.Cc, messageItem);
                }
                else if (calendarItemBase != null)
                {
                    fromLabel = (flag ? LocalizedStrings.GetHtmlEncoded(-1376223345) : LocalizedStrings.GetNonEncoded(-1376223345));
                    if (calendarItemBase.Organizer != null)
                    {
                        ReplyForwardUtilities.AppendParticipantDisplayString(calendarItemBase.Organizer, stringBuilder, flag);
                    }
                    toLabel      = (flag ? LocalizedStrings.GetHtmlEncoded(-1709254790) : LocalizedStrings.GetNonEncoded(-1709254790));
                    ccLabel      = (flag ? LocalizedStrings.GetHtmlEncoded(-98673561) : LocalizedStrings.GetNonEncoded(-98673561));
                    toRecipients = ReplyForwardUtilities.GetCalendarItemRecipientCollection(AttendeeType.Required, calendarItemBase);
                    ccRecipients = ReplyForwardUtilities.GetCalendarItemRecipientCollection(AttendeeType.Optional, calendarItemBase);
                }
                switch (bodyFormat)
                {
                case BodyFormat.TextPlain:
                    return(ReplyForwardUtilities.CreateTextReplyForwardHeader(item, userContext, fromLabel, stringBuilder.ToString(), toLabel, ccLabel, toRecipients, ccRecipients));

                case BodyFormat.TextHtml:
                    return(ReplyForwardUtilities.CreateHtmlReplyForwardHeader(item, userContext, fromLabel, stringBuilder.ToString(), toLabel, ccLabel, toRecipients, ccRecipients));

                default:
                    throw new ArgumentException("Unsupported body format");
                }
            }
        }
 public static string GetPhysicalAddressString(PhysicalAddressType enumValue)
 {
     return(LocalizedStrings.GetNonEncoded(ContactUtilities.physicalAddressEnumToStringMap[enumValue]));
 }
Example #24
0
        private static Item CreateReplyOrReplyAllItem(BodyFormat bodyFormat, Item item, ReplyForwardFlags flags, bool replyAll, UserContext userContext, StoreObjectId parentFolderId)
        {
            if (bodyFormat < (BodyFormat)0)
            {
                throw new ArgumentOutOfRangeException("bodyFormat", bodyFormat, "bodyFormat has an invalid value");
            }
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            MessageItem messageItem = null;
            bool        flag        = true;

            try
            {
                bool   flag2 = true;
                string text  = string.Empty;
                if (!Utilities.IsFlagSet((int)flags, 2))
                {
                    text = ReplyForwardUtilities.CreateReplyForwardHeader(bodyFormat, item, userContext, parentFolderId);
                }
                ReplyForwardConfiguration replyForwardConfiguration = new ReplyForwardConfiguration(bodyFormat);
                replyForwardConfiguration.ConversionOptionsForSmime = Utilities.CreateInboundConversionOptions(userContext);
                replyForwardConfiguration.AddBodyPrefix(text);
                MessageItem      messageItem2;
                CalendarItemBase calendarItemBase;
                PostItem         postItem;
                if ((messageItem2 = (item as MessageItem)) != null)
                {
                    if (replyAll)
                    {
                        messageItem = messageItem2.CreateReplyAll(userContext.MailboxSession, userContext.DraftsFolderId, replyForwardConfiguration);
                    }
                    else
                    {
                        messageItem = messageItem2.CreateReply(userContext.MailboxSession, userContext.DraftsFolderId, replyForwardConfiguration);
                    }
                    ReplyForwardUtilities.SmartReplyOrForward(messageItem2, messageItem, userContext);
                    ReplyForwardUtilities.CopyMessageClassificationProperties(item, messageItem, userContext);
                }
                else if ((calendarItemBase = (item as CalendarItemBase)) != null)
                {
                    if (calendarItemBase.IsMeeting)
                    {
                        if (replyAll)
                        {
                            messageItem = calendarItemBase.CreateReplyAll(userContext.MailboxSession, userContext.DraftsFolderId, replyForwardConfiguration);
                        }
                        else
                        {
                            messageItem = calendarItemBase.CreateReply(userContext.MailboxSession, userContext.DraftsFolderId, replyForwardConfiguration);
                        }
                    }
                    else
                    {
                        flag2 = false;
                    }
                }
                else if ((postItem = (item as PostItem)) != null)
                {
                    if (replyAll)
                    {
                        messageItem = postItem.CreateReplyAll(userContext.MailboxSession, userContext.DraftsFolderId, replyForwardConfiguration);
                    }
                    else
                    {
                        messageItem = postItem.CreateReply(userContext.MailboxSession, userContext.DraftsFolderId, replyForwardConfiguration);
                    }
                }
                else
                {
                    flag2 = false;
                }
                if (!flag2)
                {
                    throw new OwaOperationNotSupportedException(LocalizedStrings.GetNonEncoded(293574673));
                }
                if (Globals.ArePerfCountersEnabled)
                {
                    OwaSingleCounters.ItemsCreated.Increment();
                }
                if (Utilities.IsFlagSet((int)flags, 1))
                {
                    ItemUtility.SetItemBody(messageItem, bodyFormat, text);
                }
                flag = false;
            }
            catch (NotSupportedException ex)
            {
                ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "Unable to create a Reply or ReplyAll item. Exception {0}", ex.Message);
                throw new OwaInvalidRequestException("Unable to create a Reply or ReplyAll item.");
            }
            finally
            {
                if (flag && messageItem != null)
                {
                    messageItem.Dispose();
                    messageItem = null;
                }
            }
            return(messageItem);
        }
Example #25
0
        internal IADOrgPerson CreateADOrgPersonForWebPartUserBySid()
        {
            IADOrgPerson iadorgPerson = this.CreateADRecipientBySid() as IADOrgPerson;

            if (iadorgPerson == null)
            {
                throw new OwaExplicitLogonException(string.Format("The SID {0} is an object in AD database but it is not an ADOrgPerson, which is required for web part delegate access", this.UserSid), LocalizedStrings.GetNonEncoded(-1332692688), null);
            }
            return(iadorgPerson);
        }
 // Token: 0x06000E61 RID: 3681 RVA: 0x0005BB50 File Offset: 0x00059D50
 protected void RenderPartialFailure(Strings.IDs messageString, Strings.IDs?titleString, ButtonDialogIcon icon, OwaEventHandlerErrorCode errorCode)
 {
     this.RenderPartialFailure(LocalizedStrings.GetHtmlEncoded(messageString), (titleString != null) ? LocalizedStrings.GetHtmlEncoded(titleString.Value) : null, icon, errorCode);
 }
Example #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);
        }
 // Token: 0x0600198F RID: 6543 RVA: 0x00095848 File Offset: 0x00093A48
 private Stream GetContentsReplacementStream(Strings.IDs resource)
 {
     byte[] encodedString = this.GetEncodedString(LocalizedStrings.GetNonEncoded(resource));
     return(new MemoryStream(encodedString, 0, encodedString.Length));
 }
        // Token: 0x0600079A RID: 1946 RVA: 0x00039FA8 File Offset: 0x000381A8
        public static bool BuildSendConfirmDialogPrompt(CalendarItemBase calendarItemBase, out string prompt)
        {
            if (calendarItemBase == null)
            {
                throw new ArgumentNullException("calendarItemBase");
            }
            prompt = null;
            StringBuilder stringBuilder = null;
            ExDateTime    localTime     = DateTimeUtilities.GetLocalTime();

            if (calendarItemBase.CalendarItemType == CalendarItemType.RecurringMaster)
            {
                CalendarItem calendarItem = calendarItemBase as CalendarItem;
                if (!(calendarItem.Recurrence.Range is NoEndRecurrenceRange))
                {
                    OccurrenceInfo lastOccurrence = calendarItem.Recurrence.GetLastOccurrence();
                    if (lastOccurrence != null && lastOccurrence.EndTime < localTime)
                    {
                        if (stringBuilder == null)
                        {
                            stringBuilder = new StringBuilder();
                        }
                        stringBuilder.Append("\n\t");
                        stringBuilder.Append(LocalizedStrings.GetNonEncoded(2056979915));
                    }
                }
            }
            else if (calendarItemBase.EndTime < localTime)
            {
                if (stringBuilder == null)
                {
                    stringBuilder = new StringBuilder();
                }
                stringBuilder.Append("\n\t");
                stringBuilder.Append(LocalizedStrings.GetNonEncoded(839442440));
            }
            if (string.IsNullOrEmpty(calendarItemBase.Subject))
            {
                if (stringBuilder == null)
                {
                    stringBuilder = new StringBuilder();
                }
                stringBuilder.Append("\n\t");
                stringBuilder.Append(LocalizedStrings.GetNonEncoded(-25858033));
            }
            if (string.IsNullOrEmpty(calendarItemBase.Location))
            {
                if (stringBuilder == null)
                {
                    stringBuilder = new StringBuilder();
                }
                stringBuilder.Append("\n\t");
                stringBuilder.Append(LocalizedStrings.GetNonEncoded(-1681723506));
            }
            if (stringBuilder != null)
            {
                stringBuilder.Insert(0, "\n");
                stringBuilder.Insert(0, LocalizedStrings.GetNonEncoded(1040416023));
                stringBuilder.Append("\n\n");
                stringBuilder.Append(LocalizedStrings.GetNonEncoded(105464887));
                prompt = stringBuilder.ToString();
                return(true);
            }
            return(false);
        }
        private void CommonEndProxyRequest(IAsyncResult asyncResult)
        {
            ExTraceGlobals.ProxyCallTracer.TraceDebug((long)this.GetHashCode(), "ProxyEventHandler.EndProxyRequest");
            AsyncResult asyncResult2 = (AsyncResult)asyncResult;

            try
            {
                if (asyncResult2.Exception != null)
                {
                    ExTraceGlobals.ProxyTracer.TraceDebug((long)this.GetHashCode(), "An exception was thrown during the processing of the async request");
                    AsyncExceptionWrapperHelper.GetRootException(asyncResult2.Exception);
                    Utilities.HandleException(base.OwaContext, new OwaProxyException("Error handling EwsProxy", LocalizedStrings.GetNonEncoded(-200732695), asyncResult2.Exception, false));
                }
            }
            finally
            {
                this.Dispose();
            }
        }