Example #1
0
        protected void RenderGeneralInformation()
        {
            base.Response.Write("<div class='diagBlock'>");
            LocalSession localSession = LocalSession.Current;
            ExchangeRunspaceConfiguration rbacConfiguration = localSession.RbacConfiguration;
            bool flag = localSession.IsInRole("Mailbox+MailboxFullAccess");

            this.Write("Logon user:"******"{0} [{1}]", localSession.Name, rbacConfiguration.ExecutingUserPrimarySmtpAddress));
            this.Write("User-Agent:", HttpContext.Current.Request.UserAgent);
            this.Write("SKU:", Util.IsDataCenter ? "DataCenter" : "On-Premise");
            if (flag)
            {
                this.Write("Mailbox server version:", localSession.Context.MailboxServerVersion);
            }
            else
            {
                this.Write("Mailbox account:", "None mailbox account.");
            }
            this.Write("Current server version:", Util.ApplicationVersion);
            this.Write("Request URL:", HttpContext.Current.GetRequestUrl().ToString());
            this.Write("Display language:", CultureInfo.CurrentCulture.IetfLanguageTag);
            if (flag)
            {
                this.Write("User time zone:", (localSession.UserTimeZone != null) ? localSession.UserTimeZone.DisplayName : "Not set.");
            }
            this.Write("RBAC roles:", this.GetRoles(localSession));
            this.Write("Features:", FlightProvider.Instance.GetAllEnabledFeatures().ToLogString <string>());
            VariantConfigurationSnapshot snapshotForCurrentUser = EacFlightUtility.GetSnapshotForCurrentUser();

            this.Write("Flights:", snapshotForCurrentUser.Flights.ToLogString <string>());
            base.Response.Write("</div>");
        }
Example #2
0
        public PowerShellResults EnableOrganizationCustomization()
        {
            LocalSession localSession = LocalSession.Current;

            RbacSettings.AddSessionToCache(localSession.CacheKeys[0], localSession, false, false);
            return(base.InvokeAsync(new PSCommand().AddCommand("Enable-OrganizationCustomization"), delegate(PowerShellResults results)
            {
                if (results != null && results.ErrorRecords.IsNullOrEmpty())
                {
                    LocalSession.Current.FlushCache();
                }
            }));
        }
Example #3
0
        internal ClientLogEvent(Datapoint datapoint)
        {
            this.datapoint = datapoint;
            LocalSession localSession = RbacPrincipal.GetCurrent(false) as LocalSession;
            string       value        = (localSession == null) ? string.Empty : localSession.LogonTypeFlag;

            this.datapointProperties = new Dictionary <string, object>
            {
                {
                    "TIME",
                    this.datapoint.Time
                },
                {
                    "SID",
                    HttpContext.Current.GetSessionID()
                },
                {
                    "USID",
                    (HttpContext.Current.User is RbacSession) ? HttpContext.Current.GetCachedUserUniqueKey() : string.Empty
                },
                {
                    "SRC",
                    this.datapoint.Src
                },
                {
                    "REQID",
                    this.datapoint.ReqId
                },
                {
                    "IP",
                    this.GetClientIP()
                },
                {
                    "UA",
                    HttpUtility.UrlEncode(HttpContext.Current.Request.UserAgent)
                },
                {
                    "BLD",
                    ExchangeSetupContext.InstalledVersion.ToString()
                },
                {
                    "LTYPE",
                    value
                }
            };
        }
Example #4
0
 public void AppendToIisLog()
 {
     if (!string.IsNullOrEmpty(HttpContext.Current.GetSessionID()))
     {
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append("&perfRecord=");
         stringBuilder.Append(this.ToString().Replace("&", "%26"));
         stringBuilder.Append("&sessionId=");
         using (StringWriter stringWriter = new StringWriter(stringBuilder))
         {
             HttpContext.Current.Server.UrlEncode(HttpContext.Current.GetSessionID(), stringWriter);
         }
         LocalSession localSession = RbacPrincipal.GetCurrent(false) as LocalSession;
         if (localSession != null)
         {
             stringBuilder.Append("&logonType=");
             stringBuilder.Append(localSession.LogonTypeFlag);
         }
         HttpContext.Current.Response.AppendToLog(stringBuilder.ToString());
     }
 }