Example #1
0
        public void LoadConfigInfo()
        {
            #region 加载配置信息
            string            configFile   = Server.MapPath("~/Config/general.config");
            GeneralConfigInfo __configinfo = new GeneralConfigInfo();
            if (File.Exists(configFile))
            {
                __configinfo = GeneralConfigs.Deserialize(configFile);
            }
            watermarktype.SelectedValue       = __configinfo.WaterMarkType.ToString();
            watermarkfontsize.Text            = __configinfo.WaterMarkFontSize.ToString();
            watermarktext.Text                = __configinfo.WaterMarkText.ToString();
            watermarkpic.Text                 = __configinfo.WaterMarkPic.ToString();
            watermarktransparency.Text        = __configinfo.WaterMarkTransparency.ToString();
            MaxWidthOfUploadedImgTextbox.Text = __configinfo.MaxWidthOfUploadedImg.ToString();
            CuttoMaxCheckBox.Checked          = __configinfo.CutToMaxWidthOfUploadedImg == 1;

            LoadPosition(__configinfo.WaterMarkStatus);

            LoadSystemFont();

            try
            {
                watermarkfontname.SelectedValue = __configinfo.WaterMarkFontName.ToString();
            }
            catch
            {
                watermarkfontname.SelectedIndex = 0;
            }

            #endregion
        }
Example #2
0
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
            attachrefcheck.SelectedValue     = __configinfo.Attachrefcheck.ToString();
            attachsave.SelectedValue         = __configinfo.Attachsave.ToString();
            attachimgpost.SelectedValue      = __configinfo.Attachimgpost.ToString();
            watermarktype.SelectedValue      = __configinfo.Watermarktype.ToString();
            showattachmentpath.SelectedValue = __configinfo.Showattachmentpath.ToString();
            attachimgmaxheight.Text          = __configinfo.Attachimgmaxheight.ToString();
            attachimgmaxwidth.Text           = __configinfo.Attachimgmaxwidth.ToString();
            attachimgquality.Text            = __configinfo.Attachimgquality.ToString();
            watermarkfontsize.Text           = __configinfo.Watermarkfontsize.ToString();
            watermarktext.Text         = __configinfo.Watermarktext.ToString();
            watermarkpic.Text          = __configinfo.Watermarkpic.ToString();
            watermarktransparency.Text = __configinfo.Watermarktransparency.ToString();

            LoadPosition(__configinfo.Watermarkstatus);

            LoadSystemFont();

            try
            {
                watermarkfontname.SelectedValue = __configinfo.Watermarkfontname.ToString();
            }
            catch
            {
                watermarkfontname.SelectedIndex = 0;
            }

            #endregion
        }
Example #3
0
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));

            regstatus.SelectedValue   = __configinfo.Regstatus.ToString();
            censoruser.Text           = __configinfo.Censoruser.ToString();
            doublee.SelectedValue     = __configinfo.Doublee.ToString();
            regverify.SelectedValue   = __configinfo.Regverify.ToString();
            accessemail.Text          = __configinfo.Accessemail.ToString();
            censoremail.Text          = __configinfo.Censoremail.ToString();
            hideprivate.SelectedValue = __configinfo.Hideprivate.ToString();
            ipdenyaccess.Text         = __configinfo.Ipdenyaccess.ToString();
            ipaccess.Text             = __configinfo.Ipaccess.ToString();
            regctrl.Text                 = __configinfo.Regctrl.ToString();
            ipregctrl.Text               = __configinfo.Ipregctrl.ToString();
            adminipaccess.Text           = __configinfo.Adminipaccess.ToString();
            welcomemsg.SelectedValue     = __configinfo.Welcomemsg.ToString();
            welcomemsgtxt.Text           = __configinfo.Welcomemsgtxt.ToString();
            rules.SelectedValue          = __configinfo.Rules.ToString();
            rulestxt.Text                = __configinfo.Rulestxt.ToString();
            newbiespan.Text              = __configinfo.Newbiespan.ToString();
            regadvance.SelectedValue     = __configinfo.Regadvance.ToString();
            realnamesystem.SelectedValue = __configinfo.Realnamesystem.ToString();

            #endregion
        }
Example #4
0
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
            forumtitle.Text        = __configinfo.Forumtitle.ToString();
            forumurl.Text          = __configinfo.Forumurl.ToString();
            webtitle.Text          = __configinfo.Webtitle.ToString();
            weburl.Text            = __configinfo.Weburl.ToString();
            licensed.SelectedValue = __configinfo.Licensed.ToString();
            icp.Text        = __configinfo.Icp.ToString();
            rssttl.Text     = __configinfo.Rssttl.ToString();
            sitemapttl.Text = __configinfo.Sitemapttl.ToString();
            nocacheheaders.SelectedValue = __configinfo.Nocacheheaders.ToString();
            debug.SelectedValue          = __configinfo.Debug.ToString();
            rssstatus.SelectedValue      = __configinfo.Rssstatus.ToString();
            sitemapstatus.SelectedValue  = __configinfo.Sitemapstatus.ToString();
            cachelog.SelectedValue       = "0";
            fulltextsearch.SelectedValue = __configinfo.Fulltextsearch.ToString();
            passwordmode.SelectedValue   = __configinfo.Passwordmode.ToString();
            bbcodemode.SelectedValue     = __configinfo.Bbcodemode.ToString();
            extname.Text = __configinfo.Extname.Trim();
            enablesilverlight.SelectedValue = __configinfo.Silverlight.ToString();
            CookieDomain.Text           = __configinfo.CookieDomain.ToString();
            memliststatus.SelectedValue = __configinfo.Memliststatus.ToString();
            Indexpage.SelectedIndex     = Convert.ToInt32(__configinfo.Indexpage.ToString());
            Linktext.Text             = __configinfo.Linktext;
            Statcode.Text             = __configinfo.Statcode;
            aspxrewrite.SelectedValue = __configinfo.Aspxrewrite.ToString();

            #endregion
        }
Example #5
0
 public void LoadConfigInfo()
 {
     #region 加载配置信息
     //加载验证码的显示
     string[] dllFiles = System.IO.Directory.GetFiles(HttpRuntime.BinDirectory, "Discuz.Plugin.VerifyImage.*.dll");
     foreach (string dllFile in dllFiles)
     {
         string filename = dllFile.ToString().Substring(dllFile.ToString().IndexOf("Discuz.Plugin.VerifyImage")).Replace("Discuz.Plugin.VerifyImage.", "").Replace(".dll", "");
         VerifyImage.Items.Add(filename);
     }
     GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
     maxonlines.Text   = __configinfo.Maxonlines.ToString();
     postinterval.Text = __configinfo.Postinterval.ToString();
     searchctrl.Text   = __configinfo.Searchctrl.ToString();
     maxspm.Text       = __configinfo.Maxspm.ToString();
     seccodestatus.AddAttributes("readonly", "");
     seccodestatus.Attributes.Add("onfocus", "this.className='';");
     seccodestatus.Attributes.Add("onblur", "this.className='';");
     admintools.SelectedValue = __configinfo.Admintools.ToString();
     VerifyImage.Items.Add(new ListItem("系统默认验证码", ""));
     seccodestatus.Text         = __configinfo.Seccodestatus.Replace(",", "\r\n");
     ViewState["Seccodestatus"] = __configinfo.Seccodestatus.ToString();
     VerifyImage.SelectedValue  = __configinfo.VerifyImageAssemly;
     try
     {
         secques.SelectedValue = __configinfo.Secques.ToString();
     }
     catch
     {
         secques.SelectedValue = "1";
     }
     #endregion
 }
Example #6
0
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));

            #endregion
        }
Example #7
0
        private void DeleteUserGroupInf_Click(object sender, EventArgs e)
        {
            #region  除相关组信息

            if (this.CheckCookie())
            {
                if (AdminUserGroups.DeleteUserGroupInfo(DNTRequest.GetInt("groupid", -1)))
                {
                    //删除举报组
                    GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
                    string            tempstr      = "";
                    foreach (string report in __configinfo.Reportusergroup.Split(','))
                    {
                        if (report != __usergroupinfo.Groupid.ToString())
                        {
                            if (tempstr == "")
                            {
                                tempstr = report;
                            }
                            else
                            {
                                tempstr += "," + report;
                            }
                        }
                    }
                    __configinfo.Reportusergroup = tempstr;
                    tempstr = "";
                    foreach (string photomangegroup in __configinfo.Photomangegroups.Split(','))
                    {
                        if (photomangegroup != __usergroupinfo.Groupid.ToString())
                        {
                            if (tempstr == "")
                            {
                                tempstr = photomangegroup;
                            }
                            else
                            {
                                tempstr += "," + photomangegroup;
                            }
                        }
                    }
                    __configinfo.Photomangegroups = tempstr;
                    GeneralConfigs.Serialiaze(__configinfo, AppDomain.CurrentDomain.BaseDirectory + "config/general.config");
                    Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/AdminGroupList");
                    AdminGroups.GetAdminGroupList();
                    AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除管理组", "组ID:" + DNTRequest.GetInt("groupid", -1));
                    base.RegisterStartupScript("PAGE", "window.location.href='global_adminusergroupgrid.aspx';");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_adminusergroupgrid.aspx';</script>");
                }
            }

            #endregion
        }
        public void SetGroupRights(string groupid)
        {
            #region 设置组权限相关信息
            UserGroupInfo __usergroupinfo = AdminUserGroups.AdminGetUserGroupInfo(Convert.ToInt32(groupid));

            creditshigher.Text     = __usergroupinfo.Creditshigher.ToString();
            creditslower.Text      = __usergroupinfo.Creditslower.ToString();
            stars.Text             = __usergroupinfo.Stars.ToString();
            color.Text             = __usergroupinfo.Color;
            groupavatar.Text       = __usergroupinfo.Groupavatar;
            readaccess.Text        = __usergroupinfo.Readaccess.ToString();
            maxprice.Text          = __usergroupinfo.Maxprice.ToString();
            maxpmnum.Text          = __usergroupinfo.Maxpmnum.ToString();
            maxsigsize.Text        = __usergroupinfo.Maxsigsize.ToString();
            maxattachsize.Text     = __usergroupinfo.Maxattachsize.ToString();
            maxsizeperday.Text     = __usergroupinfo.Maxsizeperday.ToString();
            radminid.SelectedValue = __usergroupinfo.Radminid.ToString();

            DataTable dt = DatabaseProvider.GetInstance().GetAttchType().Tables[0];
            attachextensions.AddTableData(dt, __usergroupinfo.Attachextensions.ToString());

            //设置用户权限组初始化信息
            usergrouppowersetting.Bind(__usergroupinfo);

            AdminGroupInfo __admingroupinfo = AdminUserGroups.AdminGetAdminGroupInfo(Convert.ToInt32(groupid));
            if (__admingroupinfo != null)
            {
                admingroupright.Items[0].Selected  = __admingroupinfo.Alloweditpost == 1;
                admingroupright.Items[1].Selected  = __admingroupinfo.Alloweditpoll == 1;
                admingroupright.Items[2].Selected  = __admingroupinfo.Allowdelpost == 1;
                admingroupright.Items[3].Selected  = __admingroupinfo.Allowmassprune == 1;
                admingroupright.Items[4].Selected  = __admingroupinfo.Allowviewip == 1;
                admingroupright.Items[5].Selected  = __admingroupinfo.Allowedituser == 1;
                admingroupright.Items[6].Selected  = __admingroupinfo.Allowviewlog == 1;
                admingroupright.Items[7].Selected  = __admingroupinfo.Disablepostctrl == 1;
                admingroupright.Items[8].Selected  = __admingroupinfo.Allowviewrealname == 1;
                admingroupright.Items[9].Selected  = __admingroupinfo.Allowbanuser == 1;
                admingroupright.Items[10].Selected = __admingroupinfo.Allowbanip == 1;
                GeneralConfigInfo configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
                admingroupright.Items[11].Selected = ("," + configinfo.Reportusergroup + ",").IndexOf("," + groupid + ",") != -1;  //是否允许接收举报信息
                admingroupright.Items[12].Selected = ("," + configinfo.Photomangegroups + ",").IndexOf("," + groupid + ",") != -1; //是否允许管理图片评论
            }

            if (radminid.SelectedValue == "1")
            {
                allowstickthread.Enabled       = false;
                allowstickthread.SelectedValue = "3";
            }
            else
            {
                allowstickthread.Enabled = true;
            }


            #endregion
        }
        private void OpenMall(int fid)
        {
            GeneralConfigInfo configInfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));

            if (fid != 0 && configInfo.Enablemall == 0)
            {
                configInfo.Enablemall = 1;
                GeneralConfigs.Serialiaze(configInfo, Server.MapPath("../../config/general.config"));
            }
        }
Example #10
0
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
            EnableMall.SelectedValue = __configinfo.Enablemall.ToString();
            gpp.Text = __configinfo.Gpp.ToString();

            #endregion
        }
Example #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
         for (int i = 1; i <= __configinfo.Ppp; i++)
         {
             inpostfloor.Items.Add(new ListItem(" >#" + i, i.ToString()));
         }
     }
 }
Example #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
                forumtitle.Text = __configinfo.Forumtitle.ToString();
                forumurl.Text   = __configinfo.Forumurl.ToString();
                webtitle.Text   = __configinfo.Webtitle.ToString();
                weburl.Text     = __configinfo.Weburl.ToString().ToLower();

                SetOption(__configinfo);
            }
        }
Example #13
0
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
            visitbanperiods.Text  = __configinfo.Visitbanperiods.ToString();
            postbanperiods.Text   = __configinfo.Postbanperiods.ToString();
            postmodperiods.Text   = __configinfo.Postmodperiods.ToString();
            searchbanperiods.Text = __configinfo.Searchbanperiods.ToString();
            attachbanperiods.Text = __configinfo.Attachbanperiods.ToString();

            #endregion
        }
Example #14
0
        /// <summary>
        /// 移动论坛版块
        /// </summary>
        /// <param name="currentfid">当前论坛版块id</param>
        /// <param name="targetfid">目标论坛版块id</param>
        /// <param name="isaschildnode">是否作为子论坛移动</param>
        /// <returns></returns>
        public static bool MovingForumsPos(string currentfid, string targetfid, bool isaschildnode)
        {
            string extname = GeneralConfigs.Deserialize(AppDomain.CurrentDomain.BaseDirectory + "/config/general.config").Extname;

            DatabaseProvider.GetInstance().MovingForumsPos(currentfid, targetfid, isaschildnode, extname);
            AdminForums.SetForumslayer();
            AdminForums.SetForumsSubForumCountAndDispalyorder();
            AdminForums.SetForumsPathList();

            Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/UI/ForumListBoxOptions");
            Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/ForumList");

            return(true);
        }
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(AppDomain.CurrentDomain.BaseDirectory + "config/general.config");
            seotitle.Text                = __configinfo.Seotitle.ToString();
            seokeywords.Text             = __configinfo.Seokeywords.ToString();
            seodescription.Text          = __configinfo.Seodescription.ToString();
            seohead.Text                 = __configinfo.Seohead.ToString();
            archiverstatus.SelectedValue = __configinfo.Archiverstatus.ToString();


            #endregion
        }
Example #16
0
        /// <summary>
        /// 移动论坛版块
        /// </summary>
        /// <param name="currentfid">当前论坛版块id</param>
        /// <param name="targetfid">目标论坛版块id</param>
        /// <param name="isaschildnode">是否作为子论坛移动</param>
        /// <returns></returns>
        public static bool MovingForumsPos(string currentfid, string targetfid, bool isaschildnode)
        {
            string extname = GeneralConfigs.Deserialize(Utils.GetMapPath(BaseConfigs.GetForumPath + "config/general.config")).Extname;

            Discuz.Data.Forums.MovingForumsPos(currentfid, targetfid, isaschildnode, extname);
            AdminForums.SetForumslayer();
            AdminForums.SetForumsSubForumCountAndDispalyorder();
            AdminForums.SetForumsPathList();

            Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UI/ForumListBoxOptions");
            Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/ForumList");

            return(true);
        }
Example #17
0
 /// <summary>
 /// 配置文件反序列化检测
 /// </summary>
 /// <returns></returns>
 private static bool SerialiazeTest()
 {
     try
     {
         string            configPath   = HttpContext.Current.Server.MapPath("../config/general.config");
         GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(configPath);
         __configinfo.Passwordkey = ForumUtils.CreateAuthStr(10);
         SerializationHelper.Save(__configinfo, configPath);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #18
0
        private void SaveInfo_Click(object sender, EventArgs e)
        {
            #region 保存设置信息

            if (this.CheckCookie())
            {
                GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
                ;

                GeneralConfigs.Serialiaze(__configinfo, Server.MapPath("../../config/general.config"));

                AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "用户权限设置", "");
                base.RegisterStartupScript("PAGE", "window.location.href='global_userrights.aspx';");
            }

            #endregion
        }
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            templateid.Attributes.Add("onchange", "LoadImage(this.selectedIndex)");
            GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
            templateid.SelectedValue           = __configinfo.Templateid.ToString();
            stylejump.SelectedValue            = __configinfo.Stylejump.ToString();
            browsecreatetemplate.SelectedValue = __configinfo.BrowseCreateTemplate.ToString();
            templateid.AddTableData(DatabaseProvider.GetInstance().GetTemplates(), __configinfo.Templateid.ToString());
            templateid.Items.RemoveAt(0);
            string scriptstr = "<script type=\"text/javascript\">\r\n";
            scriptstr += "images = new Array();\r\n";
            for (int i = 0; i < templateid.Items.Count; i++)
            {
                scriptstr += "images[" + i + "]=\"../../templates/" + templateid.Items[i].Text + "/about.png\";\r\n";
            }
            scriptstr += "</script>";
            base.RegisterStartupScript("", scriptstr);
            preview.Src = "../../templates/" + templateid.SelectedItem.Text + "/about.png";
            isframeshow.SelectedValue      = __configinfo.Isframeshow.ToString();
            whosonlinestatus.SelectedValue = __configinfo.Whosonlinestatus.ToString();
            maxonlinelist.Text             = __configinfo.Maxonlinelist.ToString();
            forumjump.SelectedValue        = __configinfo.Forumjump.ToString();
            if (__configinfo.Onlinetimeout >= 0)
            {
                showauthorstatusinpost.SelectedValue = "2";
            }
            else
            {
                showauthorstatusinpost.SelectedValue = "1";
            }
            onlinetimeout.Text           = Math.Abs(__configinfo.Onlinetimeout).ToString();
            smileyinsert.SelectedValue   = __configinfo.Smileyinsert.ToString();
            visitedforums.Text           = __configinfo.Visitedforums.ToString();
            moddisplay.SelectedValue     = __configinfo.Moddisplay.ToString();
            showsignatures.SelectedValue = __configinfo.Showsignatures.ToString();
            showavatars.SelectedValue    = __configinfo.Showavatars.ToString();
            showimages.SelectedValue     = __configinfo.Showimages.ToString();
            maxsigrows.Text                 = __configinfo.Maxsigrows.ToString();
            smiliesmax.Text                 = __configinfo.Smiliesmax.ToString();
            viewnewtopicminute.Text         = __configinfo.Viewnewtopicminute.ToString();
            whosonlinecontact.SelectedValue = __configinfo.Whosonlinecontract.ToString();
            #endregion
        }
Example #20
0
        private void SaveInfo_Click(object sender, EventArgs e)
        {
            #region 保存设置信息

            if (this.CheckCookie())
            {
                GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));

                __configinfo.Enablemall = Convert.ToInt16(EnableMall.SelectedValue);
                __configinfo.Gpp        = Convert.ToInt16(gpp.Text);

                GeneralConfigs.Serialiaze(__configinfo, Server.MapPath("../../config/general.config"));

                base.RegisterStartupScript("PAGE", "window.location.href='mall_mallsetting.aspx';");
            }

            #endregion
        }
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));

            dupkarmarate.SelectedValue = __configinfo.Dupkarmarate.ToString();
            minpostsize.Text           = __configinfo.Minpostsize.ToString();
            maxpostsize.Text           = __configinfo.Maxpostsize.ToString();
            maxfavorites.Text          = __configinfo.Maxfavorites.ToString();
            maxavatarsize.Text         = __configinfo.Maxavatarsize.ToString();
            maxavatarwidth.Text        = __configinfo.Maxavatarwidth.ToString();
            maxavatarheight.Text       = __configinfo.Maxavatarheight.ToString();
            maxpolloptions.Text        = __configinfo.Maxpolloptions.ToString();
            maxattachments.Text        = __configinfo.Maxattachments.ToString();
            karmaratelimit.Text        = __configinfo.Karmaratelimit.ToString();
            moderactions.SelectedValue = __configinfo.Moderactions.ToString();
            #endregion
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         LoadConfigInfo();
         LoadUserGroup();
         GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
         foreach (string groupid in __configinfo.Htmltitleusergroup.Split(','))
         {
             for (int i = 0; i < UserGroup.Items.Count; i++)
             {
                 if (UserGroup.Items[i].Value == groupid)
                 {
                     UserGroup.Items[i].Selected = true;
                     break;
                 }
             }
         }
     }
 }
Example #23
0
        private static bool serializeTest()
        {
            try
            {
                string            configPath   = HttpContext.Current.Server.MapPath("/config/general.config");
                GeneralConfigInfo __configinfo = new GeneralConfigInfo();
                if (!File.Exists(configPath))
                {
                    GeneralConfigs.Serialize(__configinfo, configPath);
                }
                __configinfo = GeneralConfigs.Deserialize(configPath);
                GeneralConfigs.Serialize(__configinfo, configPath);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Example #24
0
        /// <summary>
        /// 初始化需要传递给编辑器的文件存放路径
        /// </summary>
        void InitEditorParameter()
        {
            Session["ARTICLEDETAIL_CHANNELFILEPATH"] = ThisArticle.AttachmentUrlPath;
            Session["WorkPlace"] = "articleedit";

            string path = Server.MapPath("~/Config/general.config");

            if (!File.Exists(path))
            {
                ArticleHelper.Write(path);
                //记录日志
                string content = string.Format("创建了内容模型文件“{0}”", "general.config");
                AddLog("创建内容模型文件", content);
            }
            GeneralConfigInfo config = GeneralConfigs.Deserialize(We7Utils.GetMapPath("~/Config/general.config"));

            if (config.CutToMaxWidthOfUploadedImg == 1)
            {
                Session["GENERALCONFIGINFO_CMAXWIDTHOFUPLOADEDIMG"] = config.MaxWidthOfUploadedImg;
            }
        }
Example #25
0
        private void SaveInfo_Click(object sender, EventArgs e)
        {
            #region 保存设置信息

            if (this.CheckCookie())
            {
                Hashtable HT = new Hashtable();
                HT.Add("最大在线人数", maxonlines.Text);
                HT.Add("发帖灌水预防", postinterval.Text);
                HT.Add("搜索时间限制", searchctrl.Text);
                HT.Add("60 秒最大搜索次数", maxspm.Text);
                foreach (DictionaryEntry de in HT)
                {
                    if (!Utils.IsInt(de.Value.ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('输入错误:" + de.Key.ToString().Trim() + ",只能是0或者正整数');window.location.href='global_safecontrol.aspx';</script>");
                        return;
                    }
                }


                GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
                __configinfo.VerifyImageAssemly = VerifyImage.SelectedValue;
                __configinfo.Maxonlines         = Convert.ToInt32(maxonlines.Text);
                __configinfo.Postinterval       = Convert.ToInt32(postinterval.Text);
                __configinfo.Searchctrl         = Convert.ToInt32(searchctrl.Text);
                __configinfo.Seccodestatus      = seccodestatus.Text.Trim().Replace("\r\n", ",");
                __configinfo.Maxspm             = Convert.ToInt32(maxspm.Text);
                __configinfo.Secques            = Convert.ToInt32(secques.SelectedValue);
                __configinfo.Admintools         = Convert.ToInt16(admintools.SelectedValue);
                GeneralConfigs.Serialiaze(__configinfo, Server.MapPath("../../config/general.config"));

                AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "安全控制设置", "");
                base.RegisterStartupScript("PAGE", "window.location.href='global_safecontrol.aspx';");
            }

            #endregion
        }
        private void SaveInfo_Click(object sender, EventArgs e)
        {
            #region 保存设置信息

            if (this.CheckCookie())
            {
                GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(AppDomain.CurrentDomain.BaseDirectory + "config/general.config");

                __configinfo.Seotitle       = seotitle.Text;
                __configinfo.Seokeywords    = seokeywords.Text;
                __configinfo.Seodescription = seodescription.Text;
                __configinfo.Seohead        = seohead.Text;
                __configinfo.Archiverstatus = Convert.ToInt16(archiverstatus.SelectedValue);

                GeneralConfigs.Serialiaze(__configinfo, AppDomain.CurrentDomain.BaseDirectory + "config/general.config");

                AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "搜索引擎优化设置", "");

                base.RegisterStartupScript("PAGE", "window.location.href='global_searchengine.aspx';");
            }

            #endregion
        }
Example #27
0
        private void SaveInfo_Click(object sender, EventArgs e)
        {
            #region 保存设置信息
            string[][] inputrule = new string[2][];
            inputrule[0] = new string[] { losslessdel.Text, edittimelimit.Text, tpp.Text, ppp.Text, starthreshold.Text, hottopic.Text,
                                          guestcachepagetimeout.Text, disablepostadregminute.Text, disablepostadpostcount.Text };
            inputrule[1] = new string[] { "删帖不减金币时间", "编辑帖子时间", "每页主题数", "每页主题数", "星星升级阀值", "热门话题最低帖数",
                                          "缓存游客页面的失效时间", "新用户广告强力屏蔽注册分钟数", "新用户广告强力屏蔽发帖数" };
            for (int j = 0; j < inputrule[0].Length; j++)
            {
                if (!Utils.IsInt(inputrule[0][j].ToString()))
                {
                    base.RegisterStartupScript("", "<script>alert('输入错误:" + inputrule[1][j].ToString() + ",只能是0或者正整数');window.location.href='forum_option.aspx';</script>");
                    return;
                }
            }
            if (Convert.ToInt32(losslessdel.Text) > 9999 || Convert.ToInt32(losslessdel.Text) < 0)
            {
                base.RegisterStartupScript("", "<script>alert('删帖不减金币时间期限只能在0-9999之间');window.location.href='forum_option.aspx';</script>");
                return;
            }

            if (Convert.ToInt32(edittimelimit.Text) > 9999 || Convert.ToInt32(edittimelimit.Text) < 0)
            {
                base.RegisterStartupScript("", "<script>alert('编辑帖子时间限制只能在0-9999之间');window.location.href='forum_option.aspx';</script>");
                return;
            }

            if (Convert.ToInt16(tpp.Text) > 100 || Convert.ToInt16(tpp.Text) <= 0)
            {
                base.RegisterStartupScript("", "<script>alert('每页主题数只能在1-100之间');window.location.href='forum_option.aspx';</script>");
                return;
            }

            if (Convert.ToInt16(ppp.Text) > 100 || Convert.ToInt16(ppp.Text) <= 0)
            {
                base.RegisterStartupScript("", "<script>alert('每页帖子数只能在1-100之间');window.location.href='forum_option.aspx';</script>");
                return;
            }
            if (Convert.ToInt16(starthreshold.Text) > 9999 || Convert.ToInt16(starthreshold.Text) < 0)
            {
                base.RegisterStartupScript("", "<script>alert('星星升级阀值只能在0-9999之间');window.location.href='forum_option.aspx';</script>");
                return;
            }

            if (Convert.ToInt16(hottopic.Text) > 9999 || Convert.ToInt16(hottopic.Text) < 0)
            {
                base.RegisterStartupScript("", "<script>alert('热门话题最低帖数只能在0-9999之间');window.location.href='forum_option.aspx';</script>");
                return;
            }

            if (Convert.ToInt16(hottagcount.Text) > 60 || Convert.ToInt16(hottagcount.Text) < 0)
            {
                base.RegisterStartupScript("", "<script>alert('首页热门标签(Tag)数量只能在0-60之间');window.location.href='forum_option.aspx';</script>");
            }

            if (!ValidateRatevalveset(ratevalveset1.Text))
            {
                return;
            }
            if (!ValidateRatevalveset(ratevalveset2.Text))
            {
                return;
            }
            if (!ValidateRatevalveset(ratevalveset3.Text))
            {
                return;
            }
            if (!ValidateRatevalveset(ratevalveset4.Text))
            {
                return;
            }
            if (!ValidateRatevalveset(ratevalveset5.Text))
            {
                return;
            }
            if (!(Convert.ToInt16(ratevalveset1.Text) < Convert.ToInt16(ratevalveset2.Text) &&
                  Convert.ToInt16(ratevalveset2.Text) < Convert.ToInt16(ratevalveset3.Text) &&
                  Convert.ToInt16(ratevalveset3.Text) < Convert.ToInt16(ratevalveset4.Text) &&
                  Convert.ToInt16(ratevalveset4.Text) < Convert.ToInt16(ratevalveset5.Text)))
            {
                base.RegisterStartupScript("", "<script>alert('评分阀值不是递增取值');window.location.href='forum_option.aspx';</script>");
                return;
            }
            if (disablepostad.SelectedValue == "1" && disablepostadregular.Text == "")
            {
                base.RegisterStartupScript("", "<script>alert('新用户广告强力屏蔽正则表达式为空');window.location.href='forum_option.aspx';</script>");
                return;
            }
            if (this.CheckCookie())
            {
                GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
                __configinfo.Fullmytopics  = Convert.ToInt16(fullmytopics.SelectedValue);
                __configinfo.Modworkstatus = Convert.ToInt16(modworkstatus.SelectedValue);
                __configinfo.Userstatusby  = Convert.ToInt16(userstatusby.SelectedValue);
                if (Topicqueuestats_1.Checked == true)
                {
                    __configinfo.TopicQueueStats = 1;
                }
                else
                {
                    __configinfo.TopicQueueStats = 0;
                }
                __configinfo.TopicQueueStatsCount  = Convert.ToInt32(topicqueuestatscount.Text);
                __configinfo.Guestcachepagetimeout = Convert.ToInt16(guestcachepagetimeout.Text);
                __configinfo.Topiccachemark        = Convert.ToInt16(topiccachemark.Text);
                __configinfo.Losslessdel           = Convert.ToInt16(losslessdel.Text);
                __configinfo.Edittimelimit         = Convert.ToInt16(edittimelimit.Text);
                __configinfo.Editedby          = Convert.ToInt16(editedby.SelectedValue);
                __configinfo.Defaulteditormode = Convert.ToInt16(defaulteditormode.SelectedValue);
                __configinfo.Allowswitcheditor = Convert.ToInt16(allowswitcheditor.SelectedValue);
                __configinfo.Reasonpm          = Convert.ToInt16(reasonpm.SelectedValue);
                __configinfo.Hottopic          = Convert.ToInt16(hottopic.Text);
                __configinfo.Starthreshold     = Convert.ToInt16(starthreshold.Text);
                __configinfo.Fastpost          = Convert.ToInt16(fastpost.SelectedValue);
                __configinfo.Tpp            = Convert.ToInt16(tpp.Text);
                __configinfo.Ppp            = Convert.ToInt16(ppp.Text);
                __configinfo.Htmltitle      = Convert.ToInt32(allowhtmltitle.SelectedValue);
                __configinfo.Enabletag      = Convert.ToInt32(enabletag.SelectedValue);
                __configinfo.Ratevalveset   = ratevalveset1.Text + "," + ratevalveset2.Text + "," + ratevalveset3.Text + "," + ratevalveset4.Text + "," + ratevalveset5.Text;
                __configinfo.Statstatus     = Convert.ToInt16(statstatus.SelectedValue);
                __configinfo.Statscachelife = Convert.ToInt16(statscachelife.Text);
                //__configinfo.Pvfrequence = Convert.ToInt16(pvfrequence.Text);
                __configinfo.Hottagcount            = Convert.ToInt16(hottagcount.Text);
                __configinfo.Oltimespan             = Convert.ToInt16(oltimespan.Text);
                __configinfo.Maxmodworksmonths      = Convert.ToInt16(maxmodworksmonths.Text);
                __configinfo.Disablepostad          = Convert.ToInt16(disablepostad.SelectedValue);
                __configinfo.Disablepostadregminute = Convert.ToInt16(disablepostadregminute.Text);
                __configinfo.Disablepostadpostcount = Convert.ToInt16(disablepostadpostcount.Text);
                __configinfo.Disablepostadregular   = disablepostadregular.Text;

                GeneralConfigs.Serialiaze(__configinfo, Server.MapPath("../../config/general.config"));
                TopicStats.SetQueueCount();
                AdminCaches.ReSetConfig();
                AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "论坛功能常规选项设置", "");
                base.RegisterStartupScript("PAGE", "window.location.href='forum_option.aspx';");
            }
            #endregion
        }
Example #28
0
        private void SaveUserInfo_Click(object sender, EventArgs e)
        {
            #region 保存用户信息

            if (this.CheckCookie())
            {
                int    uid       = DNTRequest.GetInt("uid", -1);
                string errorInfo = "";

                if (!AllowEditUserInfo(uid, true))
                {
                    return;
                }

                if (userName.Text != ViewState["username"].ToString())
                {
                    if (AdminUsers.GetUserID(userName.Text) != -1)
                    {
                        base.RegisterStartupScript("", "<script>alert('您所输入的用户名已被使用过, 请输入其他的用户名!');</script>");
                        return;
                    }
                }

                if (userName.Text == "")
                {
                    base.RegisterStartupScript("", "<script>alert('用户名不能为空!');</script>");
                    return;
                }

                if (groupid.SelectedValue == "0")
                {
                    base.RegisterStartupScript("", "<script>alert('您未选中任何用户组!');</script>");
                    return;
                }

                __userinfo             = AdminUsers.GetUserInfo(uid);
                __userinfo.Username    = userName.Text;
                __userinfo.Nickname    = nickname.Text;
                __userinfo.Accessmasks = Convert.ToInt32(accessmasks.SelectedValue);

                //当用户组发生变化时则相应更新用户的管理组字段
                if (__userinfo.Groupid.ToString() != groupid.SelectedValue)
                {
                    __userinfo.Adminid = DatabaseProvider.GetInstance().GetRadminidByGroupid(int.Parse(groupid.SelectedValue));
                }

                __userinfo.Avatarshowid = 0;

                if ((bday.Text == "0000-00-00") || (bday.Text == "0000-0-0") | (bday.Text.Trim() == ""))
                {
                    __userinfo.Bday = "";
                }
                else
                {
                    if (!Utils.IsDateString(bday.Text.Trim()))
                    {
                        base.RegisterStartupScript("", "<script>alert('用户生日不是有效的日期型数据!');</script>");
                        return;
                    }
                    else
                    {
                        __userinfo.Bday = bday.Text;
                    }
                }

                if (Utils.IsNumeric(credits.Text.Replace("-", "")))
                {
                    __userinfo.Credits = Convert.ToInt32(credits.Text);
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('用户的金币不能为空或大于9位 !');</script>");
                    return;
                }

                GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
                if (__configinfo.Doublee == 0)
                {
                    int currentuid = AdminUsers.FindUserEmail(email.Text);
                    if ((currentuid != -1) && (currentuid != uid))
                    {
                        base.RegisterStartupScript("", "<script>alert('当前用户的邮箱地址已被使用过, 请输入其他的邮箱!');</script>");
                        return;
                    }
                }

                __userinfo.Email       = email.Text;
                __userinfo.Gender      = Convert.ToInt32(gender.SelectedValue);
                __userinfo.Groupexpiry = Convert.ToInt32(groupexpiry.Text);
                __userinfo.Extgroupids = extgroupids.GetSelectString(",");

                if ((groupid.SelectedValue != "1") && (__userinfo.Uid == 1))
                {
                    base.RegisterStartupScript("", "<script>alert('初始化系统管理员的所属用户组设置不能修改为其它组!');window.location.href='global_edituser.aspx?uid=" + DNTRequest.GetString("uid") + "';</script>");
                    return;
                }

                __userinfo.Groupid      = Convert.ToInt32(groupid.SelectedValue);
                __userinfo.Invisible    = Convert.ToInt32(invisible.SelectedValue);
                __userinfo.Joindate     = joindate.Text;
                __userinfo.Lastactivity = lastactivity.Text;
                __userinfo.Lastip       = lastip.Text;
                __userinfo.Lastpost     = lastpost.Text;
                __userinfo.Lastvisit    = lastvisit.Text;
                __userinfo.Newpm        = Convert.ToInt32(newpm.SelectedValue);
                __userinfo.Newsletter   = (ReceivePMSettingType)GetNewsLetter();
                __userinfo.Oltime       = Convert.ToInt32(oltime.Text);
                __userinfo.Pageviews    = Convert.ToInt32(pageviews.Text);
                __userinfo.Pmsound      = Convert.ToInt32(pmsound.Text);
                __userinfo.Posts        = Convert.ToInt32(posts.Text);
                __userinfo.Ppp          = Convert.ToInt32(ppp.Text);
                __userinfo.Regip        = regip.Text;
                __userinfo.Digestposts  = Convert.ToInt32(digestposts.Text);

                if (secques.SelectedValue == "1")
                {
                    __userinfo.Secques = "";                               //清空安全码
                }
                __userinfo.Showemail  = Convert.ToInt32(showemail.SelectedValue);
                __userinfo.Sigstatus  = Convert.ToInt32(sigstatus.SelectedValue);
                __userinfo.Templateid = Convert.ToInt32(templateid.SelectedValue);
                __userinfo.Tpp        = Convert.ToInt32(tpp.Text);


                if (Utils.IsNumeric(extcredits1.Text.Replace("-", "")))
                {
                    __userinfo.Extcredits1 = float.Parse(extcredits1.Text);
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('用户扩展金币不能为空或大于7位 !');</script>");
                    return;
                }

                if (Utils.IsNumeric(extcredits2.Text.Replace("-", "")))
                {
                    __userinfo.Extcredits2 = float.Parse(extcredits2.Text);
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('用户扩展金币不能为空或大于7位 !');</script>");
                    return;
                }

                if (Utils.IsNumeric(extcredits3.Text.Replace("-", "")))
                {
                    __userinfo.Extcredits3 = float.Parse(extcredits3.Text);
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('用户扩展金币不能为空或大于7位 !');</script>");
                    return;
                }

                if (Utils.IsNumeric(extcredits4.Text.Replace("-", "")))
                {
                    __userinfo.Extcredits4 = float.Parse(extcredits4.Text);
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('用户扩展金币不能为空或大于7位 !');</script>");
                    return;
                }

                if (Utils.IsNumeric(extcredits5.Text.Replace("-", "")))
                {
                    __userinfo.Extcredits5 = float.Parse(extcredits5.Text);
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('用户扩展金币不能为空或大于7位 !');</script>");
                    return;
                }

                if (Utils.IsNumeric(extcredits6.Text.Replace("-", "")))
                {
                    __userinfo.Extcredits6 = float.Parse(extcredits6.Text);
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('用户扩展金币不能为空或大于7位 !');</script>");
                    return;
                }

                if (Utils.IsNumeric(extcredits7.Text.Replace("-", "")))
                {
                    __userinfo.Extcredits7 = float.Parse(extcredits7.Text);
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('用户扩展金币不能为空或大于7位 !');</script>");
                    return;
                }

                if (Utils.IsNumeric(extcredits8.Text.Replace("-", "")))
                {
                    __userinfo.Extcredits8 = float.Parse(extcredits8.Text);
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('用户扩展金币不能为空或大于7位 !');</script>");
                    return;
                }


                //用户扩展信息
                __userinfo.Website      = website.Text;
                __userinfo.Icq          = icq.Text;
                __userinfo.Qq           = qq.Text;
                __userinfo.Yahoo        = yahoo.Text;
                __userinfo.Msn          = msn.Text;
                __userinfo.Skype        = skype.Text;
                __userinfo.Location     = location.Text;
                __userinfo.Customstatus = customstatus.Text;
                __userinfo.Avatar       = avatar.Text;
                __userinfo.Avatarheight = Convert.ToInt32(avatarheight.Text);
                __userinfo.Avatarwidth  = Convert.ToInt32(avatarwidth.Text);
                __userinfo.Bio          = bio.Text;
                if (signature.Text.Length > UserGroups.GetUserGroupInfo(__userinfo.Groupid).Maxsigsize)
                {
                    errorInfo = "更新的签名长度超过 " + UserGroups.GetUserGroupInfo(__userinfo.Groupid).Maxsigsize + " 字符的限制,未能更新。";
                }
                else
                {
                    __userinfo.Signature = signature.Text;
                    //签名UBB转换HTML
                    PostpramsInfo _postpramsinfo = new PostpramsInfo();
                    _postpramsinfo.Showimages = UserGroups.GetUserGroupInfo(__userinfo.Groupid).Allowsigimgcode;
                    _postpramsinfo.Sdetail    = signature.Text;
                    __userinfo.Sightml        = UBB.UBBToHTML(_postpramsinfo);
                }

                __userinfo.Realname = realname.Text;
                __userinfo.Idcard   = idcard.Text;
                __userinfo.Mobile   = mobile.Text;
                __userinfo.Phone    = phone.Text;
                __userinfo.Medals   = DNTRequest.GetString("medalid");

                if (IsEditUserName.Checked)
                {
                    AdminUsers.UserNameChange(__userinfo, ViewState["username"].ToString());
                }

                if (AdminUsers.UpdateUserAllInfo(__userinfo))
                {
                    if (userName.Text != ViewState["username"].ToString())
                    {
                        AdminUsers.UserNameChange(__userinfo, ViewState["username"].ToString());
                    }
                    AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台编辑用户", "用户名:" + userName.Text);
                    if (errorInfo == "")
                    {
                        base.RegisterStartupScript("PAGE", "window.location.href='global_usergrid.aspx?condition=" + DNTRequest.GetString("condition") + "';");
                    }
                    else
                    {
                        base.RegisterStartupScript("PAGE", "alert('" + errorInfo + "');window.location.href='global_usergrid.aspx?condition=" + DNTRequest.GetString("condition") + "';");
                    }
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergrid.aspx?condition=" + DNTRequest.GetString("condition") + "';</script>");
                }
            }

            #endregion
        }
Example #29
0
        /// <summary>
        /// 向广告页面传递所需参数
        /// </summary>
        protected void TransferParameterToAD()
        {
            //获取当前系统参数
            //SystemInformation si = CDHelper.GetSystemInformation();
            SiteConfigInfo si    = SiteConfigs.GetConfig();
            string         adUrl = "";

            if (si.ADUrl != null && si.ADUrl != "")
            {
                adUrl = "http://" + si.ADUrl;
            }
            else
            {
                adUrl = "http://" + Request.Url.Host + ":" + Request.Url.Port.ToString() + "/Plugins/ADPlugin/UI/";
            }
            SiteIDText.Text = si.SiteID;
            string rootRrl = "";

            if (si.RootUrl != null && si.RootUrl != "")
            {
                rootRrl = si.RootUrl;
            }
            else
            {
                rootRrl = "http://" + Request.Url.Host + ":" + Request.Url.Port.ToString();
            }
            if (!rootRrl.EndsWith("/"))
            {
                rootRrl = rootRrl + "/";
            }
            SiteUrlTextBox.Text  = rootRrl;
            SiteNameText.Text    = si.CompanyName;
            AccountIDText.Text   = AccountID;
            AccountNameText.Text = AccountHelper.GetAccount(AccountID, new string[] { "LoginName" }).LoginName;

            ADObjectText.Text = ADObjectName;
            if (!adUrl.EndsWith("/"))
            {
                adUrl = adUrl + "/";
            }
            ADUrlText.Text = adUrl;

            //为了跨域问题,将此处理转至后台
            //Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>DataReadyAndSend();</script>");

            string aid   = AccountID.Substring(1, AccountID.Length - 2);
            string sid   = si.SiteID;
            string sname = si.CompanyName;
            string surl  = rootRrl;

            //此方法用于站群广告过滤,如果是总站值为1不过滤,看到所有的广告,分站值为0,值看到自己的广告
            string path = Server.MapPath("~/Config/general.config");

            if (!File.Exists(path))
            {
                ArticleHelper.Write(path);
            }
            GeneralConfigInfo config   = GeneralConfigs.Deserialize(We7Utils.GetMapPath("~/Config/general.config"));
            string            adVisble = config.ADVisbleToSite.ToString();

            //向请求页面发送数据
            //Encoding myEncoding = Encoding.GetEncoding("UTF-8");
            string address = adUrl + "CertificationResponse.aspx?AID=" + aid + "&SID="
                             + sid + "&SNAME=" + Server.UrlEncode(sname) + "&SURL=" + surl + "&ADObject=" + ADObjectName + "&ADVisble=" + adVisble;

            //HttpWebRequest req = WebRequest.Create(address) as HttpWebRequest;
            //req.Headers.Add("P3P", "CP=CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR");
            //req.CookieContainer = new CookieContainer();
            //req.Method = "GET";

            //读取请求结果,检查Cookie是否创建成功
            //using (HttpWebResponse res = (HttpWebResponse)req.GetResponse())
            //{ }
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>RedirectToAD('" + address + "');</script>");

            //string returnUrl = "";
            //switch (ADObjectName)
            //{
            //    case "ADRes":
            //        returnUrl = adUrl + "ADResource/ADResourceManage.aspx";
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "AID", aid);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SID", sid);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SNAME", sname);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SURL", surl);
            //        break;

            //    case "ADZone":
            //        returnUrl = adUrl + "ADZones/ADZoneManage.aspx";
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "AID", aid);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SID", sid);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SNAME", sname);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SURL", surl);
            //        break;

            //    case "ADPublish":
            //        returnUrl = adUrl + "ADPublishes/ADPublishManage.aspx";
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "AID", aid);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SID", sid);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SNAME", sname);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SURL", surl);
            //        break;

            //    case "ADSetting":
            //        returnUrl = adUrl + "ADSetting.aspx";
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "AID", aid);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SID", sid);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SNAME", sname);
            //        returnUrl = Helper.AddParamToUrl(returnUrl, "SURL", surl);
            //        break;

            //    default:
            //        break;
            //}

            //Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>RedirectToAD('" + returnUrl + "');</script>");
        }
Example #30
0
        public void LoadConfigInfo()
        {
            #region 加载配置信息

            GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
            fullmytopics.SelectedValue  = __configinfo.Fullmytopics.ToString();
            modworkstatus.SelectedValue = __configinfo.Modworkstatus.ToString();
            userstatusby.SelectedValue  = (__configinfo.Userstatusby.ToString() != "0") ? "1" : "0";
            guestcachepagetimeout.Text  = __configinfo.Guestcachepagetimeout.ToString();
            topiccachemark.Text         = __configinfo.Topiccachemark.ToString();

            if (__configinfo.TopicQueueStats == 1)
            {
                Topicqueuestats_1.Checked = true;
                Topicqueuestats_0.Checked = false;
                topicqueuestatscount.AddAttributes("style", "visibility:visible;");
            }
            else
            {
                Topicqueuestats_0.Checked = true;
                Topicqueuestats_1.Checked = false;
                topicqueuestatscount.AddAttributes("style", "visibility:hidden;");
            }

            topicqueuestatscount.Text       = __configinfo.TopicQueueStatsCount.ToString();
            losslessdel.Text                = __configinfo.Losslessdel.ToString();
            edittimelimit.Text              = __configinfo.Edittimelimit.ToString();
            editedby.SelectedValue          = __configinfo.Editedby.ToString();
            defaulteditormode.SelectedValue = __configinfo.Defaulteditormode.ToString();
            allowswitcheditor.SelectedValue = __configinfo.Allowswitcheditor.ToString();
            reasonpm.SelectedValue          = __configinfo.Reasonpm.ToString();
            hottopic.Text          = __configinfo.Hottopic.ToString();
            starthreshold.Text     = __configinfo.Starthreshold.ToString();
            fastpost.SelectedValue = __configinfo.Fastpost.ToString();
            tpp.Text = __configinfo.Tpp.ToString();
            ppp.Text = __configinfo.Ppp.ToString();
            allowhtmltitle.SelectedValue = __configinfo.Htmltitle.ToString();
            enabletag.SelectedValue      = __configinfo.Enabletag.ToString();
            string[] ratevalveset = __configinfo.Ratevalveset.Split(',');
            ratevalveset1.Text       = ratevalveset[0];
            ratevalveset2.Text       = ratevalveset[1];
            ratevalveset3.Text       = ratevalveset[2];
            ratevalveset4.Text       = ratevalveset[3];
            ratevalveset5.Text       = ratevalveset[4];
            statstatus.SelectedValue = __configinfo.Statstatus.ToString();
            statscachelife.Text      = __configinfo.Statscachelife.ToString();
            //pvfrequence.Text = __configinfo.Pvfrequence.ToString();
            hottagcount.Text            = __configinfo.Hottagcount.ToString();
            oltimespan.Text             = __configinfo.Oltimespan.ToString();
            maxmodworksmonths.Text      = __configinfo.Maxmodworksmonths.ToString();
            disablepostad.SelectedValue = __configinfo.Disablepostad.ToString();
            disablepostad.Items[0].Attributes.Add("onclick", "$('" + postadstatus.ClientID + "').style.display='';");
            disablepostad.Items[1].Attributes.Add("onclick", "$('" + postadstatus.ClientID + "').style.display='none';");
            disablepostadregminute.Text = __configinfo.Disablepostadregminute.ToString();
            disablepostadpostcount.Text = __configinfo.Disablepostadpostcount.ToString();
            disablepostadregular.Text   = __configinfo.Disablepostadregular.ToString();
            if (__configinfo.Disablepostad == 0)
            {
                postadstatus.Attributes.Add("style", "display:none");
            }
            #endregion
        }