コード例 #1
0
ファイル: EPayments.cs プロジェクト: xiongeee/BBX
        public static bool CheckPayment(string notifyId)
        {
            var    config = GeneralConfigInfo.Current;
            string arg    = (config.Alipaypartnerid != "") ? config.Alipaypartnerid : "2088002872555901";
            string arg2   = "https://www.alipay.com/cooperate/gateway.do?service=notify_verify&";
            string arg3   = "http://notify.alipay.com/trade/notify_query.do?";
            string http   = EPayments.GetHttp(string.Format("{0}partner={1}&notify_id={2}", arg2, arg, notifyId));

            if (http != "true")
            {
                http = EPayments.GetHttp(string.Format("{0}partner={1}&notify_id={2}", arg3, arg, notifyId));
            }
            if (http != "true")
            {
                return(false);
            }
            if (HttpContext.Current.Request.HttpMethod.Equals("GET"))
            {
                return(true);
            }

            string[] allKeys = HttpContext.Current.Request.Form.AllKeys;
            var      sb      = new StringBuilder();

            //if (config.Usealipaycustompartnerid == 0)
            //{
            //    string url = "http://pay.newlifex.com/gateway/alipay.ashx?_type=alipay&_action=verify&_product=" + Utils.Version + "&_version=" + Utils.Version;
            //    for (int i = 0; i < allKeys.Length; i++)
            //    {
            //        if (DNTRequest.GetString(allKeys[i]) != "")
            //        {
            //            if (stringBuilder.ToString() == "")
            //            {
            //                stringBuilder.Append(allKeys[i] + "=" + Utils.UrlEncode(DNTRequest.GetString(allKeys[i])));
            //            }
            //            else
            //            {
            //                stringBuilder.Append("&" + allKeys[i] + "=" + Utils.UrlEncode(DNTRequest.GetString(allKeys[i])));
            //            }
            //        }
            //    }
            //    return EPayments.GetHttp(url, stringBuilder.ToString()) == "true";
            //}
            for (int j = 0; j < allKeys.Length; j++)
            {
                if (DNTRequest.GetString(allKeys[j]) != "" && allKeys[j] != "sign" && allKeys[j] != "sign_type")
                {
                    if (String.IsNullOrEmpty(sb.ToString()))
                    {
                        sb.Append(allKeys[j] + "=" + DNTRequest.GetString(allKeys[j]));
                    }
                    else
                    {
                        sb.Append("&" + allKeys[j] + "=" + DNTRequest.GetString(allKeys[j]));
                    }
                }
            }
            sb.Append(config.Alipaypartnercheckkey);
            return(EPayments.GetMD5(sb.ToString(), "utf-8") == DNTRequest.GetString("sign"));
        }
コード例 #2
0
        public static bool Search(int userid, DateTime lastsearchtime, int useradminid, UserGroup usergroupinfo, ref string msg)
        {
            var config = GeneralConfigInfo.Current;

            if (useradminid != 1 && DNTRequest.GetInt("keywordtype", 0) == 1 && !usergroupinfo.DisablePeriodctrl)
            {
                string str = "";
                if (Scoresets.BetweenTime(config.Searchbanperiods, out str))
                {
                    msg = "在此时间段( " + str + " )内用户不可以进行全文搜索";
                    return(false);
                }
            }
            if (useradminid != 1)
            {
                if (!Statistic.CheckSearchCount(config.Maxspm))
                {
                    msg = "抱歉,系统在一分钟内搜索的次数超过了系统安全设置的上限,请稍候再试";
                    return(false);
                }
                //int num = Utils.StrDateDiffSeconds(lastsearchtime, config.Searchctrl);
                var ts = lastsearchtime.AddSeconds(config.Searchctrl) - DateTime.Now;
                if (ts.TotalSeconds > 0)
                {
                    msg = "系统规定搜索间隔为" + config.Searchctrl + "秒, 您还需要等待 " + ts.TotalSeconds + " 秒";
                    return(false);
                }
                if (userid != -1 && CreditsFacade.Search(userid) == -1)
                {
                    string str2 = "";
                    if (EPayments.IsOpenEPayments())
                    {
                        str2 = "<br/><span><a href=\"usercpcreditspay.aspx\">点击充值积分</a></span>";
                    }
                    msg = "您的积分不足, 不能执行搜索操作" + str2;
                    return(false);
                }
            }
            return(true);
        }
コード例 #3
0
ファイル: EPayments.cs プロジェクト: xiongeee/BBX
 public static string GetHttp(string url)
 {
     return(EPayments.GetHttp(url, ""));
 }