// Token: 0x060019E5 RID: 6629 RVA: 0x000963A0 File Offset: 0x000945A0 private static bool ValidateAndCapturePublishingUrl(HttpContext context, string url) { bool result = false; try { context.Items["AnonymousUserContextPublishedUrl"] = PublishingUrl.Create(url); result = true; } catch (ArgumentException) { ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "CalendarVDirRequestDispatcher.CreateAndCapturePublishingUrl: Invalid PublishingUrl - {0}", url); } return(result); }
internal static object PublishedUrlGetter(IPropertyBag propertyBag, SimpleProviderPropertyDefinition propertyDefinition) { string text = (string)propertyBag[propertyDefinition]; if (string.IsNullOrEmpty(text)) { return(null); } PublishingUrl publishingUrl = PublishingUrl.Create(text); ObscureUrl obscureUrl = publishingUrl as ObscureUrl; if (obscureUrl == null) { return(text); } return(obscureUrl.ChangeToKind(ObscureKind.Normal).ToString()); }
internal static void PublishedUrlSetter(object value, IPropertyBag propertyBag, SimpleProviderPropertyDefinition propertyDefinition) { string text = (string)value; if (string.IsNullOrEmpty(text)) { propertyBag[propertyDefinition] = null; return; } PublishingUrl publishingUrl = PublishingUrl.Create(text); ObscureUrl obscureUrl = publishingUrl as ObscureUrl; if (obscureUrl == null) { propertyBag[propertyDefinition] = text; return; } propertyBag[propertyDefinition] = obscureUrl.ChangeToKind(ObscureKind.Restricted).ToString(); }
private void SaveSharingAnonymous(MailboxCalendarFolder mailboxCalendarFolder, StoreObjectId folderId) { Util.ThrowOnNullArgument(mailboxCalendarFolder, "mailboxCalendarFolder"); Util.ThrowOnNullArgument(folderId, "folderId"); IRecipientSession adrecipientSession = base.MailboxSession.GetADRecipientSession(false, ConsistencyMode.FullyConsistent); ADRecipient adrecipient = adrecipientSession.Read(base.MailboxSession.MailboxOwner.ObjectId); if (adrecipient == null) { throw new ObjectNotFoundException(ServerStrings.ADUserNotFound); } ADUser aduser = adrecipient as ADUser; if (aduser == null) { ExTraceGlobals.SharingTracer.TraceDebug <ADRecipient>((long)this.GetHashCode(), "This is not an ADUser so SharingAnonymousIdentities doesn't apply. Recipient = {0}.", adrecipient); return; } if (mailboxCalendarFolder.PublishEnabled) { PublishingUrl publishingUrl = PublishingUrl.Create(mailboxCalendarFolder.PublishedCalendarUrl); ExTraceGlobals.SharingTracer.TraceDebug <ADUser, string, StoreObjectId>((long)this.GetHashCode(), "Publish is enabled and trying to add or update SharingAnonymousIdentities. User={0}; Url Identity={1}; Folder={2}.", aduser, publishingUrl.Identity, folderId); aduser.SharingAnonymousIdentities.AddOrUpdate(publishingUrl.DataType.ExternalName, publishingUrl.Identity, folderId.ToBase64String()); } else { PublishingUrl publishingUrl2 = PublishingUrl.Create(mailboxCalendarFolder.PublishedCalendarUrl); ExTraceGlobals.SharingTracer.TraceDebug <ADUser, string, StoreObjectId>((long)this.GetHashCode(), "Publish is NOT enabled and trying to remove SharingAnonymousIdentities. User={0}; Url Identity={1}; Folder={2}.", aduser, publishingUrl2.Identity, folderId); aduser.SharingAnonymousIdentities.Remove(publishingUrl2.Identity); } if (aduser.SharingAnonymousIdentities.Changed) { ExTraceGlobals.SharingTracer.TraceDebug <ADUser>((long)this.GetHashCode(), "Save SharingAnonymousIdentities on user {0}.", aduser); adrecipientSession.Save(aduser); } }