private void loadVisibleSections()
 {
     notLoggedIn.Visible       = false;
     notConnected.Visible      = false;
     connected.Visible         = false;
     appTokensNotFound.Visible = false;
     if (!RestHelper.appTokensSet())
     {
         appTokensNotFound.Visible = true;
     }
     else if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
     {
         notLoggedIn.Visible = true;
     }
     else
     {
         notConnected.Visible = IppRealmOAuthProfile.Read().accessToken == "";
         connected.Visible    = IppRealmOAuthProfile.Read().accessToken != "";
     }
     (this.Master as SiteMaster).ToggleBlueDotMenuVisibility();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated || !RestHelper.appTokensSet() || IppRealmOAuthProfile.Read().accessToken.Length == 0)
         {
             Response.Redirect("~/Default.aspx");
         }
         employeesView.DataSource = RestHelper.getEmployeeList(IppRealmOAuthProfile.Read());
         employeesView.DataBind();
     }
     catch
     {
     }
 }
Exemplo n.º 3
0
 public void ToggleBlueDotMenuVisibility()
 {
     if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated && System.Web.HttpContext.Current.User.Identity.Name == "admin" && RestHelper.appTokensSet() && !Request.FilePath.Contains("OAuth"))
     {
         IppRealmOAuthProfile profile = IppRealmOAuthProfile.Read();
         blueDotMenu.Visible = profile.accessToken.Length > 0;
     }
     else
     {
         blueDotMenu.Visible = false;
     }
 }