Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AccessControl.IsLoggedIn(this.Page))
        {
            user = "******" + AccessControl.GetLoggedUser(this.Page);
            // all the buttons are invisible at first
            logoutButton.Visible  = true;
            updateButton.Visible  = true;
            galleryButton.Visible = true;
        }
        else
        {
            loginButton.Visible        = true;
            registrationButton.Visible = true;
        }

        if (AccessControl.IsAdmin(this.Page))
        {
            adminButton.Visible = true;
        }

        VisitorCounter.LogPageLoad(this.Page);
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!AccessControl.IsAdmin(this))
        {
            Response.Redirect("Homepage.aspx");
        }

        if (Request["deleteUser"] != null)
        {
            DataLink.Delete(Request["deleteUser"].Trim().Replace("'", ""));
        }

        if (Request["setAdmin"] != null)
        {
            DataLink.SetAdmin(Request["setAdmin"].Trim().Replace("'", ""), true);
        }

        if (Request["unsetAdmin"] != null)
        {
            DataLink.SetAdmin(Request["unsetAdmin"].Trim().Replace("'", ""), false);
        }

        usersTable = ConstructTable(DataLink.GetUsers(searchString.Value.Replace("'", "")));
    }