Exemplo n.º 1
0
        protected override void ShowPage()
        {
            this.pagetitle = "积分充值";
            if (!EPayments.IsOpenEPayments())
            {
                base.AddErrLine("论坛未开启积分充值服务!");
                return;
            }
            string text = "";

            foreach (DataRow dataRow in Scoresets.GetScorePaySet(0).Rows)
            {
                object obj = text;
                text = obj + "creditsrate[" + dataRow["id"] + "] = " + dataRow["rate"] + ";\r\n";
            }
            this.jscreditsratearray = string.Format(this.jscreditsratearray, text);
            if (!base.IsLogin())
            {
                return;
            }
            string @string;

            if (!string.IsNullOrEmpty(DNTRequest.GetString("redirect")) && (@string = DNTRequest.GetString("redirect")) != null)
            {
                if (!(@string == "alipay"))
                {
                    return;
                }
                this.RedirectToAlipay();
            }
        }
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            GeneralConfigInfo    configInfo           = GeneralConfigs.GetConfig();
            InvitationConfigInfo invitationConfigInfo = InvitationConfigs.GetConfig();

            regstatus.SelectedValue = configInfo.Regstatus.ToString();

            censoruser.Text           = configInfo.Censoruser;
            doublee.SelectedValue     = configInfo.Doublee.ToString();
            emaillogin.SelectedValue  = configInfo.Emaillogin.ToString();
            regverify.SelectedValue   = configInfo.Regverify.ToString();
            accessemail.Text          = configInfo.Accessemail;
            censoremail.Text          = configInfo.Censoremail;
            hideprivate.SelectedValue = configInfo.Hideprivate.ToString();
            ipdenyaccess.Text         = configInfo.Ipdenyaccess;
            ipaccess.Text             = configInfo.Ipaccess;
            regctrl.Text                      = configInfo.Regctrl.ToString();
            ipregctrl.Text                    = configInfo.Ipregctrl;
            adminipaccess.Text                = configInfo.Adminipaccess;
            welcomemsg.SelectedValue          = configInfo.Welcomemsg.ToString();
            welcomemsgtxt.Text                = configInfo.Welcomemsgtxt;
            rules.SelectedValue               = configInfo.Rules.ToString();
            rulestxt.Text                     = configInfo.Rulestxt;
            newbiespan.Text                   = configInfo.Newbiespan.ToString();
            realnamesystem.SelectedValue      = configInfo.Realnamesystem.ToString();
            invitecodeexpiretime.Text         = invitationConfigInfo.InviteCodeExpireTime.ToString();
            invitecodemaxcount.Text           = invitationConfigInfo.InviteCodeMaxCount.ToString();
            addextcreditsline.Text            = invitationConfigInfo.InviteCodePayCount.ToString();
            invitationuserdescription.Text    = invitationConfigInfo.InvitationLoginUserDescription;//配置项赋值给textarea的innnerhtml能保证显示出来的是所见即所得的效果
            invitationvisitordescription.Text = invitationConfigInfo.InvitationVisitorDescription;
            invitationemailmodel.Text         = invitationConfigInfo.InvitationEmailTemplate;
            invitecodeusermaxbuy.Text         = invitationConfigInfo.InviteCodeMaxCountToBuy.ToString();
            invitecodeusercreateperday.Text   = invitationConfigInfo.InviteCodeUserCreatePerDay.ToString();
            passwordmode.SelectedValue        = configInfo.Passwordmode.ToString();
            CookieDomain.Text                 = configInfo.CookieDomain.ToString();
            string[] extCredits = Utils.SplitString(invitationConfigInfo.InviteCodePrice, ",");
            extCreditsUnits = Scoresets.GetValidScoreUnit();
            DataTable extCreditsTable = Scoresets.GetScorePaySet(0);

            //初始化邀请码价格显示界面,全部为隐藏
            for (int count = 0; count < 8; count++)
            {
                extCreditsName[count] = "";
                TextBox textbox = this.FindControl("invitecodeprice" + count.ToString()) as TextBox;
                textbox.Text    = extCredits[count];
                textbox.Visible = false;
            }

            //根据邀请码相关信息,将有效的信息显示在界面中
            foreach (DataRow dr in extCreditsTable.Rows)
            {
                extCreditsName[Utils.StrToInt(dr["id"].ToString(), 0) - 1] = dr["name"].ToString() + ":";
                TextBox textbox = this.FindControl("invitecodeprice" + (Utils.StrToInt(dr[0].ToString(), 0) - 1).ToString()) as TextBox;
                textbox.Visible = true;
            }

            #endregion
        }
Exemplo n.º 3
0
        public void LoadConfigInfo()
        {
            GeneralConfigInfo    config  = GeneralConfigInfo.Current;
            InvitationConfigInfo config2 = InvitationConfigInfo.Current;

            this.regstatus.SelectedValue   = config.Regstatus.ToString();
            this.censoruser.Text           = config.Censoruser;
            this.doublee.SelectedValue     = config.Doublee.ToString();
            this.emaillogin.SelectedValue  = config.Emaillogin.ToString();
            this.regverify.SelectedValue   = config.Regverify.ToString();
            this.accessemail.Text          = config.Accessemail;
            this.censoremail.Text          = config.Censoremail;
            this.hideprivate.SelectedValue = config.Hideprivate.ToString();
            this.ipdenyaccess.Text         = config.Ipdenyaccess;
            this.ipaccess.Text             = config.Ipaccess;
            this.regctrl.Text                      = config.Regctrl.ToString();
            this.ipregctrl.Text                    = config.Ipregctrl;
            this.adminipaccess.Text                = config.Adminipaccess;
            this.welcomemsg.SelectedValue          = config.Welcomemsg.ToString();
            this.welcomemsgtxt.Text                = config.Welcomemsgtxt;
            this.rules.SelectedValue               = config.Rules.ToString();
            this.rulestxt.Text                     = config.Rulestxt;
            this.newbiespan.Text                   = config.Newbiespan.ToString();
            this.realnamesystem.SelectedValue      = config.Realnamesystem.ToString();
            this.invitecodeexpiretime.Text         = config2.InviteCodeExpireTime.ToString();
            this.invitecodemaxcount.Text           = config2.InviteCodeMaxCount.ToString();
            this.addextcreditsline.Text            = config2.InviteCodePayCount.ToString();
            this.invitationuserdescription.Text    = config2.InvitationLoginUserDescription;
            this.invitationvisitordescription.Text = config2.InvitationVisitorDescription;
            this.invitationemailmodel.Text         = config2.InvitationEmailTemplate;
            this.invitecodeusermaxbuy.Text         = config2.InviteCodeMaxCountToBuy.ToString();
            this.invitecodeusercreateperday.Text   = config2.InviteCodeUserCreatePerDay.ToString();
            this.passwordmode.SelectedValue        = config.Passwordmode.ToString();
            this.CookieDomain.Text                 = config.CookieDomain;
            this.verifyregisterexpired.Text        = config.Verifyregisterexpired.ToString();
            this.verifyemailtemp.text              = config.Verifyregisteremailtemp;
            string[] array = Utils.SplitString(config2.InviteCodePrice, ",");
            this.extCreditsUnits = Scoresets.GetValidScoreUnit();
            var scorePaySet = Scoresets.GetScorePaySet(0);

            for (int i = 0; i < 8; i++)
            {
                this.extCreditsName[i] = "";
                var textBox = this.FindControl("invitecodeprice" + i) as BBX.Control.TextBox;
                textBox.Text    = array[i];
                textBox.Visible = false;
            }
            foreach (DataRow dataRow in scorePaySet.Rows)
            {
                this.extCreditsName[dataRow["id"].ToString().ToInt(0) - 1] = dataRow["name"] + ":";
                var textBox2 = this.FindControl("invitecodeprice" + (dataRow[0].ToString().ToInt(0) - 1).ToString()) as BBX.Control.TextBox;
                textBox2.Visible = true;
            }
        }
        protected override void ShowPage()
        {
            pagetitle = "积分充值";

            if (!EPayments.IsOpenEPayments())
            {
                AddErrLine("论坛未开启积分充值服务!");
                return;
            }

            string jsCreditsRateArray = "";

            foreach (DataRow dr in Scoresets.GetScorePaySet(0).Rows)
            {
                jsCreditsRateArray += "creditsrate[" + dr["id"] + "] = " + dr["rate"] + ";\r\n";
            }
            jscreditsratearray = string.Format(jscreditsratearray, jsCreditsRateArray);

            if (!IsLogin())
            {
                return;
            }

            if (!string.IsNullOrEmpty(DNTRequest.GetString("redirect")))
            {
                switch (DNTRequest.GetString("redirect"))//根据该值判断操作类型
                {
                case "alipay":
                    RedirectToAlipay();
                    break;

                default:
                    return;
                }
            }
        }
        protected override void ShowPage()
        {
            pagetitle = "用户控制面板";

            string jsCreditsRateArray = "";

            foreach (DataRow dr in Scoresets.GetScorePaySet(0).Rows)
            {
                jsCreditsRateArray += "creditsrate[" + dr["id"] + "] = " + dr["rate"] + ";\r\n";
            }
            jscreditsratearray = string.Format(jscreditsratearray, jsCreditsRateArray);

            if (!IsLogin())
            {
                return;
            }

            if (DNTRequest.IsPost())
            {
                if (ForumUtils.IsCrossSitePost())
                {
                    AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }

                bool isPasswordError = true;

                switch (config.Passwordmode)
                {
                case 1:    //动网兼容模式
                {
                    isPasswordError = Utils.MD5(DNTRequest.GetString("password")) != password;
                    break;
                }

                case 0:    //默认模式
                {
                    isPasswordError = Utils.MD5(DNTRequest.GetString("password")) != password;
                    break;
                }

                default:     //第三方加密验证模式
                {
                    if (PasswordModeProvider.GetInstance() != null)
                    {
                        isPasswordError = !PasswordModeProvider.GetInstance().CheckPassword(user, DNTRequest.GetString("password"));
                    }
                    break;
                }
                }
                if (isPasswordError)
                {
                    AddErrLine("密码错误");
                    return;
                }

                int paynum = DNTRequest.GetInt("paynum", 0);
                if (paynum <= 0)
                {
                    AddErrLine("数量必须是大于0的整数");
                    return;
                }
                if (DNTRequest.GetInt("extcredits1", 0) < 1 || DNTRequest.GetInt("extcredits2", 0) < 1 || DNTRequest.GetInt("extcredits1", 0) > 8 || DNTRequest.GetInt("extcredits2", 0) > 8)
                {
                    AddErrLine("请正确选择要兑换的积分类型!");
                    return;
                }
                if (DNTRequest.GetInt("extcredits1", 0) == DNTRequest.GetInt("extcredits2", 0))
                {
                    AddErrLine("不能兑换相同类型的积分");
                    return;
                }

                //对交易后的积分增减进行修改设置
                UserExtcreditsInfo extcredits1info = Scoresets.GetScoreSet(DNTRequest.GetInt("extcredits1", 0));
                UserExtcreditsInfo extcredits2info = Scoresets.GetScoreSet(DNTRequest.GetInt("extcredits2", 0));
                if (Utils.StrIsNullOrEmpty(extcredits1info.Name) || Utils.StrIsNullOrEmpty(extcredits2info.Name))
                {
                    AddErrLine("错误的输入!");
                    return;
                }
                if ((Users.GetUserExtCredits(userid, DNTRequest.GetInt("extcredits1", 0)) - paynum) < Scoresets.GetExchangeMinCredits())
                {
                    AddErrLine("抱歉, 您的 \"" + extcredits1info.Name + "\" 不足." + Scoresets.GetExchangeMinCredits());
                    return;
                }

                UserInfo userInfo = Users.GetUserInfo(userid);

                float extcredit2paynum = (float)Math.Round(paynum * (extcredits1info.Rate / extcredits2info.Rate) * (1 - creditstax), 2);
                Users.UpdateUserExtCredits(userid, DNTRequest.GetInt("extcredits1", 0), paynum * -1);
                Users.UpdateUserExtCredits(userid, DNTRequest.GetInt("extcredits2", 0), extcredit2paynum);
                CreditsLogs.AddCreditsLog(userid, userid, DNTRequest.GetInt("extcredits1", 0), DNTRequest.GetInt("extcredits2", 0), paynum, extcredit2paynum, Utils.GetDateTime(), 1);

                SetUrl("usercpcreaditstransferlog.aspx");
                SetMetaRefresh();
                SetShowBackLink(false);
                AddMsgLine("积分兑换完毕, 正在返回积分兑换与转帐记录");
            }
        }
        protected override void ShowPage()
        {
            pagetitle = "用户控制面板";

            creditstax = Scoresets.GetCreditsTax();

            if (userid == -1)
            {
                AddErrLine("你尚未登录");

                return;
            }
            user = Discuz.Forum.Users.GetUserInfo(userid);

            if (DNTRequest.IsPost())
            {
                if (ForumUtils.IsCrossSitePost())
                {
                    AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }

                if (Utils.MD5(DNTRequest.GetString("password")) != password)
                {
                    AddErrLine("密码错误");
                    return;
                }

                int paynum = DNTRequest.GetInt("paynum", 0);
                if (paynum <= 0)
                {
                    AddErrLine("数量必须是大于等于0的整数");
                    return;
                }

                int fromto = Discuz.Forum.Users.GetUserID(DNTRequest.GetString("fromto").Trim());
                if (fromto == -1)
                {
                    AddErrLine("指定的转帐接受人不存在");
                    return;
                }

                int extcredits = DNTRequest.GetInt("extcredits", 0);
                if (extcredits < 1 || extcredits > 8)
                {
                    AddErrLine("请正确选择要转帐的金币类型!");
                    return;
                }

                //对转帐后的金币增减进行修改设置
                UserExtcreditsInfo extcreditsinfo = Scoresets.GetScoreSet(extcredits);
                if (extcreditsinfo.Name.Trim() == "")
                {
                    AddErrLine("错误的输入!");
                    return;
                }


                //UserInfo __userinfo = Discuz.Forum.Users.GetUserInfo(userid);
                if ((Discuz.Forum.Users.GetUserExtCredits(userid, extcredits) - paynum) < Scoresets.GetTransferMinCredits())
                {
                    AddErrLine(string.Format("抱歉, 您的 \"{0}\" 不足.系统当前规定转帐余额不得小于{1}", extcreditsinfo.Name, Scoresets.GetTransferMinCredits().ToString()));
                    return;
                }

                //计算并更新2个扩展金币的新值
                float topaynum = (float)Math.Round(paynum * (1 - creditstax), 2);
                Discuz.Forum.Users.UpdateUserExtCredits(userid, extcredits, paynum * -1);
                Discuz.Forum.Users.UpdateUserExtCredits(fromto, extcredits, topaynum);
                CreditsLogs.AddCreditsLog(userid, fromto, extcredits, extcredits, paynum, topaynum, Utils.GetDateTime(),
                                          2);

                SetUrl("usercpcreaditstransferlog.aspx");
                SetMetaRefresh();
                SetShowBackLink(false);
                AddMsgLine("金币转帐完毕, 正在返回金币兑换与转帐记录");
            }

            score             = Scoresets.GetValidScoreName();
            extcreditspaylist = Scoresets.GetScorePaySet(1);
        }
Exemplo n.º 7
0
        protected override void ShowPage()
        {
            pagetitle = "用户控制面板";

            creditstax        = Scoresets.GetCreditsTax();
            extcreditspaylist = Scoresets.GetScorePaySet(0);
            score             = Scoresets.GetValidScoreName();

            jscreditsratearray = "<script type=\"text/javascript\">\r\nvar creditsrate = new Array();\r\n";
            foreach (DataRow dr in extcreditspaylist.Rows)
            {
                jscreditsratearray = jscreditsratearray + "creditsrate[" + dr["id"].ToString() + "] = " +
                                     dr["rate"].ToString() + ";\r\n";
            }
            jscreditsratearray = jscreditsratearray + "\r\n</script>";

            if (userid == -1)
            {
                AddErrLine("你尚未登录");

                return;
            }
            user = Discuz.Forum.Users.GetUserInfo(userid);
            if (DNTRequest.IsPost())
            {
                if (ForumUtils.IsCrossSitePost())
                {
                    AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }

                if (Utils.MD5(DNTRequest.GetString("password")) != password)
                {
                    AddErrLine("密码错误");
                    return;
                }

                int paynum = DNTRequest.GetInt("paynum", 0);
                if (paynum <= 0)
                {
                    AddErrLine("数量必须是大于0的整数");
                    return;
                }

                int extcredits1 = DNTRequest.GetInt("extcredits1", 0);
                int extcredits2 = DNTRequest.GetInt("extcredits2", 0);
                if (extcredits1 < 1 || extcredits2 < 1 || extcredits1 > 8 || extcredits2 > 8)
                {
                    AddErrLine("请正确选择要兑换的金币类型!");
                    return;
                }
                if (extcredits1 == extcredits2)
                {
                    AddErrLine("不能兑换相同类型的金币");
                    return;
                }

                //对交易后的金币增减进行修改设置
                UserExtcreditsInfo extcredits1info = Scoresets.GetScoreSet(extcredits1);
                UserExtcreditsInfo extcredits2info = Scoresets.GetScoreSet(extcredits2);

                if ((extcredits1info.Name.Trim() == "") || (extcredits2info.Name.Trim() == ""))
                {
                    AddErrLine("错误的输入!");
                    return;
                }


                UserInfo __userinfo = Discuz.Forum.Users.GetUserInfo(userid);
                if ((Discuz.Forum.Users.GetUserExtCredits(userid, extcredits1) - paynum) < Scoresets.GetExchangeMinCredits())
                {
                    AddErrLine("抱歉, 您的 \"" + extcredits1info.Name + "\" 不足." +
                               Scoresets.GetExchangeMinCredits().ToString());
                    return;
                }

                //计算并更新2个扩展金币的新值
                extcredits1rate = extcredits1info.Rate;
                extcredits2rate = extcredits2info.Rate;
                float extcredit2paynum =
                    (float)Math.Round(paynum * (extcredits1rate / extcredits2rate) * (1 - creditstax), 2);
                Discuz.Forum.Users.UpdateUserExtCredits(userid, extcredits1, paynum * -1);
                Discuz.Forum.Users.UpdateUserExtCredits(userid, extcredits2, extcredit2paynum);
                CreditsLogs.AddCreditsLog(userid, userid, extcredits1, extcredits2, paynum, extcredit2paynum,
                                          Utils.GetDateTime(), 1);

                SetUrl("usercpcreaditstransferlog.aspx");
                SetMetaRefresh();
                SetShowBackLink(false);
                AddMsgLine("金币兑换完毕, 正在返回金币兑换与转帐记录");
            }
        }
Exemplo n.º 8
0
        protected override void ShowPage()
        {
            this.pagetitle = "用户控制面板";
            string text = "";

            foreach (DataRow dataRow in Scoresets.GetScorePaySet(0).Rows)
            {
                object obj = text;
                text = obj + "creditsrate[" + dataRow["id"] + "] = " + dataRow["rate"] + ";\r\n";
            }
            this.jscreditsratearray = string.Format(this.jscreditsratearray, text);
            if (!base.IsLogin())
            {
                return;
            }
            if (DNTRequest.IsPost())
            {
                if (ForumUtils.IsCrossSitePost())
                {
                    base.AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }
                bool flag = true;
                //switch (this.config.Passwordmode)
                //{
                //    case 0:
                flag = Utils.MD5(DNTRequest.GetString("password")).EqualIgnoreCase(this.password);
                //        break;
                //    case 1:
                //        flag = (Utils.MD5(DNTRequest.GetString("password")) != this.password);
                //        break;
                //    default:
                //        if (PasswordModeProvider.GetInstance() != null)
                //        {
                //            flag = !PasswordModeProvider.GetInstance().CheckPassword(this.user, DNTRequest.GetString("password"));
                //        }
                //        break;
                //}
                if (flag)
                {
                    base.AddErrLine("密码错误");
                    return;
                }
                int paynum = DNTRequest.GetInt("paynum", 0);
                if (paynum <= 0)
                {
                    base.AddErrLine("数量必须是大于0的整数");
                    return;
                }
                if (DNTRequest.GetInt("extcredits1", 0) < 1 || DNTRequest.GetInt("extcredits2", 0) < 1 || DNTRequest.GetInt("extcredits1", 0) > 8 || DNTRequest.GetInt("extcredits2", 0) > 8)
                {
                    base.AddErrLine("请正确选择要兑换的积分类型!");
                    return;
                }
                if (DNTRequest.GetInt("extcredits1", 0) == DNTRequest.GetInt("extcredits2", 0))
                {
                    base.AddErrLine("不能兑换相同类型的积分");
                    return;
                }
                var scoreSet  = Scoresets.GetScoreSet(DNTRequest.GetInt("extcredits1", 0));
                var scoreSet2 = Scoresets.GetScoreSet(DNTRequest.GetInt("extcredits2", 0));
                if (scoreSet.Name.IsNullOrEmpty() || scoreSet2.Name.IsNullOrEmpty())
                {
                    base.AddErrLine("错误的输入!");
                    return;
                }
                if (Users.GetUserExtCredits(this.userid, DNTRequest.GetInt("extcredits1", 0)) - (float)paynum < (float)Scoresets.GetExchangeMinCredits())
                {
                    base.AddErrLine("抱歉, 您的 \"" + scoreSet.Name + "\" 不足.系统当前规定转帐余额不得小于" + Scoresets.GetExchangeMinCredits());
                    return;
                }
                Users.GetUserInfo(this.userid);
                var num = (Int32)Math.Round((double)((float)paynum * (scoreSet.Rate / scoreSet2.Rate) * (1f - this.creditstax)), 2);
                BBX.Entity.User.UpdateUserExtCredits(this.userid, DNTRequest.GetInt("extcredits1", 0), paynum * -1);
                BBX.Entity.User.UpdateUserExtCredits(this.userid, DNTRequest.GetInt("extcredits2", 0), num);
                //CreditsLogs.AddCreditsLog(this.userid, this.userid, DNTRequest.GetInt("extcredits1", 0), DNTRequest.GetInt("extcredits2", 0), (float)@int, num, Utils.GetDateTime(), 1);
                CreditsLog.Add(userid, userid, DNTRequest.GetInt("extcredits1", 0), DNTRequest.GetInt("extcredits2", 0), paynum, num, 1);
                base.SetUrl("usercpcreaditstransferlog.aspx");
                base.SetMetaRefresh();
                base.SetShowBackLink(false);
                base.AddMsgLine("积分兑换完毕, 正在返回积分兑换与转帐记录");
            }
        }