Esempio n. 1
0
        protected void cmdSubmit_Click(object sender, EventArgs e)
        {
            Profiles.Login.Utilities.DataIO data = new Profiles.Login.Utilities.DataIO();

            Profiles.Login.Utilities.User user = new Profiles.Login.Utilities.User();
            user.UserName = txtUserName.Text.Trim();
            user.Password = txtUserName.Text.Trim();  // works on dev just now, need to change!

            if (user.UserName.Length == 0 && user.Password.Length == 0)
            {
                // Allow anonymous access.  Do not log in person.
                // Add the gadgets
                Session[OpenSocialManager.ORNG_GADGETS] = txtGadgetURLS.Text;
                Session[OpenSocialManager.ORNG_DEBUG]   = chkDebug.Checked;
                Session[OpenSocialManager.ORNG_NOCACHE] = !chkUseCache.Checked;
                Response.Redirect(Root.Domain);
            }
            else if (sandboxPassword.Equals(txtPassword.Text.Trim()) && data.UserLogin(ref user))
            {
                // User logged in, now add the gadgets
                // add the gadgets
                Session[OpenSocialManager.ORNG_GADGETS] = txtGadgetURLS.Text;
                Session[OpenSocialManager.ORNG_DEBUG]   = chkDebug.Checked;
                Session[OpenSocialManager.ORNG_NOCACHE] = !chkUseCache.Checked;
                Response.Redirect(Root.Domain);
            }
            else
            {
                lblError.Text    = "Login failed, please try again";
                txtPassword.Text = "";
                txtPassword.Focus();
            }
        }
Esempio n. 2
0
        protected void cmdSubmit_Click(object sender, EventArgs e)
        {
            Profiles.Login.Utilities.DataIO data = new Profiles.Login.Utilities.DataIO();

            if (Request.QueryString["method"].ToString() == "login")
            {
                Profiles.Login.Utilities.User user = new Profiles.Login.Utilities.User();
                user.UserName = txtUserName.Text.Trim();
                user.Password = txtPassword.Text.Trim();

                if (data.UserLogin(ref user))
                {
                    if (Request.QueryString["edit"] == "true")
                    {
                        if (Request.QueryString["editparams"] == null)
                        {
                            Response.Redirect(Root.Domain + "/edit/" + sm.Session().NodeID);
                        }
                        else
                        {
                            Response.Redirect(Root.Domain + "/edit/default.aspx?subject=" + sm.Session().NodeID + "&" + Request.QueryString["editparams"]);
                        }
                    }
                    else
                    {
                        Response.Redirect(Request.QueryString["redirectto"].ToString());
                    }
                }
                else
                {
                    lblError.Text    = "Login failed, please try again";
                    txtPassword.Text = "";
                    txtPassword.Focus();
                }
            }
        }