コード例 #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 = AdminMode ? MFBOauth2Client.GetAvailableClients() : OwnedClients;
                gvMyServices.DataBind();
            }
            else
            {
                mvServices.SetActiveView(vwGuest);
            }
        }
    }
コード例 #2
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);
            }
        }
    }