示例#1
0
        static Config()
        {
            string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/payment_alipay.config");

            JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile);
            seller_email = XmlTool.GetText("Root/seller_email"); //商家签约时的支付宝帐号,即收款的支付宝帐号
            partner      = XmlTool.GetText("Root/partner");      //partner合作伙伴id(必须填写)
            key          = XmlTool.GetText("Root/key");          //partner 的对应交易安全校验码(必须填写)
            XmlTool.Dispose();

            return_url = JumboECMS.Utils.App.Url + JumboECMS.Utils.App.Path + "api/alipay/return_url.aspx";
            notify_url = JumboECMS.Utils.App.Url + JumboECMS.Utils.App.Path + "api/alipay/notify_url.aspx";


            //↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑



            //字符编码格式 目前支持 gbk 或 utf-8
            input_charset = "utf-8";

            //签名方式 不需修改
            sign_type = "MD5";

            //访问模式,根据自己的服务器是否支持ssl访问,若支持请选择https;若不支持请选择http
            transport = "https";
        }
示例#2
0
        static DiscuzSessionHelper()
        {
            string strXmlFile = System.Web.HttpContext.Current.Server.MapPath("~/_data/config/site.config");

            JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile);
            apikey = XmlTool.GetText("Root/ForumAPIKey"); //API Key
            secret = XmlTool.GetText("Root/ForumSecret"); //密钥
            url    = XmlTool.GetText("Root/ForumUrl");    //论坛地址
            XmlTool.Dispose();
            ds = new DiscuzSession(apikey, secret, url);
        }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Admin_Load("master", "html");
     if (!Page.IsPostBack)
     {
         string strXmlFile1 = HttpContext.Current.Server.MapPath("~/_data/config/feedback.config");
         JumboECMS.DBUtility.XmlControl XmlTool1 = new JumboECMS.DBUtility.XmlControl(strXmlFile1);
         this.txtPageSize.Text           = XmlTool1.GetText("Root/PageSize");
         this.txtPostTimer.Text          = XmlTool1.GetText("Root/PostTimer");
         this.rblGuestPost.SelectedValue = XmlTool1.GetText("Root/GuestPost");
         this.rblNeedCheck.SelectedValue = XmlTool1.GetText("Root/NeedCheck");
         XmlTool1.Dispose();
     }
 }
示例#4
0
        /// <summary>
        /// 内容页
        /// </summary>
        public static string View(string _siteDir, string _moduletype, int page)
        {
            string strXmlFile = HttpContext.Current.Server.MapPath(_siteDir + "_data/config/pageformat.config");

            JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile);
            string TempUrl = "";

            if (page == 1)
            {
                TempUrl = XmlTool.GetText("Pages/View/P_1");
            }
            else
            {
                TempUrl = XmlTool.GetText("Pages/View/P_N");
            }
            XmlTool.Dispose();
            return(TempUrl);
        }
示例#5
0
        /// <summary>
        /// 站点首页
        /// </summary>
        public static string Site(string _siteDir)
        {
            string strXmlFile = HttpContext.Current.Server.MapPath(_siteDir + "_data/config/pageformat.config");

            JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile);
            string TempUrl = XmlTool.GetText("Pages/Site/P");;

            XmlTool.Dispose();
            return(TempUrl);
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Admin_Load("", "html");
            string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/upload_admin.config");

            JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile);
            this._sAdminUploadType = XmlTool.GetText("Module/link/type");
            this._sAdminUploadSize = Str2Int(XmlTool.GetText("Module/link/size"), 1024);
            XmlTool.Dispose();
            //以下是通过flash将验证信息发送到地址栏
            //注意:Flash上传接收页在非IE的浏览器下获取不到Session和Cookies
            doh.Reset();
            doh.ConditionExpress = "adminid=@adminid";
            doh.AddConditionParameter("@adminid", AdminId);
            doh.AddFieldItem("AdminSign", AdminPass);
            doh.Update("jcms_normal_user");
            this.flashUpload.UploadPage          = "link_upfile.aspx";
            this.flashUpload.Args                = "adminsign=" + AdminPass + ";adminid=" + AdminId + ";";
            this.flashUpload.UploadFileSizeLimit = this._sAdminUploadSize * 1024;
            this.flashUpload.FileTypeDescription = this._sAdminUploadType;
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string _code = q("code");

            if (_code.Length != 64)
            {
                Response.Write("参数有误");
            }
            string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/javascript.config");

            JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile);
            string _TemplateContent = XmlTool.GetText("Lis/Li[Code=\"" + _code + "\"]/TemplateContent");

            XmlTool.Dispose();
            JumboECMS.DAL.TemplateEngineDAL teDAL = new JumboECMS.DAL.TemplateEngineDAL();
            string fileStr = ExecuteCommonTags(_TemplateContent);

            Response.Write(JumboECMS.Utils.Strings.Html2Js(fileStr));
        }
示例#8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Admin_Load("config-mng", "stop");
     if (!Page.IsPostBack)
     {
         string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/site.config");
         JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile);
         this.txtName1.Text        = XmlTool.GetText("Root/Name1");
         this.txtUrl.Text          = XmlTool.GetText("Root/Url");
         this.txtICP1.Text         = XmlTool.GetText("Root/ICP1");
         this.txtKeywords1.Text    = XmlTool.GetText("Root/Keywords1");
         this.txtDescription1.Text = XmlTool.GetText("Root/Description1");
         this.txtName2.Text        = XmlTool.GetText("Root/Name2");
         this.txtICP2.Text         = XmlTool.GetText("Root/ICP2");
         this.txtKeywords2.Text    = XmlTool.GetText("Root/Keywords2");
         this.txtDescription2.Text = XmlTool.GetText("Root/Description2");
         this.rblAllowReg.Items.FindByValue(XmlTool.GetText("Root/AllowReg")).Selected = true;
         this.rblCheckReg.Items.FindByValue(XmlTool.GetText("Root/CheckReg")).Selected = true;
         XmlTool.Dispose();
     }
 }
示例#9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //请勿使用Session和Cookies来判断权限
     Admin_Load("ok", "html");
     if (!(new JumboECMS.DAL.AdminDAL()).ChkAdminSign(q("adminid"), q("adminsign")))
     {
         Response.Write("验证信息有误");
         Response.End();
     }
     if (Request.Files.Count > 0)
     {
         HttpPostedFile oFile = Request.Files[0];//得到要上传文件
         if (oFile != null && oFile.ContentLength > 0)
         {
             if (!JumboECMS.Utils.FileValidation.IsSecureUploadPhoto(oFile))
             {
                 SaveVisitLog(2, 0);
                 Response.Write("不安全的图片格式,换一张吧。");
             }
             else
             {
                 try
                 {
                     string fileExtension = System.IO.Path.GetExtension(oFile.FileName).ToLower(); //上传文件的扩展名
                     string fileName      = System.IO.Path.GetFileName(oFile.FileName).ToLower();  //上传文件名
                     string strXmlFile    = HttpContext.Current.Server.MapPath("~/_data/config/upload_admin.config");
                     JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile);
                     this._sAdminUploadPath = XmlTool.GetText("Module/slide/path").Replace("<#SiteDir#>", site.Dir);
                     this._sAdminUploadType = XmlTool.GetText("Module/slide/type");
                     this._sAdminUploadSize = Str2Int(XmlTool.GetText("Module/slide/size"), 1024);
                     XmlTool.Dispose();
                     if (this._sAdminUploadType.ToLower().Contains("*.*") || this._sAdminUploadType.ToLower().Contains("*" + fileExtension + ";")) //检测是否为允许的上传文件类型
                     {
                         if (this._sAdminUploadSize * 1024 >= oFile.ContentLength)                                                                 //检测文件大小是否超过限制
                         {
                             string DirectoryPath;
                             DirectoryPath = this._sAdminUploadPath;
                             JumboECMS.Utils.DirFile.CreateDir(DirectoryPath);
                             string FullPath = DirectoryPath + fileName;//最终文件路径
                             oFile.SaveAs(Server.MapPath(FullPath));
                             if (JumboECMS.Utils.FileValidation.IsSecureUpfilePhoto(Server.MapPath(FullPath)))
                             {
                                 Response.Write("ok|" + FullPath.Replace("//", "/"));
                             }
                             else
                             {
                                 SaveVisitLog(2, 0);
                                 Response.Write("不安全的图片格式,换一张吧。");
                             }
                         }
                         else//文件大小超过限制
                         {
                             Response.Write("文件大小超过限制。");
                         }
                     }
                     else //文件类型不允许上传
                     {
                         Response.Write("文件类型不允许上传。");
                     }
                 }
                 catch
                 {
                     Response.Write("程序异常,上传未成功。");
                 }
             }
         }
         else
         {
             Response.Write("请选择上传文件。");
         }
     }
     else
     {
         Response.Write("上传有误。");
     }
 }
示例#10
0
        private IndexWriter CreateSearchIndex(string _type, bool _create)
        {
            string strXmlFile = Server.MapPath("~/_data/config/jcms(searchindex).config");

            JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile);
            string _lastid = XmlTool.GetText("Module/" + _type + "/lastid");

            XmlTool.Dispose();
            string      INDEX_STORE_PATH = Server.MapPath("~/_data/index/" + _type + "/"); //INDEX_STORE_PATH 为索引存储目录
            IndexWriter writer           = null;

            try
            {
                if (!_create)
                {
                    try
                    {
                        writer = new IndexWriter(INDEX_STORE_PATH, new StandardAnalyzer(), false);
                    }
                    catch (Exception)
                    {
                        writer = new IndexWriter(INDEX_STORE_PATH, new StandardAnalyzer(), true);
                    }
                }
                else
                {
                    writer  = new IndexWriter(INDEX_STORE_PATH, new StandardAnalyzer(), true);
                    _lastid = "0";
                }
                doh.Reset();
                doh.ConditionExpress = "[id]>" + _lastid;
                if (!doh.Exist("jcms_module_" + _type))
                {
                    return(null);
                }
                doh.Reset();
                doh.SqlCmd = "select Id,CategoryId,AddDate,Title,Summary,Tags,FirstPage from [jcms_module_" + _type + "] WHERE [Ispass]=1 AND [id]>" + _lastid;
                DataTable dtContent = doh.GetDataTable();
                //建立索引字段
                for (int j = 0; j < dtContent.Rows.Count; j++)
                {
                    string _url = dtContent.Rows[j]["FirstPage"].ToString();

                    Document doc   = new Document();
                    Field    field = new Field("id", dtContent.Rows[j]["Id"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED);//存储,不索引
                    doc.Add(field);
                    field = new Field("url", _url, Field.Store.YES, Field.Index.NO);
                    doc.Add(field);
                    field = new Field("tablename", _type, Field.Store.YES, Field.Index.TOKENIZED);                                    //存储,索引
                    doc.Add(field);
                    field = new Field("title", dtContent.Rows[j]["title"].ToString(), Field.Store.YES, Field.Index.TOKENIZED);        //存储,索引
                    doc.Add(field);
                    field = new Field("adddate", dtContent.Rows[j]["adddate"].ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED); //存储,不索引
                    doc.Add(field);
                    field = new Field("summary", dtContent.Rows[j]["Summary"].ToString(), Field.Store.YES, Field.Index.TOKENIZED);    //存储,索引
                    doc.Add(field);
                    field = new Field("tags", dtContent.Rows[j]["Tags"].ToString(), Field.Store.YES, Field.Index.TOKENIZED);          //存储,索引
                    doc.Add(field);
                    writer.AddDocument(doc);
                }
                dtContent.Clear();
                dtContent.Dispose();
                //writer.Optimize();不要写这句,否则为覆盖
                writer.Close();
            }
            catch (Exception)
            {
            }
            doh.Reset();
            doh.ConditionExpress = "[Ispass]=1 ORDER BY Id desc";
            int _maxid = JumboECMS.Utils.Validator.StrToInt(doh.GetField("jcms_module_" + _type, "Id").ToString(), 0);

            strXmlFile = Server.MapPath("~/_data/config/jcms(searchindex).config");
            XmlTool    = new JumboECMS.DBUtility.XmlControl(strXmlFile);
            XmlTool.Update("Module/" + _type + "/lastid", _maxid.ToString());
            XmlTool.Update("Module/" + _type + "/lasttime", System.DateTime.Now.ToString(), true);
            XmlTool.Save();
            XmlTool.Dispose();
            return(writer);
        }