Пример #1
0
    private void Authenticate()
    {
        SecurityController s = HttpContext.Current.User as SecurityController;

        if (s != null)
        {
            MembershipLevelController mlc = new MembershipLevelController();
            List <MembershipLevel>    mls = mlc.SelectMembershipLevels();
            bool ok = false;
            foreach (MembershipLevel m in mls)
            {
                if (s.IsInRole(m.Description))
                {
                    ok = true;
                }
            }
            if (!ok)
            {
                FormsAuthentication.SignOut();
                Response.Redirect("login.aspx");
            }
        }
        else
        {
            FormsAuthentication.SignOut();
            Response.Redirect("login.aspx");
        }
    }
Пример #2
0
    public List <MembershipLevel> ReadMembershipLevels()
    {
        MembershipLevelController membershipLevels = new MembershipLevelController();
        List <MembershipLevel>    ml = membershipLevels.SelectMembershipLevels();

        return(ml);
    }