コード例 #1
0
ファイル: Login.cs プロジェクト: object8421/ichari
    public void SetCheckCode(Sites site, Shove.Web.UI.ShoveCheckCode sccCheckCode)
    {
        switch (site.SiteOptions["Opt_CheckCodeCharset"].ToShort(0))
        {
        case 0:
            sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.All;
            break;

        case 1:
            sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyLetter;
            break;

        case 2:
            sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyLetterLower;
            break;

        case 3:
            sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyLetterUpper;
            break;

        case 4:
            sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyNumeric;
            break;

        default:
            sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.All;
            break;
        }
    }
コード例 #2
0
    public string CheckReg(string name, string password, string password2, string email, string realityName, string inputCheckCode, string CheckCode, string IDCardNumber)
    {
        name         = name.Trim();
        password     = password.Trim();
        password2    = password2.Trim();
        email        = email.Trim();
        realityName  = realityName.Trim();
        IDCardNumber = IDCardNumber.Trim();

        if (!PF.CheckUserName(name))
        {
            return("对不起用户名中含有禁止使用的字符");
        }

        if (Shove._String.GetLength(name) < 5 || Shove._String.GetLength(name) > 16)
        {
            return("用户名长度在 5-16 个英文字符或数字、中文 3-8 之间。");
        }

        if (password != password2)
        {
            return("两次密码输入不一致,请仔细检查。");
        }

        if (password.Length < 6 || password.Length > 16)
        {
            return("密码长度必须在 6-16 位之间。");
        }

        if (!Shove._String.Valid.isEmail(email))
        {
            return("电子邮件地址格式不正确。");
        }

        //if (IDCardNumber.Trim() == "")
        //{
        //    return "请输入您的身份证号码。";
        //}

        if (IDCardNumber.Trim() != "")
        {
            if ((!Shove._String.Valid.isIDCardNumber(IDCardNumber.Trim())) && (!Shove._String.Valid.isIDCardNumber_Hongkong(IDCardNumber.Trim())) &&
                (!Shove._String.Valid.isIDCardNumber_Macau(IDCardNumber.Trim())) && (!Shove._String.Valid.isIDCardNumber_Singapore(IDCardNumber.Trim())) &&
                (!Shove._String.Valid.isIDCardNumber_Taiwan(IDCardNumber.Trim())))
            {
                return("身份证号码格式不正确。");
            }
        }

        Shove.Web.UI.ShoveCheckCode sccCheckCode = new Shove.Web.UI.ShoveCheckCode();

        if (!sccCheckCode.Valid(CheckCode, inputCheckCode))
        {
            return("验证码输入错误");
        }

        return("");
    }
コード例 #3
0
ファイル: Login.cs プロジェクト: object8421/ichari
    /// <summary>
    /// 登录,用于 Ajax 传入情况
    /// </summary>
    /// <param name="page"></param>
    /// <param name="site"></param>
    /// <param name="Name"></param>
    /// <param name="Password"></param>
    /// <param name="InputCheckCode">用户输入的验证码</param>
    /// <param name="CheckCode">验证码控件中记录的加密的原始验证码,用于校验</param>
    /// <param name="ReturnDescription"></param>
    /// <returns></returns>
    public int LoginSubmit(Page page, Sites site, string Name, string Password, string InputCheckCode, string CheckCode, ref string ReturnDescription)
    {
        ReturnDescription = "";

        bool Opt_isUseCheckCode = site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);

        Name     = Name.Trim();
        Password = Password.Trim();

        if ((Name == "") || (Password == ""))
        {
            ReturnDescription = "用户名和密码都不能为空";

            return(-1);
        }

        if (Opt_isUseCheckCode)
        {
            Shove.Web.UI.ShoveCheckCode sccCheckCode = new Shove.Web.UI.ShoveCheckCode();

            if (!sccCheckCode.Valid(InputCheckCode, CheckCode))
            {
                ReturnDescription = "验证码输入错误";

                return(-2);
            }
        }

        System.Threading.Thread.Sleep(500);

        Users user = new Users(site.ID);

        user.Name     = Name;
        user.Password = Password;

        return(user.Login(ref ReturnDescription));
    }
コード例 #4
0
ファイル: Login.cs プロジェクト: ichari/ichari
    /// <summary>
    /// 登录,用于 Ajax 传入情况
    /// </summary>
    /// <param name="page"></param>
    /// <param name="site"></param>
    /// <param name="Name"></param>
    /// <param name="Password"></param>
    /// <param name="InputCheckCode">用户输入的验证码</param>
    /// <param name="CheckCode">验证码控件中记录的加密的原始验证码,用于校验</param>
    /// <param name="ReturnDescription"></param>
    /// <returns></returns>
    public int LoginSubmit(Page page, Sites site, string Name, string Password, string InputCheckCode, string CheckCode, ref string ReturnDescription)
    {
        ReturnDescription = "";

        bool Opt_isUseCheckCode = site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);

        Name = Name.Trim();
        Password = Password.Trim();

        if ((Name == "") || (Password == ""))
        {
            ReturnDescription = "用户名和密码都不能为空";

            return -1;
        }

        if (Opt_isUseCheckCode)
        {
            Shove.Web.UI.ShoveCheckCode sccCheckCode = new Shove.Web.UI.ShoveCheckCode();

            if (!sccCheckCode.Valid(InputCheckCode, CheckCode))
            {
                ReturnDescription = "验证码输入错误";

                return -2;
            }
        }

        System.Threading.Thread.Sleep(500);

        Users user = new Users(site.ID);
        user.Name = Name;
        user.Password = Password;

        return user.Login(ref ReturnDescription);
    }
コード例 #5
0
    public int LoginSubmit(Page page, Sites site, string ID, string Password, string InputCheckCode, Shove.Web.UI.ShoveCheckCode sccCheckCode, ref string ReturnDescription)
    {
        ReturnDescription = "";

        bool Opt_isUseCheckCode = site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);

        ID       = ID.Trim();
        Password = Password.Trim();

        if ((ID == "") || (Password == ""))
        {
            ReturnDescription = "用户名和密码都不能为空";

            return(-1);
        }

        if ((Opt_isUseCheckCode) && (!sccCheckCode.Valid(InputCheckCode)))
        {
            ReturnDescription = "验证码输入错误";

            return(-2);
        }

        System.Threading.Thread.Sleep(500);

        ElectronTicketAgents electronTicketAgents = new ElectronTicketAgents();

        electronTicketAgents.ID       = Shove._Convert.StrToInt(ID, 0);
        electronTicketAgents.Password = Password;

        return(electronTicketAgents.Login(ref ReturnDescription));
    }
コード例 #6
0
ファイル: UserLogin.aspx.cs プロジェクト: ichari/ichari
    public string CheckReg(string name, string password, string password2, string email, string realityName,string inputCheckCode,string CheckCode, string IDCardNumber)
    {
        name = name.Trim();
        password = password.Trim();
        password2 = password2.Trim();
        email = email.Trim();
        realityName = realityName.Trim();
        IDCardNumber = IDCardNumber.Trim();

        if (!PF.CheckUserName(name))
        {
            return "对不起用户名中含有禁止使用的字符";
        }

        if (Shove._String.GetLength(name) < 5 || Shove._String.GetLength(name) > 16)
        {
            return "用户名长度在 5-16 个英文字符或数字、中文 3-8 之间。";
        }

        if (password != password2)
        {
            return "两次密码输入不一致,请仔细检查。";
        }

        if (password.Length < 6 || password.Length > 16)
        {
            return "密码长度必须在 6-16 位之间。";
        }

        if (!Shove._String.Valid.isEmail(email))
        {
            return "电子邮件地址格式不正确。";
        }

        //if (IDCardNumber.Trim() == "")
        //{
        //    return "请输入您的身份证号码。";
        //}

        if (IDCardNumber.Trim() != "")
        {
            if ((!Shove._String.Valid.isIDCardNumber(IDCardNumber.Trim())) && (!Shove._String.Valid.isIDCardNumber_Hongkong(IDCardNumber.Trim()))
            && (!Shove._String.Valid.isIDCardNumber_Macau(IDCardNumber.Trim())) && (!Shove._String.Valid.isIDCardNumber_Singapore(IDCardNumber.Trim()))
            && (!Shove._String.Valid.isIDCardNumber_Taiwan(IDCardNumber.Trim())))
            {
                return "身份证号码格式不正确。";
            }
        }

        Shove.Web.UI.ShoveCheckCode sccCheckCode = new Shove.Web.UI.ShoveCheckCode();

        if (!sccCheckCode.Valid(CheckCode,inputCheckCode))
        {
            return "验证码输入错误";
        }

        return "";
    }