Esempio n. 1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Act.Pass();
            Act.NoCache();

            RegisterOnSubmitStatement(
                "submitScript"
                , "document.getElementById('passold').value = hex_md5(document.getElementById('passold').value);"
                + "document.getElementById('passbaru').value = hex_md5(document.getElementById('passbaru').value);"
                + "document.getElementById('passconfirm').value = hex_md5(document.getElementById('passconfirm').value);"
                );

            if (!Page.IsPostBack)
            {
                comp.InnerHtml = Mi.Pt;
                seclevel.Text  = Act.SecLevel;

                nama.Text = Db.SingleString(
                    "SELECT Nama FROM USERNAME WHERE UserID = '" + Act.UserID + "'");

                if (Session["LastLogin"] != null)
                {
                    tglLogin.Text = Session["LastLogin"].ToString();
                }

                Nav();

                if (Request.QueryString["login"] != null)
                {
                    Js.Focus(this, passold);
                    cancel.Disabled   = true;
                    dariLogin.Checked = true;
                }

                namauser.Text = Db.SingleString(
                    "SELECT Nama FROM USERNAME WHERE UserID = '" + Act.UserID + "'");

                if (Session["SalahPass"] == null)
                {
                    Session["SalahPass"] = "******";                     //Hitung password salah berapa kali
                }
                else
                {
                    if (Session["SalahPass"].ToString() != "0")
                    {
                        salah.Text = Session["SalahPass"] + "x salah";
                    }
                }

                //Disable password baru
                save.Enabled                    = false;
                passbaru.Enabled                = false;
                passconfirm.Enabled             = false;
                passbaru.Attributes["style"]    = "background-color:'#ECE9D8'";
                passconfirm.Attributes["style"] = "background-color:'#ECE9D8'";
            }
            FeedBack();
        }
Esempio n. 2
0
        protected void next_Click(object sender, System.EventArgs e)
        {
            string pass = Db.SingleString(
                "SELECT Pass FROM USERNAME WHERE UserID = '" + Act.UserID + "'");

            if (pass != passold.Text)
            {
                //3x salah password akan mengakibatkan sign-out otomatis;
                int x = Convert.ToInt32(Session["SalahPass"]) + 1;
                salah.Text           = x.ToString() + "x salah";
                Session["SalahPass"] = x;

                if (x >= 3)
                {
                    Response.Redirect("SignOut.aspx?pass=1");
                }

                string scr = "";
                if (dariLogin.Checked)
                {
                    scr = "document.getElementById('passold').focus();";
                }

                Js.Alert(
                    this
                    , "Password Salah " + x + "x.\\n"
                    + "Username akan Sign-Out otomatis apabila salah 3x."
                    , scr
                    );
            }
            else
            {
                //reset salah password
                Session["SalahPass"] = null;
                salah.Text           = "";

                //Enable password baru
                save.Enabled                    = true;
                passbaru.Enabled                = true;
                passconfirm.Enabled             = true;
                passbaru.Attributes["style"]    = "background-color:''";
                passconfirm.Attributes["style"] = "background-color:''";

                //Disable password lama
                next.Enabled                = false;
                passold.Enabled             = false;
                passold.Attributes["style"] = "background-color:'#ECE9D8'";

                if (dariLogin.Checked)
                {
                    Js.Focus(this, passbaru);
                }
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Act.NoCache();

            if (!Mi.Licensed())
            {
                Response.Redirect("/CustomError/Licensed.html");
            }

            RegisterOnSubmitStatement(
                "md5Script"
                , "document.getElementById('pass').value=hex_md5(document.getElementById('pass').value);"
                );

            if (!Page.IsPostBack)
            {
                comp.InnerHtml = Mi.Pt;
                Js.Focus(this, username);
            }
        }
Esempio n. 4
0
 protected void bulan_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     Reload();
     Js.Focus(this, bulan);
 }