Exemplo n.º 1
0
    protected void SendEmail(string CustID, string Mail)
    {
        DateTime datetime = DateTime.Now;
        string   ErrMsg   = "";

        //给客户认证邮箱发EMAIL
        string m   = CommonBizRules.EncryptEmailURl(CustID, Mail, this.Context);
        string url = "<a href='" + m + "'>" + m + "</a>";

        SetMail.InsertEmailSendMassage(CustID, "1", url, "", 1, Mail, datetime, "", "中国电信号码百事通:激活邮箱;尊敬的用户,点击此链接激活您的帐号", 0, out ErrMsg);
    }
Exemplo n.º 2
0
    /// <summary>
    ///
    /// </summary>
    public void SendCode()
    {
        DateTime datetime = DateTime.Now;
        string   ErrMsg   = "";

        //给客户认证邮箱发EMAIL
        string m   = CommonBizRules.EncryptEmailURl("", Mail, this.Context);
        string url = "点击完成认证:<a href='" + m + "'>" + m + "</a>";

        SetMail.InsertEmailSendMassage("", "1", url, "", 1, Mail, datetime, "", "中国电信号码百事通:激活邮箱", 0, out ErrMsg);
        //SetMail.InsertEmailSendMassage("", "1", "请点击下面链接", "", 0, Mail, datetime, "", "中国电信号码百事通:激活邮箱", 0, out ErrMsg);
    }
Exemplo n.º 3
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.º 4
0
    protected void btn_OK_Click(object sender, EventArgs e)
    {
        if (CertificateType.Value != "")
        {
            certno.Style.Value  = "display:block";
            certnoL.Style.Value = "display:block";
        }
        else
        {
            certno.Style.Value  = "display:none";
            certnoL.Style.Value = "display:none";
        }
        this.areaInfoList.Value = resulttxt.Value.ToString();
        SPID      = Request["SPID"] == null ? ConstHelper.DefaultInstance.BesttoneSPID : HttpUtility.HtmlDecode(Request["SPID"]);
        ReturnUrl = Request["ReturnUrl"] == null ? ConstHelper.DefaultInstance.BesttoneLoginPage : HttpUtility.HtmlDecode(Request["ReturnUrl"]);

        string username = Request.Form["username"].ToString().Trim();
        string fullname = Request.Form["fullname"].ToString().Trim();
        string password = Request.Form["password"].ToString().Trim();

        if (CommonUtility.IsEmpty(password))
        {
            err_password.InnerHtml = "密码不能为空格";
            return;
        }
        string telephone = Request.Form["telephone"].ToString().Trim();
        string phonecode = Request.Form["phone_code"].ToString().Trim();

        if (ViewState["phonestate"] == null)
        {
            ViewState["phonestate"] = Request.Form["phonestate"].ToString();
            string a = (string)ViewState["phonestate"];
        }

        string email            = Request.Form["email"].ToString().Trim();
        string NickName         = Request.Form["NickName"].ToString();
        string CertificateType1 = Request.Form["CertificateType"].ToString();
        string certnoS          = Request.Form["certno"].ToString().Trim();
        string sex         = Request.Form["sex"].ToString();
        string birthday    = Request.Form["birthday"].ToString().Trim();
        string EduLevel    = Request.Form["EduLevel"].ToString().Trim();
        string IncomeLevel = Request.Form["IncomeLevel"].ToString();
        string Province    = stext.Value.ToString();
        string Area        = resulttxt.Value.ToString();
        string ErrMsg      = "";
        int    Result;

        //判断用户名是否存在
        if (CustBasicInfo.IsExistUser(username) != 0)
        {
            err_username.InnerHtml = "该用户名已经存在";

            return;
        }


        if (((string)ViewState["phonestate"]).Equals("0"))
        {
            //判断手机验证码
            Result = PhoneBO.SelSendSMSMassage("", telephone, phonecode, out ErrMsg);
            if (Result != 0)
            {
                err_phone_code.InnerHtml = "手机验证码错误,请重新输入";

                return;
            }

            //判断页面验证码
            if (!CommonUtility.ValidateValidateCode(HttpUtility.HtmlDecode(Request.Form["page_code"].ToString().Trim().ToUpper()), this.Context))
            {
                err_page_code.InnerHtml = "页面验证码错误,请重新输入";

                return;
            }
        }

        //当为认证邮箱时,判断是否已经被绑定
        if (Chk_Mail.Checked && !CommonUtility.IsEmpty(email))
        {
            Result = SetMail.EmailSel("", email, SPID, out ErrMsg);
            if (Result != 0)
            {
                err_email.InnerHtml = "该邮箱已经被其他用户绑定";

                return;
            }
            emailstate = "0";
        }

        TimeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        Result    = UserRegistry.getUserRegistryWeb(SPID, username, fullname, password, telephone, (string)ViewState["phonestate"], email, emailstate,
                                                    NickName, CertificateType1, certnoS, sex, birthday, EduLevel, IncomeLevel, Province, Area, out CustID, out ErrMsg);
        if (Result != 0)
        {
            //跳转至错误页面
            if (Result == -30002)
            {
                Err_certno.InnerHtml = ErrMsg;
            }
            else
            {
                CommonBizRules.ErrorHappenedRedircet(Result, ErrMsg, "用户注册", this.Context);
            }

            return;
        }

        SPInfoManager spInfo = new SPInfoManager();
        Object        SPData = spInfo.GetSPData(this.Context, "SPData");
        string        key    = spInfo.GetPropertyBySPID(SPID, "SecretKey", SPData);
        string        Digest = CryptographyUtil.GenerateAuthenticator(TimeStamp + "$" + CustID + "$" + Result + "$" + ErrMsg, key);
        string        temp   = SPID + "$" + CryptographyUtil.Encrypt(TimeStamp + "$" + CustID + "$" + Result + "$" + ErrMsg + "$" + Digest, key);
        string        RegistryResponseValue = HttpUtility.UrlEncode(temp);

        //给用户写cookie
        UserToken UT             = new UserToken();
        string    key2           = spInfo.GetPropertyBySPID("35000000", "SecretKey", SPData);
        string    UserTokenValue = UT.GenerateUserToken(CustID, fullname, username, NickName, "", "42", username, "1", key2, out ErrMsg);
        string    CookieName     = System.Configuration.ConfigurationManager.AppSettings["CookieName"];

        PageUtility.SetCookie(UserTokenValue, CookieName, this.Page);

        //给客户认证邮箱发EMAIL
        string m   = CommonBizRules.EncryptEmailURl(CustID, email, this.Context);
        string url = "点击完成认证:<a href='" + m + "'>" + m + "</a>";

        if (Chk_Mail.Checked && !CommonUtility.IsEmpty(email))
        {
            DateTime datetime = DateTime.Now;
            SetMail.InsertEmailSendMassage(CustID, "1", url, "", 1, email, datetime, "", "中国电信号码百事通:激活邮箱", 0, out ErrMsg);
        }

        //通知积分平台
        CIP2BizRules.InsertCustInfoNotify(CustID, "2", SPID, "", "0", out ErrMsg);
        //记登录日志
        CommonBizRules.WriteDataCustAuthenLog(SPID, CustID, "35", "0", "", "2", Result, ErrMsg);

        //跳转至成功页面
        if (ReturnUrl.IndexOf("?") > 0)
        {
            CommonBizRules.SuccessRedirect(ReturnUrl + "&RegistryResponse=" + RegistryResponseValue, "成功注册", this.Context);
        }
        else
        {
            CommonBizRules.SuccessRedirect(ReturnUrl + "?RegistryResponse=" + RegistryResponseValue, "成功注册", this.Context);
        }
    }