Esempio n. 1
0
        protected void getUserDetails(string userid)
        {
            ADUserDetails adObj   = new ADUserDetails();
            Hashtable     getData = adObj.getuserDetails(userid);

            //DateTime.FromFileTime((long)searchResult.Properties["lastLogon"][0]);
            //displayuser.Text = getData["principalname"].ToString();
            username.Text = getData["principalname"].ToString(); //Session["username"].ToString();

            // lastlogon.Text = getData["lastlogontimestamp"].ToString();
            // pwdstatus.Text = getData["passwordexpired"].ToString();
            // pwdlastchange.Text = getData["pwdlastchanged"].ToString();
            ////passwordexpire.Text = getData["passwordexpires"].ToString();
            //  accountcreated.Text = getData["whencreated"].ToString();
            // activestatus.Text = getData["lockouttime"].ToString();
            if (getData["mobileno"] != null)
            {
                string mobile = getData["mobileno"].ToString();
                //mobile = mobile.Substring(0, mobile.Length - 4) + "XXXX";
                mobile        = "XX XX XX" + mobile.Substring(mobile.Length - 4);
                mobileno.Text = mobile;
            }
            else
            {
                mobileno.Text      = "Mobile Number not available/configured, Please Contact Adminstrator ";
                mobileno.ForeColor = System.Drawing.Color.Red;
            }
            //string mobile = getData["mobileno"].ToString();
            //mobile = mobile.Substring(0, mobile.Length - 4) + "XXXX";
            //mobileno.Text = mobile;
            //HiddenField1.Value = getData["emailid"].ToString();
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string userid = "";

            if (ConfigurationManager.AppSettings["captchavalidation"].ToString().Equals("yes"))
            {
                captchadiv.Visible = true;
            }
            else
            {
                captchadiv.Visible = false;
            }


            if (Session["userid"] != null)
            {
                userid = Session["userid"].ToString();
            }
            else if (Session["forgetpwduser"] != null)
            {
                userid = Session["forgetpwduser"].ToString();
            }
            else
            {
                Response.Redirect("SelfServiceLogin.aspx");
            }
            ADUserDetails adObj    = new ADUserDetails();
            string        mobileno = adObj.getuserMobileNo(userid);

            if (mobileno != null)
            {
                //string mobile = getData["mobileno"].ToString();
                ////mobile = mobile.Substring(0, mobile.Length - 4) + "XXXX";
                //mobile = "XX XX XX XX" + mobile.Substring(mobile.Length - 4);
                //mobileno.Text = mobile;
                mobileno    = "XX XX XX" + mobileno.Substring(mobileno.Length - 4);
                Label2.Text = mobileno;//mobileno.Substring(0, mobileno.Length - 4) + "xxxx";
            }
        }
Esempio n. 3
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            string userid = "";

            try
            {
                if (Session["userid"] != null)
                {
                    userid = Session["userid"].ToString();
                }
                else if (Session["forgetpwduser"] != null)
                {
                    userid = Session["forgetpwduser"].ToString();
                }
                ADUserDetails adObj = new ADUserDetails();
                adObj.sendSMSDetails(userid);
                //getuserMobileNo
                Response.Redirect("ValidateOTP.aspx");
            }
            catch (Exception er)
            {
                Response.Redirect("ValidateOTP.aspx");
            }
        }
Esempio n. 4
0
        protected void validateUserQAs()
        {
            string userid = null;

            try
            {
                if (Session["userid"] != null)
                {
                    userid = Session["userid"].ToString();
                    //  displayuser.Text = "User: "******"username"].ToString();
                }
                else if (Session["forgetpwduser"] != null)
                {
                    userid = Session["forgetpwduser"].ToString();
                }
                displayuser.Text = "User: "******"";
                String str2 = "";

                //if (QASecurity.Decryptdata(Label1.Attributes["answer1"].ToString()).Equals(answer1.Text, StringComparison.InvariantCultureIgnoreCase))
                //    {
                //        j++;
                //    }

                //    if (QASecurity.Decryptdata(Label2.Attributes["answer1"].ToString()).Equals(answer2.Text,StringComparison.InvariantCultureIgnoreCase))
                //    {
                //        j++;
                //    }

                //    if (QASecurity.Decryptdata(Label3.Attributes["answer1"].ToString()).Equals(answer3.Text, StringComparison.InvariantCultureIgnoreCase))
                //    {
                //        j++;
                //    }

                if (QASecurity.Decryptdata(Session["answer1"].ToString()).Equals(answer1.Text, StringComparison.InvariantCultureIgnoreCase))
                {
                    j++;
                }

                if (QASecurity.Decryptdata(Session["answer2"].ToString()).Equals(answer2.Text, StringComparison.InvariantCultureIgnoreCase))
                {
                    j++;
                }

                if (QASecurity.Decryptdata(Session["answer3"].ToString()).Equals(answer3.Text, StringComparison.InvariantCultureIgnoreCase))
                {
                    j++;
                }



                if (j >= 2)
                {
                    //this is where SMS need to be send

                    ADUserDetails adObj = new ADUserDetails();
                    if (adObj.sendSMSDetails(userid))
                    {
                        Response.Redirect("ValidateOTP.aspx");
                    }
                    else
                    {
                        resultlable.Text      = "Mobile number not available/configured, Please contact Administrator";
                        resultlable.ForeColor = System.Drawing.Color.Red;
                    }
                    //getuserMobileNo
                }
                else
                {
                    // resultlable.Text = "Atleast 2 answers should match, Please verify again";
                    // ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Atleast 2 answers should match, Please verify again')", true);
                    //this.Page.EnableViewState = true;
                    Session.Add("answermismatch", "true");
                    Response.Redirect("RestPasswordQA.aspx", false);
                    //return;
                }

                /*
                 * if (answer1.Text.Equals(q1hash[3].ToString()) && answer2.Text.Equals(q2hash[3].ToString()) && answer3.Text.Equals(q3hash[3].ToString()) && answer4.Text.Equals(q4hash[3].ToString()) && answer5.Text.Equals(q5hash[2].ToString()) && answer6.Text.Equals(q5hash[4].ToString()))
                 * {
                 *  Response.Redirect("wer.aspx");
                 * }
                 * else
                 * {
                 *  resultlable.Text = "Answers are not matching, Please verify again";
                 *  return;
                 * }
                 *
                 */
            }
            catch (Exception er)
            {
            }
        }