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 })); }
// Token: 0x0600025A RID: 602 RVA: 0x00015264 File Offset: 0x00013464 protected void RenderSilverlight(string rootVisualType, string id, int width, int height, string alternateHtml) { SanitizedHtmlString value = SanitizedHtmlString.Format("<div style=\"width:{1}px;height:{2}px;\"><object \r\n id=\"{0}\" \r\n data=\"data:application/x-silverlight-2,\"\r\n type=\"application/x-silverlight-2\"\r\n width=\"{1}\" \r\n height=\"{2}\"\r\n ><param name=\"source\" value=\"/OWA/{3}/ClientBin/{4}.xap\"/>\r\n <param name=\"initParams\" value=\"RootVisualType={5}.{6}\"/>\r\n <param name=\"onError\" value=\"{7}\" />\r\n <param name=\"minRuntimeVersion\" value=\"{8}\" />\r\n <param name=\"autoUpgrade\" value=\"true\" />{9}</object></div>", new object[] { id, width, height, Globals.ApplicationVersion, "OwaSl", "Microsoft.Exchange.Clients.Owa.Silverlight", rootVisualType, "SL_OnPluginError", "2.0.31005.0", alternateHtml }); base.Response.Output.Write(value); }
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); }
private void HandleRightsManagementException(RightsManagementException e, OwaStoreObjectId messageId, string correlator) { RightsManagementFailureCode failureCode = e.FailureCode; if (failureCode <= RightsManagementFailureCode.PreLicenseAcquisitionFailed) { if (failureCode == RightsManagementFailureCode.UserRightNotGranted) { this.EnqueueLicensingError(messageId, SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(-1796455575, this.userCulture), new object[] { string.Empty }), correlator); return; } if (failureCode != RightsManagementFailureCode.PreLicenseAcquisitionFailed) { goto IL_15E; } } else { switch (failureCode) { case RightsManagementFailureCode.FailedToExtractTargetUriFromMex: case RightsManagementFailureCode.FailedToDownloadMexData: this.EnqueueLicensingError(messageId, SanitizedHtmlString.FromStringId(1314141112, this.userCulture), correlator); return; case RightsManagementFailureCode.GetServerInfoFailed: goto IL_15E; case RightsManagementFailureCode.InternalLicensingDisabled: this.EnqueueLicensingError(messageId, SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(1049269714, this.userCulture), new object[] { Utilities.GetOfficeDownloadAnchor(Microsoft.Exchange.Data.Storage.BodyFormat.TextHtml, this.userCulture) }), correlator); return; case RightsManagementFailureCode.ExternalLicensingDisabled: this.EnqueueLicensingError(messageId, SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(1397740097, this.userCulture), new object[] { Utilities.GetOfficeDownloadAnchor(Microsoft.Exchange.Data.Storage.BodyFormat.TextHtml, this.userCulture) }), correlator); return; default: switch (failureCode) { case RightsManagementFailureCode.ServerRightNotGranted: this.EnqueueLicensingError(messageId, SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(784482022, this.userCulture), new object[] { string.Empty }), correlator); return; case RightsManagementFailureCode.InvalidLicensee: break; default: goto IL_15E; } break; } } this.EnqueueLicensingError(messageId, SanitizedHtmlString.FromStringId(-1489754529, this.userCulture), correlator); return; IL_15E: SanitizingStringBuilder <OwaHtml> sanitizingStringBuilder = new SanitizingStringBuilder <OwaHtml>(LocalizedStrings.GetNonEncoded(360598592)); sanitizingStringBuilder.Append("<br>"); sanitizingStringBuilder.AppendFormat(LocalizedStrings.GetHtmlEncoded(1633606253, this.userCulture), new object[] { e.Message }); this.EnqueueLicensingError(messageId, sanitizingStringBuilder.ToSanitizedString <SanitizedHtmlString>(), correlator); }
private void AcquireUseLicenseAndUsageRightsCallback(IAsyncResult asyncResult) { if (asyncResult == null) { throw new ArgumentNullException("asyncResult"); } if (asyncResult.AsyncState == null) { IrmLicensingManager.Tracer.TraceError((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: asyncResult.AsyncState is null."); throw new InvalidOperationException("asyncResult.AsyncState must NOT be null."); } IrmLicensingManager.AsyncState asyncState = (IrmLicensingManager.AsyncState)asyncResult.AsyncState; try { IrmLicensingManager.Tracer.TraceDebug <OwaStoreObjectId>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: calling EndAcquireUseLicenseAndUsageRights to get results for message {0}", asyncState.MessageId); UseLicenseAndUsageRights useLicenseAndUsageRights = RmsClientManager.EndAcquireUseLicenseAndUsageRights(asyncResult); if (string.IsNullOrEmpty(useLicenseAndUsageRights.UseLicense)) { IrmLicensingManager.Tracer.TraceError((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: Use license is null/empty"); throw new InvalidOperationException("Use license must NOT be null/empty"); } if (this.userContext.State != UserContextState.Active) { IrmLicensingManager.Tracer.TraceDebug((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: User context is no longer active. Bailing out."); } else { SafeRightsManagementHandle safeRightsManagementHandle = null; try { RmsClientManager.BindUseLicenseForDecryption(new RmsClientManagerContext(useLicenseAndUsageRights.OrganizationId, RmsClientManagerContext.ContextId.MessageId, asyncState.MessageId.ToString(), null), useLicenseAndUsageRights.LicensingUri, useLicenseAndUsageRights.UseLicense, useLicenseAndUsageRights.PublishingLicense, out safeRightsManagementHandle); } finally { if (safeRightsManagementHandle != null) { safeRightsManagementHandle.Close(); } } bool flag = false; try { this.userContext.Lock(); flag = true; using (Item item = Item.Bind(asyncState.MessageId.GetSession(this.userContext), asyncState.MessageId.StoreObjectId, ItemBindOption.None)) { MessageItem messageItem = item as MessageItem; if (messageItem == null) { IrmLicensingManager.Tracer.TraceError((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: bound item is not a message. Ignoring it."); } else { messageItem.OpenAsReadWrite(); messageItem[MessageItemSchema.DRMRights] = useLicenseAndUsageRights.UsageRights; messageItem[MessageItemSchema.DRMExpiryTime] = useLicenseAndUsageRights.ExpiryTime; if (!DrmClientUtils.IsCachingOfLicenseDisabled(useLicenseAndUsageRights.UseLicense)) { using (Stream stream = messageItem.OpenPropertyStream(MessageItemSchema.DRMServerLicenseCompressed, PropertyOpenMode.Create)) { DrmEmailCompression.CompressUseLicense(useLicenseAndUsageRights.UseLicense, stream); } } messageItem[MessageItemSchema.DRMPropsSignature] = useLicenseAndUsageRights.DRMPropsSignature; RightsManagedMessageItem rightsManagedMessageItem = messageItem as RightsManagedMessageItem; if (rightsManagedMessageItem != null && rightsManagedMessageItem.IsRestricted && !rightsManagedMessageItem.TryDecode(Utilities.CreateOutboundConversionOptions(this.userContext), false).Failed) { bool flag2 = false; foreach (AttachmentHandle attachmentHandle in rightsManagedMessageItem.ProtectedAttachmentCollection) { if (!attachmentHandle.IsInline) { flag2 = true; break; } } messageItem[MessageItemSchema.AllAttachmentsHidden] = !flag2; rightsManagedMessageItem.AbandonChangesOnProtectedData(); } messageItem.Save(SaveMode.ResolveConflicts); if (DrmClientUtils.IsCachingOfLicenseDisabled(useLicenseAndUsageRights.UseLicense)) { this.EnqueueLicensingError(asyncState.MessageId, SanitizedHtmlString.FromStringId(-1616549110, this.userCulture), asyncState.RequestCorrelator); } else { this.EnqueueLicenseAcquired(asyncState.MessageId, asyncState.RequestCorrelator); } } } } finally { if (this.userContext.LockedByCurrentThread() && flag) { this.userContext.Unlock(); } } } } catch (OwaLockTimeoutException arg) { IrmLicensingManager.Tracer.TraceError <OwaLockTimeoutException>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: timed-out at acquiring user context lock. Exception: {0}", arg); this.EnqueueLicensingError(asyncState.MessageId, new SanitizedHtmlString(LocalizedStrings.GetNonEncoded(858913858)), asyncState.RequestCorrelator); } catch (ExchangeConfigurationException arg2) { IrmLicensingManager.Tracer.TraceError <ExchangeConfigurationException>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: caught exception. Exception: {0}", arg2); this.HandleExchangeConfigurationException(asyncState.MessageId, asyncState.RequestCorrelator); } catch (RightsManagementException ex) { IrmLicensingManager.Tracer.TraceError <RightsManagementException>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: caught exception. Exception: {0}", ex); this.HandleRightsManagementException(ex, asyncState.MessageId, asyncState.RequestCorrelator); } catch (StoragePermanentException ex2) { IrmLicensingManager.Tracer.TraceError <StoragePermanentException>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: caught exception. Exception: {0}", ex2); this.EnqueueLicensingError(asyncState.MessageId, SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(994351595, this.userCulture), new object[] { ex2.Message }), asyncState.RequestCorrelator); } catch (TransientException arg3) { IrmLicensingManager.Tracer.TraceError <TransientException>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: caught exception. Exception: {0}", arg3); this.EnqueueLicensingError(asyncState.MessageId, new SanitizedHtmlString(LocalizedStrings.GetNonEncoded(858913858)), asyncState.RequestCorrelator); } catch (Exception ex3) { IrmLicensingManager.Tracer.TraceError <Exception>((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: caught exception. Exception: {0}", ex3); if (Globals.SendWatsonReports) { IrmLicensingManager.Tracer.TraceError((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: sending watson report..."); string data = string.Format("OWA version: {0}; Message Id: {1}", Globals.ApplicationVersion, asyncState.MessageId.ToBase64String()); ExWatson.AddExtraData(data); ExWatson.SendReport(ex3, ReportOptions.None, null); IrmLicensingManager.Tracer.TraceError((long)this.GetHashCode(), "AcquireLicenseAndRightsCB: watson report has been sent."); } } }