Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Master.SelectedTab = tabID.tabHome;

            if (Page.User.Identity.IsAuthenticated)
            {
                mvServices.SetActiveView(vwAuthenticated);

                foreach (MFBOAuthScope scope in Enum.GetValues(typeof(MFBOAuthScope)))
                {
                    if (scope != MFBOAuthScope.none)
                    {
                        cklScopes.Items.Add(new ListItem(MFBOauthServer.ScopeDescription(scope), scope.ToString()));
                    }
                }

                gvMyServices.DataSource = (util.GetIntParam(Request, "a", 0) != 0 && MyFlightbook.Profile.GetUser(Page.User.Identity.Name).CanSupport) ? MFBOauth2Client.GetAvailableClients() : OwnedClients;
                gvMyServices.DataBind();
            }
            else
            {
                mvServices.SetActiveView(vwGuest);
            }
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Master.SelectedTab = tabID.tabHome;
            Master.Layout      = MasterPage.LayoutMode.Accordion;

            if (Page.User.Identity.IsAuthenticated)
            {
                mvServices.SetActiveView(vwAuthenticated);

                foreach (MFBOAuthScope scope in Enum.GetValues(typeof(MFBOAuthScope)))
                {
                    if (scope != MFBOAuthScope.none)
                    {
                        cklScopes.Items.Add(new ListItem(MFBOauthServer.ScopeDescription(scope), scope.ToString()));
                    }
                }

                gvMyServices.DataSource = OwnedClients;
                gvMyServices.DataBind();
            }
            else
            {
                mvServices.SetActiveView(vwGuest);
            }
        }
    }