Example #1
0
 protected void User_Click(object sender, EventArgs e)
 {
     AD.ADAccountManagement ADInterface = new AD.ADAccountManagement();
     ArrayList groups = ADInterface.GetUserGroups(userSelect.SelectedItem.ToString());
     adfeilds.DataSource = groups;
     adfeilds.DataBind();
 }
Example #2
0
        protected void Login_Click(object sender, EventArgs e)
        {
            if (errorView.Visible)
            {
                errorView.Visible = false;
            }
            AD.ADAccountManagement ADinterface = new AD.ADAccountManagement();
            SQL sql = new SQL();
            try
            {
                bool check = sql.authUser(user.Value.ToString(), pass.Value.ToString());

                if (check)
                {
                    FormsAuthentication.SetAuthCookie(user.Value.ToString(), false);
                    Response.Redirect("~/Admin/Home.aspx");
                }
                else
                {
                    errorView.InnerText = "Bad Username or Password";
                    errorView.Visible = true;
                }

            }
            catch (Exception ex)
            {
                errorView.InnerText = "Error Validating account " + ex.Message.ToString();
                errorView.Visible = true;
            }
        }