Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            mUser = dashboard.getUserFromSessionOrCookie(Request, Session);
            if (mUser == null)
            {
                Response.Redirect("login.aspx");
                Response.Close();
                return;
            }

            String studentid = Request.Params["student"];
            String certid    = Request.Params["certid"];

            if (String.IsNullOrEmpty(certid))
            {
                Response.Redirect("dashboard.aspx");
                Response.Close();
                return;
            }

            mCourse = FAACert.getCert(certid);
            if (mCourse == null)
            {
                Response.Redirect("dashboard.aspx");
                Response.Close();
                return;
            }

            if (!String.IsNullOrEmpty(studentid))
            {
                mStudent = AppUser.getUser(studentid);
                if (mStudent == null)
                {
                    studentid = null;
                }
            }

            if (mStudent == null || (mUser.IsRestrictedUser() && mStudent.UserEmail != mUser.UserEmail))
            {
                Response.Redirect("dashboard.aspx");
                Response.Close();
                return;
            }
            ExtractAndSaveSelections();
            Response.Redirect("showcourse.aspx?certid=" + certid + "&student=" + studentid);
            Response.Close();
            return;
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            mUser = dashboard.getUserFromSessionOrCookie(Request, Session);
            if (mUser == null)
            {
                Response.Redirect("login.aspx");
                Response.Close();
                return;
            }

            String studentid = Request.Params["student"];
            String certid    = Request.Params["certid"];

            if (String.IsNullOrEmpty(certid))
            {
                Response.Redirect("dashboard.aspx");
                Response.Close();
                return;
            }

            mCourse = FAACert.getCert(certid);
            if (mCourse == null)
            {
                Response.Redirect("dashboard.aspx");
                Response.Close();
                return;
            }

            if (!String.IsNullOrEmpty(studentid))
            {
                mStudent = AppUser.getUser(studentid);
                if (mStudent == null)
                {
                    studentid = null;
                }
            }

            if (mStudent == null || mUser.IsRestrictedUser())
            {
                Response.Redirect("dashboard.aspx");
                Response.Close();
                return;
            }

            mCourse.LoadStages(studentid);   // load it completely
        }