protected void Page_Load(object sender, EventArgs e)
 {
     Security s = new Security();
     if (s.IsStudent() || !s.IsLoggedIn())
     {
         Response.Redirect("Home.aspx");
     }
 }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Security s = new Security();

            if (s.IsStudent() || !s.IsLoggedIn())
            {
                Response.Redirect("Home.aspx");
            }
        }
Beispiel #3
0
        private void CheckSecurity()
        {
            Security mySecurity = new Security();

            lblFirstname.Text = mySecurity.Firstname;
            if (!mySecurity.IsLoggedIn())
            {
                btnLogout.Visible = false;
            }
            else
            { //Adjust links visible according to Security Level(Admin or Regular)
                UpdatePanelLogin.Visible = false;
                pnlLogout.Visible        = true;
                hlRegistration.Visible   = false;
            }
        }
        private void CheckSecurity()
        {
            Security mySecurity = new Security();
            lblFirstname.Text = mySecurity.Firstname;
            if (!mySecurity.IsLoggedIn())
            {
                btnLogout.Visible = false;

            }
            else
            { //Adjust links visible according to Security Level(Admin or Regular)

                UpdatePanelLogin.Visible = false;
                pnlLogout.Visible = true;
                hlRegistration.Visible = false;
            }
        }
Beispiel #5
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string   FullEmail  = txtUserName.Text;
            Security mySecurity = new Security(FullEmail, txtPassword.Text);

            if (mySecurity.IsLoggedIn())
            {
                if (mySecurity.IsTeacher() || mySecurity.IsAdmin())
                {
                    Response.Redirect("TeacherInstructions.aspx");
                }
                Response.Redirect("Home.aspx");
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "alert('Your User Name or Password Not Correct');", true);
            }
        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string FullEmail = txtUserName.Text;
            Security mySecurity = new Security(FullEmail, txtPassword.Text);
            if (mySecurity.IsLoggedIn())
            {

                if (mySecurity.IsTeacher()||mySecurity.IsAdmin())
                {
                    Response.Redirect("TeacherInstructions.aspx");
                }
                Response.Redirect("Home.aspx");

            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "alert('Your User Name or Password Not Correct');", true);
            }
        }