Ejemplo n.º 1
0
        protected void Login_Submit(object sender, EventArgs e)
        {
            UserManagementBO umbo = new UserManagementBO();

            try {
                if (umbo.CheckIfValidLogin(loginUsername.Text, loginPassword.Text))
                {
                    Session["login"] = loginUsername.Text;
                    System.Diagnostics.Trace.WriteLine(Session["login"]);
                    Session.Timeout = 1000;
                    Response.Redirect(Request.Url.ToString());
                }
            }
            catch (Exception exc) {
                loginErrorMessage.Visible = true;

                loginErrorMessage.Text = exc.Message;
            }
        }
Ejemplo n.º 2
0
        protected void PasswordChange_Click(object sender, EventArgs e)
        {
            UserManagementBO bo = new UserManagementBO();
            UserVO           vo = bo.GetUser(UserID);

            //Look for invalid inputs
            try {
                if (newPassword.Text != newPasswordConfirm.Text)
                {
                    throw new Exception("Both new password fields must match");
                }

                if (!bo.CheckIfValidLogin(Username, oldPassword.Text))
                {
                    throw new Exception("Invalid entry for current password");
                }

                bo.ChangePassword(UserID, newPassword.Text);
                errorLabel.Text = "Password succesfully changed";
            }
            catch (Exception exc) {
                errorLabel.Text = exc.Message;
            }
        }