Exemplo n.º 1
0
    protected void SetAuthenPhoneBtn_Click(object sender, EventArgs e)
    {
        LoginPassword = Request["LoginPassword"];
        Phone         = Request["Phone"];
        AuthenCode    = Request["AuthenCode"];
        CheckCode     = Request["CheckCode"];

        // 校验LoginPassword

        try
        {
            if (!CommonUtility.ValidateValidateCode(HttpUtility.HtmlDecode(CheckCode), this.Context))
            {
                errorHint.InnerHtml = "<script type='text/javascript'>showError('验证码校验未通过!')</script>";
                return;
            }
            else
            {
                string webpwd = CryptographyUtil.Encrypt(LoginPassword);
                int    i      = FindPwd.SelState(CustID, webpwd, out ErrMsg);
                if (i != 0)
                {
                    errorHint.InnerHtml = "<script type='text/javascript'>  $('#LoginPassword').attr('value','" + LoginPassword + "');$('#Phone').attr('value','" + Phone + "');$('#AuthenCode').attr('value','" + AuthenCode + "');$('#CheckCode').attr('value','" + CheckCode + "');showError('登录密码输入错误,请重新输入!')</script>";
                    return;
                }
                else
                {
                    Result = PhoneBO.SelSendSMSMassage(CustID, Phone, AuthenCode, out ErrMsg);   // 校验手机验证码
                    if (Result == 0)
                    {
                        Result = PhoneBO.PhoneSetV2(SPID, CustID, Phone, "2", "2", out ErrMsg);
                        if (Result == 0)
                        {
                            //跳转
                            errorHint.InnerHtml = "<script type='text/javascript'>showError('认证手机设置成功!')</script>";
                            //Response.Redirect("m.114yg.cn",true);
                            return;
                        }
                        else
                        {
                            errorHint.InnerHtml = "<script type='text/javascript'>showError('" + ErrMsg + "!')</script>";
                            return;
                        }
                    }
                    else
                    {
                        errorHint.InnerHtml = "<script type='text/javascript'>showError('" + ErrMsg + "!')</script>";
                        return;
                    }
                }
            }
        }
        catch (Exception exp)
        {
            errorHint.InnerHtml = "<script type='text/javascript'>showError('" + exp.ToString() + "!')</script>";
            return;
        }
    }
Exemplo n.º 2
0
    public void selEmail()
    {
        string msg    = "";
        string Email  = HttpUtility.HtmlDecode(Request.QueryString["email"].ToString());
        string CustId = HttpUtility.HtmlDecode(Request.QueryString["custid"].ToString());
        string Spid   = HttpUtility.HtmlDecode(Request.QueryString["SPID"].ToString());
        string Pwd    = HttpUtility.HtmlDecode(Request.QueryString["pwd"].ToString());
        string webpwd = CryptographyUtil.Encrypt(Pwd);
        int    i      = FindPwd.SelState(CustId, webpwd, out msg);



        if (!ValidateValidateCode())
        {
            Response.Write("验证码错误,请重新输入");
            return;
        }
        else
        {
            if (i != 0)
            {
                Response.Write("登录密码输入错误,请重新输入");
                return;
            }
            else
            {
                k = SetMail.EmailSel(CustId, Email, Spid, out msg);
                if (k == 0)
                {
                    string a          = CommonBizRules.EncryptEmailURl(CustId, Email, HttpContext.Current);
                    string url        = "点击完成认证:<a href='" + a + "'>" + a + "</a>";
                    Random random     = new Random();
                    string AuthenCode = random.Next(111111, 999999).ToString();
                    y = SetMail.InsertEmailSendMassage(CustId, "2", url, AuthenCode, 1, Email, DateTime.Now, "描述", "中国电信号码百事通:激活邮箱", 0, out msg);
                    Response.Write(y);
                }
                else
                {
                    Response.Write(msg);
                }
            }
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// 作者:赵锐
    /// 日期:2009年8月15日
    /// </summary>
    public void setMobile()
    {
        string ErrMsg = "";
        string mnum   = HttpUtility.HtmlDecode(Request.QueryString["mnum"].ToString());
        string auth   = HttpUtility.HtmlDecode(Request.QueryString["auth"].ToString());
        string custid = HttpUtility.HtmlDecode(Request.QueryString["custid"].ToString());
        string spid   = HttpUtility.HtmlDecode(Request.QueryString["spid"].ToString());
        string pwd    = HttpUtility.HtmlDecode(Request.QueryString["pwd"].ToString());
        string webpwd = CryptographyUtil.Encrypt(pwd);
        int    i      = FindPwd.SelState(custid, webpwd, out ErrMsg); // 根据custid和webpwd 校验客户身份是否合法性

        if (!ValidateValidateCode())                                  //校验页面验证码
        {
            Response.Write("验证码错误,请重新输入");
            return;
        }
        else
        {
            if (i != 0)
            {
                Response.Write("登录密码输入错误,请重新输入");
                return;
            }
            else
            {
                k = PhoneBO.SelSendSMSMassage(custid, mnum, auth, out msg);   // 校验手机验证码
                if (k == 0)
                {
                    //int y = PhoneBO.PhoneSet(spid, custid, mnum, "2", "2", out msg);
                    int y = PhoneBO.PhoneSetV2(spid, custid, mnum, "2", "2", out msg);
                    Response.Write(k);
                }
                else
                {
                    Response.Write(msg);
                }
            }
        }
    }