Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                txtDomain.Text     = WebConfig.DomainName();
                LabelAppName.Text  = WebConfig.AppName();
                HostName.InnerText = System.Net.Dns.GetHostName();

                //  var iName =  System.Security.Principal.WindowsIdentity.GetCurrent().Name;

                //if (User.Identity.IsAuthenticated)
                //    iName = HttpContext.Current.User.Identity.Name;
                // txtDomain.Text = Authentication.GetDomain(iName);
                // txtUserName.Text = Authentication.GetUserName(iName);


                txtUserName.Focus();
                if (DBConnection.CurrentDB != "Live")
                {
                    LabelTrain.Text    = DBConnection.CurrentDB;
                    LabelTrain.Visible = true;
                }

                if (Authentication.AuthenticateMethod() == "NameOnly")
                {
                    rfPassword.Enabled = false;
                }
            }
        }
Example #2
0
        protected void Login_Click(object sender, EventArgs e)
        {
            string auth = "true";

            try
            {
                if (Authentication.AuthenticateMethod() != "NameOnly")
                {
                    auth = Authentication.AuthenticateResult(txtDomain.Text, txtUserName.Text, txtPassword.Text);
                }
            }
            catch (Exception ex)
            {
                auth = ex.Message;
            }

            CheckAppRole(auth);
        }