Ejemplo n.º 1
0
        protected void RenderNavBarDetails()
        {
            base.Response.Write("<div class='diagBlock'>");
            NavBarDiagnosticsDetails navBarDiagnosticsDetails = new NavBarDiagnosticsDetails();

            HttpContext.Current.Cache["NavBarDiagnostics.Details"] = navBarDiagnosticsDetails;
            base.Write("Use the information below to troubleshoot problems and report issues to technical support.");
            base.Write("NavBar configuration information");
            NavBarClientBase.RenderConfigInformation(base.Response.Output);
            Identity  identity = (base.Request.QueryString["flight"] == "geminishellux") ? new Identity("myself", "myself") : new Identity("myorg", "myorg");
            Exception ex       = null;

            try
            {
                PowerShellResults <NavBarPack> @object = new NavBar().GetObject(identity);
                base.Write("NavBar data:", @object.HasValue ? @object.Output[0].ToJsonString(null) : null);
            }
            catch (Exception ex2)
            {
                ex = ex2;
            }
            finally
            {
                if (navBarDiagnosticsDetails.Exception != null)
                {
                    base.Write("Exception:", navBarDiagnosticsDetails.Exception.ToString());
                }
                if (ex != null)
                {
                    base.Write("Additional Exception:", ex.ToString());
                }
                base.Response.Write("</div>");
            }
        }
Ejemplo n.º 2
0
        protected override NavBarPack EndGetNavBarPack()
        {
            ShellInfo shellInfo = null;

            if (this.shellServiceTask != null)
            {
                if (this.shellServiceTask.Wait(ShellClient.shellServiceTimeout))
                {
                    if (!base.LogException())
                    {
                        shellInfo = this.shellInfo;
                    }
                }
                else
                {
                    this.stopwatch.Stop();
                    ExTraceGlobals.WebServiceTracer.TraceInformation(0, 0L, string.Format("Timeout when calling Shell Service after {0}ms", this.stopwatch.ElapsedMilliseconds));
                    EcpEventLogConstants.Tuple_Office365NavBarCallServiceTimeout.LogEvent(new object[0]);
                }
            }
            if (shellInfo != null)
            {
                NavBarPack navBarPackFromInfo = NavBarClientBase.GetNavBarPackFromInfo(shellInfo, this.cultureName);
                ExTraceGlobals.WebServiceTracer.TraceInformation(0, 0L, string.Format("NavBarData acquired. SessionId: {0}, CorrelationId: {1}", navBarPackFromInfo.NavBarData.SessionID, navBarPackFromInfo.NavBarData.CorrelationID));
                navBarPackFromInfo.IsGeminiShellEnabled = true;
                navBarPackFromInfo.IsFresh = true;
                return(navBarPackFromInfo);
            }
            return(null);
        }
Ejemplo n.º 3
0
 internal static void RenderConfigInformation(TextWriter output)
 {
     NavBarClientBase.EnsureInitialized();
     DiagnosticsPage.Write(output, "End point configuration:", NavBarClientBase.endPointConfiguration, null);
     DiagnosticsPage.Write(output, "Certificate:", NavBarClientBase.certificateSubject, null);
     DiagnosticsPage.Write(output, "Certificate loaded:", NavBarClientBase.certificate != null, null);
     DiagnosticsPage.Write(output, "Configuration loaded success:", NavBarClientBase.loadConfigSuccess, null);
 }
Ejemplo n.º 4
0
 protected override NavBarPack EndGetNavBarPack()
 {
     if (!base.LogException() && this.navbarInfo != null)
     {
         NavBarPack navBarPackFromInfo = NavBarClientBase.GetNavBarPackFromInfo(this.navbarInfo, this.cultureName);
         ExTraceGlobals.WebServiceTracer.TraceInformation(0, 0L, string.Format("NavBarData acquired. SessionId: {0}, CorrelationId: {1}", navBarPackFromInfo.NavBarData.SessionID, navBarPackFromInfo.NavBarData.CorrelationID));
         navBarPackFromInfo.IsGeminiShellEnabled = false;
         navBarPackFromInfo.IsFresh = true;
         NavBarCache.Set(this.userPuid, this.userPrincipalName, navBarPackFromInfo);
         return(navBarPackFromInfo);
     }
     return(null);
 }
Ejemplo n.º 5
0
        private void InitTopNav()
        {
            string text = base.Request.QueryString["topnav"];

            if (!string.IsNullOrEmpty(text))
            {
                int num;
                if (!int.TryParse(text, out num) || num < 0 || num > 3)
                {
                    num = 1;
                }
                this.topNavType = (_Default.TopNav)num;
            }
            else
            {
                this.topNavType = (RbacPrincipal.Current.IsInRole("MailboxFullAccess") ? (Util.IsDataCenter ? _Default.TopNav.O365GNav : _Default.TopNav.Metro) : _Default.TopNav.NoTopNav);
            }
            if (this.topNavType == _Default.TopNav.Metro)
            {
                this.BuildNameDropDown();
            }
            else
            {
                this.helpControl.Visible  = false;
                this.nameDropDown.Visible = false;
            }
            if (this.topNavType == _Default.TopNav.O365GNav || this.topNavType == _Default.TopNav.O365GNavFallback)
            {
                this.navBarClient = NavBarClientBase.Create(this.showAdminFeatures.Value, this.topNavType == _Default.TopNav.O365GNavFallback, false);
                if (this.navBarClient != null)
                {
                    this.navBarClient.PrepareNavBarPack();
                }
            }
            if (this.notificationTemplate != null)
            {
                this.notificationTemplate.Visible = this.showAdminFeatures.Value;
            }
            if (this.ntfIcon != null)
            {
                this.ntfIcon.Visible = (this.showAdminFeatures.Value && this.topNavType == _Default.TopNav.Metro);
            }
        }
Ejemplo n.º 6
0
        public PowerShellResults <NavBarPack> GetObject(Identity identity)
        {
            identity.FaultIfNull();
            bool             showAdminFeature = identity.RawIdentity == "myorg";
            NavBarClientBase navBarClientBase = NavBarClientBase.Create(showAdminFeature, false, true);
            PowerShellResults <NavBarPack> powerShellResults = new PowerShellResults <NavBarPack>();

            if (navBarClientBase != null)
            {
                navBarClientBase.PrepareNavBarPack();
                NavBarPack navBarPack = navBarClientBase.GetNavBarPack();
                if (navBarPack != null)
                {
                    powerShellResults.Output = new NavBarPack[]
                    {
                        navBarPack
                    };
                }
            }
            return(powerShellResults);
        }
Ejemplo n.º 7
0
        public static NavBarClientBase Create(bool showAdminFeature, bool fallbackMode, bool forceReload = false)
        {
            NavBarClientBase.EnsureInitialized();
            NavBarClientBase result = null;

            if (NavBarClientBase.loadConfigSuccess)
            {
                if (NavBarClientBase.IsGeminiShellEnabled)
                {
                    result = new ShellClient(showAdminFeature, fallbackMode, forceReload);
                }
                else
                {
                    result = new NavBarClient(showAdminFeature, fallbackMode, forceReload);
                }
            }
            else
            {
                ExTraceGlobals.WebServiceTracer.TraceInformation <string>(0, 0L, "NavBarClientBase return null for user '{0}' due to loadConfigSuccess is false.", RbacPrincipal.Current.NameForEventLog);
            }
            return(result);
        }
Ejemplo n.º 8
0
        public NavBarClientBase(bool showAdminFeature, bool fallbackMode, bool forceReload)
        {
            this.showAdminFeature = showAdminFeature;
            this.fallbackMode     = fallbackMode;
            this.forceReload      = forceReload;
            string authNInfo = NavBarClientBase.GetAuthNInfo("RPSOrgIdPUID");

            this.userPuid          = (string.IsNullOrEmpty(authNInfo) ? NavBarClientBase.GetAuthNInfo("RPSPUID") : authNInfo);
            this.userPrincipalName = NavBarClientBase.GetAuthNInfo("RPSMemberName");
            this.cultureName       = CultureInfo.CurrentCulture.IetfLanguageTag;
            this.rbacPrincipal     = RbacPrincipal.Current;
            if (this.rbacPrincipal.IsInRole("Impersonated") || this.rbacPrincipal.IsInRole("DelegatedAdmin") || this.rbacPrincipal.IsInRole("ByoidAdmin"))
            {
                this.fallbackMode = true;
            }
            this.isGallatin = this.rbacPrincipal.IsInRole("IsGallatin");
            ExTraceGlobals.WebServiceTracer.TraceInformation(0, 0L, "Create shell client for user: {0}, UserPuid: {1}, locale: {2}, forceReload: {3}", new object[]
            {
                this.userPrincipalName,
                this.userPuid,
                this.cultureName,
                forceReload
            });
        }