示例#1
0
 // Token: 0x06000186 RID: 390 RVA: 0x0000E749 File Offset: 0x0000C949
 public Toolbar(TextWriter writer, bool isHeader)
 {
     if (writer == null)
     {
         throw new ArgumentNullException("writer");
     }
     this.writer      = writer;
     this.isHeader    = isHeader;
     this.userContext = UserContextManager.GetUserContext();
 }
        protected override string GetUserUPN()
        {
            string      result      = string.Empty;
            UserContext userContext = UserContextManager.GetUserContext(base.Context);

            if (userContext != null && userContext.ExchangePrincipal != null)
            {
                result = userContext.UserPrincipalName;
            }
            return(result);
        }
示例#3
0
        protected override void RenderSelectedValue(TextWriter writer)
        {
            UserContext userContext = UserContextManager.GetUserContext();

            if (this.selectedDate == ExDateTime.MinValue)
            {
                writer.Write(SanitizedHtmlString.FromStringId(1414246128));
                return;
            }
            writer.Write(this.selectedDate.ToString(userContext.UserOptions.GetWeekdayDateFormat(false)), writer);
        }
        protected override bool InternalExecute()
        {
            UserContext userContext = UserContextManager.GetUserContext(CallContext.Current.HttpContext, CallContext.Current.EffectiveCaller, true);
            List <IConnectedAccountsNotificationManager> connectedAccountNotificationManagers = userContext.GetConnectedAccountNotificationManagers(base.MailboxIdentityMailboxSession);

            foreach (IConnectedAccountsNotificationManager notificationManager in connectedAccountNotificationManagers)
            {
                this.SendSyncNowNotification(notificationManager);
            }
            return(true);
        }
示例#5
0
        protected virtual bool CalculateCompositeSessionDataEnabled()
        {
            bool result = false;

            if (this.IsAppCacheEnabledClient && !this.IsClientInOfflineMode && !DefaultPageBase.IsRecoveryBoot(this.Context))
            {
                UserContext userContext = UserContextManager.GetUserContext(this.Context);
                result = (userContext != null && userContext.FeaturesManager != null && userContext.FeaturesManager.ServerSettings.OwaCompositeSessionData.Enabled);
            }
            return(result);
        }
示例#6
0
 private static UserContextManager CreateUserContextManager()
 {
     // use NAV User Password authentication
     userContextManager = new NAVUserContextManager(
         Settings.Default.NAVClientService,
         null,
         null,
         PurchasingAgentRoleCenterId,
         Settings.Default.NAVUserName,
         Settings.Default.NAVUserPassword);
     return(userContextManager);
 }
示例#7
0
 private static UserContextManager CreateUserContextManager()
 {
     // use NAV User Password authentication
     userContextManager = new NAVUserContextManager(
         Settings.Default.NAVClientService,
         null,
         null,
         SmallBusinessRoleCentre,
         Settings.Default.NAVUserName,
         Settings.Default.NAVUserPassword);
     return(userContextManager);
 }
示例#8
0
        public void ProcessRequest(HttpContext context)
        {
            string      userContextId           = Plt1WebHandler.GetUserContextId(context);
            bool        isMowa                  = OfflineClientRequestUtilities.IsRequestFromMOWAClient(context.Request, context.Request.UserAgent);
            HttpRequest request                 = context.Request;
            string      clientAddressWithoutPII = this.GetClientAddressWithoutPII(request);
            UserAgent   userAgent               = OwaUserAgentUtilities.CreateUserAgentWithLayoutOverride(context);
            string      userName                = string.Empty;
            string      cookieValueAndSetIfNull = ClientIdCookie.GetCookieValueAndSetIfNull(context);
            UserContext userContext             = UserContextManager.GetUserContext(context, false);

            if (userContext != null && userContext.LogonIdentity != null)
            {
                SmtpAddress primarySmtpAddress = userContext.LogonIdentity.PrimarySmtpAddress;
                userName = userContext.LogonIdentity.PrimarySmtpAddress.ToString();
            }
            if (Plt1WebHandler.IsPlt1PerformanceRequest(request))
            {
                string text = "";
                if (context.Request.HttpMethod == "POST")
                {
                    using (StreamReader streamReader = new StreamReader(context.Request.InputStream))
                    {
                        text = streamReader.ReadToEnd();
                        context.Response.AppendToLog(text);
                    }
                }
                string clientVersion = context.Request.QueryString.Get("cver") ?? string.Empty;
                Uri    uri;
                string refererQueryString = request.TryParseUrlReferrer(out uri) ? uri.Query : "noRefUrl";
                Dictionary <string, string> dictionary  = new Dictionary <string, string>();
                Dictionary <string, string> dictionary2 = new Dictionary <string, string>();
                Plt1WebHandler.GetPlt1PerformanceEventData(userAgent, refererQueryString, request.QueryString, text, dictionary, dictionary2);
                Plt1WebHandler.AddClientLoadTimeDataPoint(dictionary, dictionary2, userContextId, clientAddressWithoutPII, clientVersion, isMowa, userName, userContext, cookieValueAndSetIfNull);
                if (dictionary2.Count > 0 && dictionary.ContainsKey("msg") && dictionary["msg"].Contains("success"))
                {
                    Plt1WebHandler.AddCalculatedClientLoadTimeDataPoint(dictionary, dictionary2, userContextId, clientAddressWithoutPII, clientVersion, isMowa, userName, cookieValueAndSetIfNull);
                }
                if (userContext != null && userContext.FeaturesManager != null && userContext.FeaturesManager.ServerSettings.OwaServerLogonActivityLogging.Enabled)
                {
                    this.AddtoActivityLog(userContext, dictionary, userName, clientAddressWithoutPII, userAgent.RawString);
                }
            }
            else
            {
                string         clientVersion2  = context.Request.QueryString.Get("v") ?? string.Empty;
                ClientLogEvent plt1AccessEvent = Plt1WebHandler.GetPlt1AccessEvent(userContextId, request.UserAgent, clientAddressWithoutPII, clientVersion2, isMowa, cookieValueAndSetIfNull);
                OwaClientLogger.AppendToLog(plt1AccessEvent);
            }
            Plt1WebHandler.SetResponseHeaders(context.Response);
            Plt1WebHandler.WriteImage(context.Response);
        }
示例#9
0
        public static ContentCountDisplay GetDefaultContentCountDisplay(StoreObjectId folderId)
        {
            DefaultFolderType defaultFolderType = Utilities.GetDefaultFolderType(UserContextManager.GetUserContext().MailboxSession, folderId);

            if (defaultFolderType == DefaultFolderType.Root)
            {
                return(ContentCountDisplay.None);
            }
            if (defaultFolderType == DefaultFolderType.Outbox || defaultFolderType == DefaultFolderType.Drafts || defaultFolderType == DefaultFolderType.JunkEmail)
            {
                return(ContentCountDisplay.ItemCount);
            }
            return(ContentCountDisplay.UnreadCount);
        }
示例#10
0
        // Token: 0x0600287B RID: 10363 RVA: 0x00095BDC File Offset: 0x00093DDC
        public void ProcessRequest(HttpContext context)
        {
            this.Context = context;
            UserContext userContext       = UserContextManager.GetUserContext(context);
            string      currentOwaVersion = userContext.CurrentOwaVersion;

            this.pageContext             = this.GetPageContext(context, currentOwaVersion);
            this.SessionDataEnabled      = false;
            context.Response.ContentType = "application/x-javascript";
            this.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            this.Response.CacheControl = "No-Cache";
            this.Response.Cache.SetNoServerCaching();
            ResourceBase[] userDataEmbeddedLinks = UserResourcesFinder.GetUserDataEmbeddedLinks(this.pageContext.ManifestType, this.pageContext.UserAgent.Layout, currentOwaVersion);
            UserSpecificResourceInjectorBase.WriteScriptBlock(new Action <string>(this.Context.Response.Write), this.pageContext, userContext, userDataEmbeddedLinks, currentOwaVersion);
        }
示例#11
0
 // Token: 0x06001BDD RID: 7133 RVA: 0x000A0904 File Offset: 0x0009EB04
 public static void RenderCheckBox(TextWriter writer, string id)
 {
     writer.Write("<input type=\"checkbox\" name=\"chkmsg\" value=\"");
     writer.Write(id);
     writer.Write("\" title=\"");
     writer.Write(LocalizedStrings.GetHtmlEncoded(-1126382593));
     writer.Write("\" ");
     if (UserContextManager.GetUserContext().IsBasicExperience)
     {
         writer.Write("onclick=\"onClkChkBx(this);\"");
     }
     else
     {
         Utilities.RenderScriptHandler(writer, "onclick", "onClkChkBx(_this);");
     }
     writer.Write(">");
 }
        // Token: 0x060006CD RID: 1741 RVA: 0x00035310 File Offset: 0x00033510
        public static StoreObjectId GetStoreObjectId(HttpRequest request, string parameterName, bool required, ParameterIn parameterIn)
        {
            string text;

            if (parameterIn == ParameterIn.QueryString)
            {
                text = Utilities.GetQueryStringParameter(request, parameterName, required);
            }
            else
            {
                text = Utilities.GetFormParameter(request, parameterName, required);
            }
            if (text == null)
            {
                return(null);
            }
            return(Utilities.CreateStoreObjectId(UserContextManager.GetUserContext().MailboxSession, text));
        }
        private UserContextManager CreateUserContextManager()
        {
            switch (Authentication)
            {
            case AuthenticationScheme.Windows:
                // Use the current windows user
                orderProcessorUserContextManager = new WindowsUserContextManager(
                    ClientServiceUrl,
                    null,
                    null,
                    OrderProcessorRoleCenterId);
                break;

            case AuthenticationScheme.UserNamePassword:
                // Use Username / Password authentication
                orderProcessorUserContextManager = new NAVUserContextManager(
                    ClientServiceUrl,
                    null,
                    null,
                    OrderProcessorRoleCenterId,
                    Username,
                    Password);
                break;

            case AuthenticationScheme.AzureActiveDirectory:
                // Use Username / Password authentication
                orderProcessorUserContextManager = new AADUserContextManager(
                    ClientServiceUrl,
                    Settings.Default.Tenant,
                    null,
                    OrderProcessorRoleCenterId,
                    Username,
                    Password,
                    Settings.Default.Authority,
                    Settings.Default.Resource,
                    Settings.Default.ClientId,
                    Settings.Default.ClientSecret);
                break;

            default:
                throw new Exception("Unknown authentication scheme");
            }
            return(orderProcessorUserContextManager);
        }
        // Token: 0x06001F22 RID: 7970 RVA: 0x000B2F3C File Offset: 0x000B113C
        private CategoryDropDownList(OwaStoreObjectId folderId) : base("divCDd", null, null)
        {
            UserContext        userContext        = UserContextManager.GetUserContext();
            MasterCategoryList masterCategoryList = userContext.GetMasterCategoryList(folderId);

            if (masterCategoryList != null)
            {
                this.categories = masterCategoryList.ToArray();
                Array.Sort <Category>(this.categories, new MostRecentlyUsedCategories.CategoryNameComparer());
                if (0 < this.categories.Length)
                {
                    this.selectedCategory = this.categories[0];
                    base.SelectedValue    = this.selectedCategory.Name;
                    return;
                }
            }
            else
            {
                this.categories = new Category[0];
            }
        }
示例#15
0
        // Token: 0x06002FCF RID: 12239 RVA: 0x0011657C File Offset: 0x0011477C
        public static void RenderReminderDropdownList(TextWriter output, Item item, bool isReminderSet, bool forceDisable)
        {
            if (output == null)
            {
                throw new ArgumentNullException("output");
            }
            UserContext userContext  = UserContextManager.GetUserContext();
            double      reminderTime = (double)userContext.CalendarSettings.DefaultReminderTime;

            if (item != null && item.TryGetProperty(ItemSchema.ReminderMinutesBeforeStart) is int)
            {
                int num = (int)item[ItemSchema.ReminderMinutesBeforeStart];
                if (num >= 0 && num <= 5040000)
                {
                    reminderTime = (double)num;
                }
            }
            new ReminderDropDownList("divRmdTime", reminderTime)
            {
                Enabled = (!forceDisable && isReminderSet)
            }.Render(output);
        }
        // Token: 0x06001BF4 RID: 7156 RVA: 0x0006C8D0 File Offset: 0x0006AAD0
        protected override string InternalExecute()
        {
            Guid        guid        = Guid.NewGuid();
            UserContext userContext = UserContextManager.GetUserContext(base.CallContext.HttpContext, base.CallContext.EffectiveCaller, true);

            if (this.permissionsRequest.AttachmentDataProviderPermissions != null)
            {
                base.CallContext.ProtocolLog.Set(UpdateAttachmentPermissionsMetadata.NumberOfUserIDs, this.permissionsRequest.UserIds.Length);
                List <string> largeDLsList;
                this.permissionsRequest.UserIds = UpdateAttachmentPermissions.ExpandDLsAndGetAllUsers(userContext, this.permissionsRequest.UserIds, out largeDLsList, base.CallContext);
                List <string> resourceList;
                Dictionary <string, List <AttachmentPermissionAssignment> > dictionary = this.ProcessUpdateAttachmentPermissionsRequest(this.permissionsRequest, userContext, base.CallContext, out resourceList);
                base.CallContext.ProtocolLog.Set(UpdateAttachmentPermissionsMetadata.NumberOfAttachmentDataProviders, dictionary.Count);
                base.CallContext.ProtocolLog.Set(UpdateAttachmentPermissionsMetadata.NumberOfUsersToSetPermissions, this.permissionsRequest.UserIds.Length);
                foreach (KeyValuePair <string, List <AttachmentPermissionAssignment> > keyValuePair in dictionary)
                {
                    AttachmentDataProvider provider = userContext.AttachmentDataProviderManager.GetProvider(base.CallContext, keyValuePair.Key);
                    UpdateAttachmentPermissions.UpdateAttachmentPermissionsAsync(provider, this.permissionsRequest.UserIds, keyValuePair.Value.ToArray(), userContext, resourceList, largeDLsList);
                }
            }
            return(guid.ToString());
        }
 private UserContextManager CreateUserContextManager()
 {
     if (UseWindowsAuthentication)
     {
         // Use the current windows user
         orderProcessorUserContextManager = new WindowsUserContextManager(
             NAVClientService,
             null,
             null,
             OrderProcessorRoleCenterId);
     }
     else
     {
         // Use Username / Password authentication
         orderProcessorUserContextManager = new NAVUserContextManager(
             NAVClientService,
             null,
             null,
             OrderProcessorRoleCenterId,
             NAVUserName,
             NAVPassword);
     }
     return(orderProcessorUserContextManager);
 }
        // Token: 0x060006CF RID: 1743 RVA: 0x0003535C File Offset: 0x0003355C
        public static StoreObjectId[] GetStoreObjectIdsFromForm(HttpRequest request, string parameterName, bool required)
        {
            UserContext userContext   = UserContextManager.GetUserContext();
            string      formParameter = Utilities.GetFormParameter(request, parameterName, required);

            if (formParameter == null && !required)
            {
                return(null);
            }
            string[] array = formParameter.Split(new char[]
            {
                ','
            });
            if (userContext.UserOptions.BasicViewRowCount < array.Length)
            {
                throw new OwaInvalidRequestException("According to the user's option, at most " + userContext.UserOptions.BasicViewRowCount + " items are allow to be selected at one time");
            }
            StoreObjectId[] array2 = new StoreObjectId[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                array2[i] = Utilities.CreateStoreObjectId(userContext.MailboxSession, array[i]);
            }
            return(array2);
        }
示例#19
0
 public Toolbar()
 {
     this.userContext = UserContextManager.GetUserContext();
 }
示例#20
0
 public AttachmentWellInfo(AttachmentCollection collection, Attachment attachment, bool isJunkOrPhishing)
 {
     this.collection   = collection;
     this.attachmentId = attachment.Id;
     if (isJunkOrPhishing)
     {
         this.attachmentLevel = AttachmentPolicy.Level.Block;
     }
     else
     {
         this.attachmentLevel = AttachmentLevelLookup.GetAttachmentLevel(attachment, UserContextManager.GetUserContext());
     }
     this.attachmentType = attachment.AttachmentType;
     this.fileName       = attachment.FileName;
     if (this.attachmentType == AttachmentType.EmbeddedMessage)
     {
         using (Item itemAsReadOnly = ((ItemAttachment)attachment).GetItemAsReadOnly(null))
         {
             this.displayName = AttachmentUtility.GetEmbeddedAttachmentDisplayName(itemAsReadOnly);
         }
         this.fileExtension = ".msg";
     }
     else
     {
         this.displayName   = attachment.DisplayName;
         this.fileExtension = ((attachment.FileExtension == null) ? string.Empty : attachment.FileExtension);
     }
     this.isInline       = attachment.IsInline;
     this.attachmentSize = attachment.Size;
     this.attachmentName = AttachmentUtility.CalculateAttachmentName(this.displayName, this.fileName);
     this.mimeType       = AttachmentUtility.CalculateContentType(attachment);
     this.textCharset    = attachment.TextCharset;
 }
示例#21
0
 public AttachmentWellInfo(OwaStoreObjectId owaConversationId, AttachmentInfo attachmentInfo, bool isJunkOrPhishing)
 {
     this.messageId    = OwaStoreObjectId.CreateFromStoreObjectId(attachmentInfo.MessageId, owaConversationId);
     this.attachmentId = attachmentInfo.AttachmentId;
     if (isJunkOrPhishing)
     {
         this.attachmentLevel = AttachmentPolicy.Level.Block;
     }
     else
     {
         this.attachmentLevel = AttachmentLevelLookup.GetAttachmentLevel(attachmentInfo, UserContextManager.GetUserContext());
     }
     this.attachmentType = attachmentInfo.AttachmentType;
     this.fileName       = attachmentInfo.FileName;
     this.displayName    = attachmentInfo.DisplayName;
     this.isInline       = attachmentInfo.IsInline;
     this.attachmentSize = attachmentInfo.Size;
     this.fileExtension  = attachmentInfo.FileExtension;
     this.attachmentName = AttachmentUtility.CalculateAttachmentName(attachmentInfo.DisplayName, attachmentInfo.FileName);
     this.mimeType       = attachmentInfo.ContentType;
 }
示例#22
0
 public AttachmentWellInfo(AttachmentCollection collection, AttachmentLink attachmentLink, bool isJunkOrPhishing)
 {
     this.collection   = collection;
     this.attachmentId = attachmentLink.AttachmentId;
     if (isJunkOrPhishing)
     {
         this.attachmentLevel = AttachmentPolicy.Level.Block;
     }
     else
     {
         this.attachmentLevel = AttachmentLevelLookup.GetAttachmentLevel(attachmentLink, UserContextManager.GetUserContext());
     }
     this.attachmentType = attachmentLink.AttachmentType;
     this.fileName       = attachmentLink.Filename;
     this.displayName    = attachmentLink.DisplayName;
     this.isInline       = attachmentLink.IsInline(true);
     this.attachmentSize = attachmentLink.Size;
     this.fileExtension  = attachmentLink.FileExtension;
     this.attachmentName = AttachmentUtility.CalculateAttachmentName(attachmentLink.DisplayName, attachmentLink.Filename);
     this.mimeType       = attachmentLink.ContentType;
 }
示例#23
0
        private static void PopulateAttachmentProperties(IdAndSession idAndSession, Item item, Attachment attachment, ModernAttachment outAttachment)
        {
            if (outAttachment == null || attachment == null || item == null)
            {
                return;
            }
            outAttachment.Data = new ModernAttachment.AttachmentData();
            outAttachment.Data.AttachmentEx = new AttachmentTypeEx();
            switch (attachment.AttachmentType)
            {
            case AttachmentType.NoAttachment:
                break;

            case AttachmentType.Stream:
            {
                StreamAttachment streamAttachment = attachment as StreamAttachment;
                if (streamAttachment != null)
                {
                    FileAttachmentType fileAttachmentType = new FileAttachmentType();
                    outAttachment.Data.Attachment     = fileAttachmentType;
                    fileAttachmentType.IsContactPhoto = streamAttachment.IsContactPhoto;
                }
                break;
            }

            case AttachmentType.EmbeddedMessage:
            {
                ItemAttachment itemAttachment = attachment as ItemAttachment;
                if (itemAttachment != null)
                {
                    outAttachment.Data.Attachment = new ItemAttachmentType();
                }
                break;
            }

            case AttachmentType.Ole:
            {
                OleAttachment oleAttachment = attachment as OleAttachment;
                if (oleAttachment != null)
                {
                    FileAttachmentType fileAttachmentType2 = new FileAttachmentType();
                    outAttachment.Data.Attachment      = fileAttachmentType2;
                    fileAttachmentType2.IsContactPhoto = oleAttachment.IsContactPhoto;
                }
                break;
            }

            case AttachmentType.Reference:
            {
                ReferenceAttachment referenceAttachment = attachment as ReferenceAttachment;
                if (referenceAttachment != null)
                {
                    UserContext userContext = UserContextManager.GetUserContext(HttpContext.Current);
                    if (userContext != null && userContext.FeaturesManager != null && userContext.FeaturesManager.ClientServerSettings.AttachmentsFilePicker.Enabled)
                    {
                        ReferenceAttachmentType referenceAttachmentType = new ReferenceAttachmentType();
                        outAttachment.Data.Attachment = referenceAttachmentType;
                        referenceAttachmentType.AttachLongPathName  = referenceAttachment.AttachLongPathName;
                        referenceAttachmentType.ProviderEndpointUrl = referenceAttachment.ProviderEndpointUrl;
                        referenceAttachmentType.ProviderType        = referenceAttachment.ProviderType;
                    }
                    else
                    {
                        outAttachment.Data.Attachment = new FileAttachmentType();
                    }
                }
                break;
            }

            default:
                return;
            }
            if (outAttachment.Data.Attachment == null)
            {
                outAttachment.Data.Attachment = new AttachmentType();
            }
            IdAndSession idAndSession2;

            if (idAndSession == null)
            {
                idAndSession2 = new IdAndSession(item.Id, item.Session);
            }
            else
            {
                idAndSession2 = idAndSession.Clone();
            }
            idAndSession2.AttachmentIds.Add(attachment.Id);
            outAttachment.Data.Attachment.AttachmentId     = new AttachmentIdType(idAndSession2.GetConcatenatedId().Id);
            outAttachment.Data.Attachment.ContentId        = (string.IsNullOrEmpty(attachment.ContentId) ? null : attachment.ContentId);
            outAttachment.Data.Attachment.ContentLocation  = ((attachment.ContentLocation == null) ? null : attachment.ContentLocation.PathAndQuery);
            outAttachment.Data.Attachment.ContentType      = attachment.ContentType;
            outAttachment.Data.Attachment.IsInline         = attachment.IsInline;
            outAttachment.Data.Attachment.LastModifiedTime = GetModernAttachmentsCommand.Utilities.FormatExDateTime(attachment.LastModifiedTime);
            outAttachment.Data.Attachment.Name             = attachment.DisplayName;
            outAttachment.Data.Attachment.Size             = (int)attachment.Size;
        }
示例#24
0
 protected void WriteUserSpecificScripts()
 {
     UserSpecificResourceInjectorBase.WriteScriptBlock(new Action <string>(base.Response.Write), this, UserContextManager.GetUserContext(HttpContext.Current), this.UserDataEmbeddedLinks, this.VersionString);
 }
        internal static bool GetReminderItems(ExDateTime actualizationTime, TextWriter output)
        {
            UserContext userContext = UserContextManager.GetUserContext();

            return(RemindersRenderingUtilities.GetReminderItemsInternal(userContext, actualizationTime, output));
        }
示例#26
0
		// Token: 0x060026B1 RID: 9905 RVA: 0x0008C268 File Offset: 0x0008A468
		protected override string GetFeaturesSupportedJsonArray(FlightedFeatureScope scope)
		{
			UserContext userContext = UserContextManager.GetUserContext(HttpContext.Current);
			return UserResourcesFinder.GetEnabledFlightedFeaturesJsonArray(this.ManifestType, userContext, scope);
		}
示例#27
0
 public TokenAuthenticationMiddleware(RequestDelegate next, UserContextManager contextManager)
 {
     _next           = next;
     _contextManager = contextManager;
 }
        // Token: 0x0600310C RID: 12556 RVA: 0x0012096C File Offset: 0x0011EB6C
        public static void RenderSuggestions(TextWriter output, Suggestion[] meetingSuggestions, MailboxData[] mailboxDataArray, SchedulingRecipientInfo[] schedulingRecipientInfos, UserContext userContext)
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug(0L, "SchedulingTabRenderingUtilities.RenderSuggestions");
            UserOptions userOptions = UserContextManager.GetUserContext().UserOptions;

            foreach (Suggestion suggestion in meetingSuggestions)
            {
                int[]         array          = new int[suggestion.AvailableRoomsCount];
                int           num            = 0;
                int           num2           = suggestion.RequiredAttendeeCount - suggestion.RequiredAttendeeConflictCount;
                int           num3           = suggestion.OptionalAttendeeCount - suggestion.OptionalAttendeeConflictCount;
                StringBuilder stringBuilder  = new StringBuilder();
                StringBuilder stringBuilder2 = new StringBuilder();
                StringBuilder stringBuilder3 = new StringBuilder();
                StringBuilder stringBuilder4 = new StringBuilder();
                int           j = 0;
                while (j < mailboxDataArray.Length)
                {
                    AttendeeConflictData attendeeConflictData = suggestion.AttendeeConflictDataArray[j];
                    MeetingAttendeeType  meetingAttendeeType  = MeetingAttendeeType.Required;
                    StringBuilder        stringBuilder5       = null;
                    string value = string.Empty;
                    if (attendeeConflictData is IndividualAttendeeConflictData)
                    {
                        IndividualAttendeeConflictData individualAttendeeConflictData = (IndividualAttendeeConflictData)attendeeConflictData;
                        if (individualAttendeeConflictData.Attendee.AttendeeType == MeetingAttendeeType.Room && !individualAttendeeConflictData.AttendeeHasConflict)
                        {
                            array[num++] = j;
                        }
                        else
                        {
                            if (individualAttendeeConflictData.AttendeeHasConflict)
                            {
                                meetingAttendeeType = individualAttendeeConflictData.Attendee.AttendeeType;
                                value = schedulingRecipientInfos[j].DisplayName;
                                goto IL_1F5;
                            }
                            if (individualAttendeeConflictData.IsMissingFreeBusyData)
                            {
                                stringBuilder5 = stringBuilder4;
                                value          = schedulingRecipientInfos[j].DisplayName;
                                goto IL_1F5;
                            }
                        }
                    }
                    else
                    {
                        if (attendeeConflictData is UnknownAttendeeConflictData)
                        {
                            stringBuilder5 = stringBuilder4;
                            value          = schedulingRecipientInfos[j].DisplayName;
                            goto IL_1F5;
                        }
                        if (attendeeConflictData is TooBigGroupAttendeeConflictData)
                        {
                            stringBuilder5 = stringBuilder4;
                            value          = schedulingRecipientInfos[j].DisplayName;
                            goto IL_1F5;
                        }
                        if (attendeeConflictData is GroupAttendeeConflictData)
                        {
                            GroupAttendeeConflictData groupAttendeeConflictData = (GroupAttendeeConflictData)attendeeConflictData;
                            if (0 < groupAttendeeConflictData.NumberOfMembersWithNoData)
                            {
                                if (0 < stringBuilder4.Length)
                                {
                                    stringBuilder4.Append(", ");
                                }
                                stringBuilder4.AppendFormat(LocalizedStrings.GetNonEncoded(-1170293090), schedulingRecipientInfos[j].DisplayName, groupAttendeeConflictData.NumberOfMembersWithNoData);
                            }
                            if (groupAttendeeConflictData.NumberOfMembersWithConflict != 0)
                            {
                                MailboxData mailboxData = mailboxDataArray[j];
                                meetingAttendeeType = mailboxData.AttendeeType;
                                value = string.Format(LocalizedStrings.GetNonEncoded(-1505134519), schedulingRecipientInfos[j].DisplayName, groupAttendeeConflictData.NumberOfMembersWithConflict, groupAttendeeConflictData.NumberOfMembers);
                                goto IL_1F5;
                            }
                        }
                    }
IL_24B:
                    j++;
                    continue;
IL_1F5:
                    if (stringBuilder5 == null)
                    {
                        switch (meetingAttendeeType)
                        {
                        case MeetingAttendeeType.Organizer:
                        case MeetingAttendeeType.Required:
                            stringBuilder5 = stringBuilder;
                            break;

                        case MeetingAttendeeType.Optional:
                            stringBuilder5 = stringBuilder2;
                            break;

                        case MeetingAttendeeType.Room:
                        case MeetingAttendeeType.Resource:
                            stringBuilder5 = stringBuilder3;
                            break;
                        }
                    }
                    if (0 < stringBuilder5.Length)
                    {
                        stringBuilder5.Append(", ");
                    }
                    stringBuilder5.Append(value);
                    goto IL_24B;
                }
                output.Write("<div class=\"sug\" st=");
                output.Write(suggestion.MeetingTime.TimeOfDay.TotalMinutes);
                output.Write(" title=\"");
                if (0 < suggestion.RequiredAttendeeConflictCount || 0 < suggestion.OptionalAttendeeConflictCount || 0 < suggestion.ResourceAttendeeConflictCount)
                {
                    output.Write(LocalizedStrings.GetHtmlEncoded(-1917590199));
                    if (0 < stringBuilder.Length)
                    {
                        output.Write("\n");
                        output.Write(LocalizedStrings.GetHtmlEncoded(-1709254790));
                        output.Write(" ");
                        Utilities.HtmlEncode(stringBuilder.ToString(), output);
                    }
                    if (0 < stringBuilder2.Length)
                    {
                        output.Write("\n");
                        output.Write(LocalizedStrings.GetHtmlEncoded(-98673561));
                        output.Write(" ");
                        Utilities.HtmlEncode(stringBuilder2.ToString(), output);
                    }
                    if (0 < stringBuilder3.Length)
                    {
                        output.Write("\n");
                        output.Write(LocalizedStrings.GetHtmlEncoded(-294537986));
                        output.Write(" ");
                        Utilities.HtmlEncode(stringBuilder3.ToString(), output);
                    }
                    if (0 < stringBuilder4.Length)
                    {
                        output.Write("\n");
                        output.Write(LocalizedStrings.GetHtmlEncoded(608956012));
                        output.Write(" ");
                        Utilities.HtmlEncode(stringBuilder4.ToString(), output);
                    }
                }
                output.Write("\">");
                output.Write("<div class=\"");
                output.Write(SchedulingTabRenderingUtilities.SuggestionQualityStyles[(int)suggestion.SuggestionQuality]);
                output.Write("\"></div><div class=\"suggestDetail\">");
                output.Write("<div class=\"when\"><span>");
                output.Write(suggestion.MeetingTime.ToString(userOptions.TimeFormat));
                if (0 < suggestion.RoomCount)
                {
                    output.Write(" - ");
                    output.Write((suggestion.RoomCount == 1) ? LocalizedStrings.GetHtmlEncoded(-1595764264) : LocalizedStrings.GetHtmlEncoded(-1962164027), suggestion.AvailableRoomsCount);
                }
                output.Write("</span></div>");
                output.Write("<div class=\"atndcnt\">");
                if (0 < suggestion.RequiredAttendeeCount)
                {
                    output.Write("<span nowrap>");
                    userContext.RenderThemeImage(output, ThemeFileId.RequiredAttendee);
                    output.Write(LocalizedStrings.GetHtmlEncoded(1026164821), num2, suggestion.RequiredAttendeeCount);
                    output.Write("</span>");
                }
                if (0 < suggestion.OptionalAttendeeCount)
                {
                    output.Write(" <span nowrap>");
                    userContext.RenderThemeImage(output, ThemeFileId.OptionalAttendee);
                    output.Write(LocalizedStrings.GetHtmlEncoded(1026164821), num3, suggestion.OptionalAttendeeCount);
                    output.Write("</span>");
                }
                output.Write("</div>");
                if (0 < suggestion.AvailableRoomsCount)
                {
                    output.Write("<div id=rooms style=\"display:none\">");
                    foreach (int num4 in array)
                    {
                        output.Write("<div nowrap rm=\"");
                        Utilities.HtmlEncode(schedulingRecipientInfos[num4].ID, output);
                        output.Write("\">");
                        Utilities.HtmlEncode(schedulingRecipientInfos[num4].DisplayName, output);
                        output.Write("</div>");
                    }
                    output.Write("</div>");
                }
                output.Write("</div></div>");
            }
        }
示例#29
0
        // Token: 0x06001A09 RID: 6665 RVA: 0x0005E0F0 File Offset: 0x0005C2F0
        protected override int InternalExecute()
        {
            UserContext userContext = UserContextManager.GetUserContext(base.CallContext.HttpContext, base.CallContext.EffectiveCaller, true);

            return(this.CalculateDaysUntilPasswordExpiration(userContext));
        }
        // Token: 0x06001A1C RID: 6684 RVA: 0x0005E458 File Offset: 0x0005C658
        protected override GetDlpPolicyTipsResponse InternalExecute()
        {
            PolicyTipRequestLogger policyTipRequestLogger = PolicyTipRequestLogger.CreateInstance(this.CorrelationId);

            policyTipRequestLogger.StartStage(LogStage.ReceiveRequest);
            Item item = null;
            GetDlpPolicyTipsResponse result;

            try
            {
                GetDlpPolicyTipsCommand.SetReceiveRequestLogData(policyTipRequestLogger, this.ItemId, this.NeedToReclassify, this.BodyOrSubjectChanged, this.Recipients, this.EventTrigger, this.CustomizedStringsNeeded, this.ClientSupportsScanResultData, this.ScanResultData);
                if (base.CallContext != null && base.CallContext.AccessingADUser != null && base.CallContext.AccessingADUser.OrganizationId != null)
                {
                    this.OrganizationId = base.CallContext.AccessingADUser.OrganizationId;
                    if (this.ItemId == null || string.IsNullOrEmpty(this.ItemId.GetId()))
                    {
                        GetDlpPolicyTipsResponse invalidStoreItemIdResponse = GetDlpPolicyTipsResponse.InvalidStoreItemIdResponse;
                        this.TransitionToSendResponse(false, true, invalidStoreItemIdResponse, policyTipRequestLogger, true);
                        result = invalidStoreItemIdResponse;
                    }
                    else if (this.ItemId.GetId().Equals(GetDlpPolicyTipsCommand.pingRequestItemId, StringComparison.OrdinalIgnoreCase))
                    {
                        policyTipRequestLogger.AppendData("Ping", "1");
                        GetDlpPolicyTipsResponse responseToPingRequest = GetDlpPolicyTipsResponse.GetResponseToPingRequest();
                        this.TransitionToSendResponse(true, false, responseToPingRequest, policyTipRequestLogger, false);
                        result = responseToPingRequest;
                    }
                    else if (!GetDlpPolicyTipsCommand.AddItemToCurrentPending(this.ItemId.GetId()))
                    {
                        policyTipRequestLogger.AppendData("ItemAlreadyBeingProcessed", "1");
                        GetDlpPolicyTipsResponse itemAlreadyBeingProcessedResponse = GetDlpPolicyTipsResponse.ItemAlreadyBeingProcessedResponse;
                        this.TransitionToSendResponse(true, true, itemAlreadyBeingProcessedResponse, policyTipRequestLogger, false);
                        result = itemAlreadyBeingProcessedResponse;
                    }
                    else
                    {
                        ShortList <string> recipients   = GetDlpPolicyTipsCommand.ValidateAndGetEmailAddressStrings(this.Recipients, policyTipRequestLogger);
                        IdAndSession       idAndSession = null;
                        try
                        {
                            idAndSession = base.IdConverter.ConvertItemIdToIdAndSessionReadOnly(this.ItemId);
                        }
                        catch (InvalidStoreIdException exception)
                        {
                            policyTipRequestLogger.SetException(exception);
                            GetDlpPolicyTipsResponse invalidStoreItemIdResponse2 = GetDlpPolicyTipsResponse.InvalidStoreItemIdResponse;
                            this.TransitionToSendResponse(false, true, invalidStoreItemIdResponse2, policyTipRequestLogger, true);
                            return(invalidStoreItemIdResponse2);
                        }
                        catch (ObjectNotFoundException exception2)
                        {
                            policyTipRequestLogger.SetException(exception2);
                            GetDlpPolicyTipsResponse invalidStoreItemIdResponse3 = GetDlpPolicyTipsResponse.InvalidStoreItemIdResponse;
                            this.TransitionToSendResponse(false, true, invalidStoreItemIdResponse3, policyTipRequestLogger, true);
                            return(invalidStoreItemIdResponse3);
                        }
                        catch (AccessDeniedException exception3)
                        {
                            policyTipRequestLogger.SetException(exception3);
                            GetDlpPolicyTipsResponse accessDeniedStoreItemIdResponse = GetDlpPolicyTipsResponse.AccessDeniedStoreItemIdResponse;
                            this.TransitionToSendResponse(false, true, accessDeniedStoreItemIdResponse, policyTipRequestLogger, true);
                            return(accessDeniedStoreItemIdResponse);
                        }
                        policyTipRequestLogger.EndStageAndTransitionToStage(LogStage.LoadItem);
                        List <DlpPolicyMatchDetail> list = null;
                        bool   flag   = false;
                        string empty  = string.Empty;
                        string empty2 = string.Empty;
                        item = Item.Bind(idAndSession.Session, idAndSession.Id);
                        ScanResultStorageProvider scanResultStorageProvider = null;
                        if (this.ClientSupportsScanResultData)
                        {
                            try
                            {
                                scanResultStorageProvider = new ClientScanResultStorageProvider(this.ScanResultData, item);
                                goto IL_274;
                            }
                            catch (ClientScanResultParseException exception4)
                            {
                                policyTipRequestLogger.SetException(exception4);
                                GetDlpPolicyTipsResponse invalidClientScanResultResponse = GetDlpPolicyTipsResponse.InvalidClientScanResultResponse;
                                this.TransitionToSendResponse(false, true, invalidClientScanResultResponse, policyTipRequestLogger, true);
                                return(invalidClientScanResultResponse);
                            }
                        }
                        item.OpenAsReadWrite();
                        scanResultStorageProvider = new StoreItemScanResultStorageProvider(item);
IL_274:
                        string empty3 = string.Empty;
                        if (!GetDlpPolicyTipsCommand.IsSupportedStoreItemType(item, policyTipRequestLogger, out empty3))
                        {
                            GetDlpPolicyTipsResponse getDlpPolicyTipsResponse = new GetDlpPolicyTipsResponse(EvaluationResult.PermanentError);
                            getDlpPolicyTipsResponse.DiagnosticData = string.Format("{0}:{1}", "UnSupportedStoreItemType", empty3);
                            this.TransitionToSendResponse(false, true, getDlpPolicyTipsResponse, policyTipRequestLogger, true);
                            result = getDlpPolicyTipsResponse;
                        }
                        else
                        {
                            if (item != null)
                            {
                                policyTipRequestLogger.AppendData("Subject", PolicyTipRequestLogger.MarkAsPII(item.GetValueOrDefault <string>(InternalSchema.Subject, string.Empty)));
                            }
                            string fromAddress = GetDlpPolicyTipsCommand.GetFromAddress(idAndSession, item, policyTipRequestLogger);
                            if (string.IsNullOrEmpty(fromAddress))
                            {
                                policyTipRequestLogger.AppendData("NullFrom", "1");
                                GetDlpPolicyTipsResponse getDlpPolicyTipsResponse2 = new GetDlpPolicyTipsResponse(EvaluationResult.PermanentError);
                                getDlpPolicyTipsResponse2.DiagnosticData = "NullFrom";
                                this.TransitionToSendResponse(false, true, getDlpPolicyTipsResponse2, policyTipRequestLogger, true);
                                result = getDlpPolicyTipsResponse2;
                            }
                            else if (!GetDlpPolicyTipsCommand.HasContent(item, scanResultStorageProvider, policyTipRequestLogger))
                            {
                                policyTipRequestLogger.AppendData("NoContent", "1");
                                GetDlpPolicyTipsResponse noContentResponse = GetDlpPolicyTipsResponse.NoContentResponse;
                                this.TransitionToSendResponse(true, true, noContentResponse, policyTipRequestLogger, true);
                                result = noContentResponse;
                            }
                            else
                            {
                                policyTipRequestLogger.EndStageAndTransitionToStage(LogStage.RefreshClassifications);
                                policyTipRequestLogger.AppendData("BeforeRefreshClassifications", DiscoveredDataClassification.ToString(scanResultStorageProvider.GetDlpDetectedClassificationObjects()));
                                if (this.NeedToReclassify)
                                {
                                    scanResultStorageProvider.ResetAllClassifications();
                                }
                                else
                                {
                                    if (this.BodyOrSubjectChanged)
                                    {
                                        scanResultStorageProvider.RefreshBodyClassifications();
                                    }
                                    scanResultStorageProvider.RefreshAttachmentClassifications();
                                }
                                policyTipRequestLogger.AppendData("AfterRefreshClassifications", DiscoveredDataClassification.ToString(scanResultStorageProvider.GetDlpDetectedClassificationObjects()));
                                policyTipRequestLogger.EndStageAndTransitionToStage(LogStage.LoadRules);
                                policyTipRequestLogger.AppendData("OrganizationId", this.OrganizationId.ToString());
                                RuleCollection ruleCollection = GetDlpPolicyTipsCommand.LoadRules(this.OrganizationId);
                                if (ruleCollection == null || ruleCollection.Count == 0)
                                {
                                    policyTipRequestLogger.AppendData("RuleCount", "0");
                                    GetDlpPolicyTipsResponse noRulesResponse = GetDlpPolicyTipsResponse.NoRulesResponse;
                                    this.TransitionToSendResponse(true, true, noRulesResponse, policyTipRequestLogger, true);
                                    result = noRulesResponse;
                                }
                                else
                                {
                                    policyTipRequestLogger.AppendData("RuleCount", ruleCollection.Count.ToString());
                                    policyTipRequestLogger.AppendData("RuleNames", GetDlpPolicyTipsCommand.GetRuleNamesForTracking(ruleCollection));
                                    policyTipRequestLogger.EndStageAndTransitionToStage(LogStage.EvaluateRules);
                                    ExecutionStatus executionStatus = GetDlpPolicyTipsCommand.RunRules(ruleCollection, scanResultStorageProvider, item, fromAddress, recipients, out list, out flag, out empty, out empty2, policyTipRequestLogger);
                                    policyTipRequestLogger.AppendData("ExecutionStatus", executionStatus.ToString());
                                    policyTipRequestLogger.AppendData("MatchResults", (list == null) ? string.Empty : DlpPolicyMatchDetail.ToString(list));
                                    policyTipRequestLogger.AppendData("RuleEvalLatency", empty);
                                    policyTipRequestLogger.AppendData("RuleEvalResult", empty2);
                                    PolicyTipCustomizedStrings policyTipCustomizedStrings = null;
                                    if (this.CustomizedStringsNeeded)
                                    {
                                        policyTipRequestLogger.EndStageAndTransitionToStage(LogStage.LoadCustomStrings);
                                        UserContext userContext = UserContextManager.GetUserContext(base.CallContext.HttpContext, base.CallContext.EffectiveCaller, true);
                                        CultureInfo userCulture = userContext.UserCulture;
                                        policyTipRequestLogger.AppendData("CallersCulture", userCulture.Name);
                                        policyTipCustomizedStrings = ADUtils.GetPolicyTipStrings(this.OrganizationId, userCulture.Name);
                                        policyTipRequestLogger.AppendData("PolicyTipStrings", (policyTipCustomizedStrings == null) ? string.Empty : string.Format("Url:{0}/Notify:{1}/Override:{2}/Block:{3}", new object[]
                                        {
                                            policyTipCustomizedStrings.ComplianceURL ?? string.Empty,
                                            policyTipCustomizedStrings.PolicyTipMessageNotifyString ?? string.Empty,
                                            policyTipCustomizedStrings.PolicyTipMessageOverrideString ?? string.Empty,
                                            policyTipCustomizedStrings.PolicyTipMessageBlockString ?? string.Empty
                                        }));
                                    }
                                    GetDlpPolicyTipsResponse getDlpPolicyTipsResponse3 = new GetDlpPolicyTipsResponse(EvaluationResult.Success);
                                    if (this.ClientSupportsScanResultData)
                                    {
                                        getDlpPolicyTipsResponse3.ScanResultData            = ((ClientScanResultStorageProvider)scanResultStorageProvider).GetScanResultData();
                                        getDlpPolicyTipsResponse3.DetectedClassificationIds = ((ClientScanResultStorageProvider)scanResultStorageProvider).GetDetectedClassificationIds();
                                    }
                                    else
                                    {
                                        item.Save(SaveMode.ResolveConflicts);
                                    }
                                    if (list != null)
                                    {
                                        getDlpPolicyTipsResponse3.Matches = list.ToArray();
                                    }
                                    if (flag)
                                    {
                                        getDlpPolicyTipsResponse3.OptimizationResult = OptimizationResult.NoContentMatch;
                                    }
                                    if (this.CustomizedStringsNeeded)
                                    {
                                        getDlpPolicyTipsResponse3.CustomizedStrings = policyTipCustomizedStrings;
                                    }
                                    this.TransitionToSendResponse(true, false, getDlpPolicyTipsResponse3, policyTipRequestLogger, true);
                                    result = getDlpPolicyTipsResponse3;
                                }
                            }
                        }
                    }
                }
                else
                {
                    GetDlpPolicyTipsResponse nullOrganizationResponse = GetDlpPolicyTipsResponse.NullOrganizationResponse;
                    this.TransitionToSendResponse(false, true, nullOrganizationResponse, policyTipRequestLogger, true);
                    result = nullOrganizationResponse;
                }
            }
            catch (Exception ex)
            {
                policyTipRequestLogger.SetException(ex);
                GetDlpPolicyTipsResponse getDlpPolicyTipsResponse4;
                if (!GetDlpPolicyTipsCommand.CheckIfKnownExceptionAndUpdatePerfCounters(ex))
                {
                    getDlpPolicyTipsResponse4 = new GetDlpPolicyTipsResponse(EvaluationResult.UnexpectedPermanentError);
                    this.TransitionToSendResponse(false, false, getDlpPolicyTipsResponse4, policyTipRequestLogger, true);
                    throw;
                }
                getDlpPolicyTipsResponse4 = new GetDlpPolicyTipsResponse(EvaluationResult.PermanentError);
                this.TransitionToSendResponse(false, false, getDlpPolicyTipsResponse4, policyTipRequestLogger, true);
                List <string> list2 = null;
                List <string> list3 = null;
                string        text  = null;
                PolicyTipProtocolLog.GetExceptionTypeAndDetails(ex, out list2, out list3, out text, false);
                getDlpPolicyTipsResponse4.DiagnosticData = string.Format("OuterExceptionType:{0}/OuterExceptionMessage:{1}/InnerExceptionType:{2}/InnerExceptionMessage:{3}/ExceptionChain:{4}.", new object[]
                {
                    list2[0],
                    list3[0],
                    (list2.Count > 1) ? list2[list2.Count - 1] : string.Empty,
                    (list2.Count > 1) ? list3[list3.Count - 1] : string.Empty,
                    text
                });
                result = getDlpPolicyTipsResponse4;
            }
            finally
            {
                if (item != null)
                {
                    item.Dispose();
                    item = null;
                }
            }
            return(result);
        }