Esempio n. 1
0
        private void DeleteUserGroupInf_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                UserGroup ug = UserGroup.FindByID(WebHelper.RequestInt("groupid"));
                //if (AdminUserGroups.DeleteUserGroupInfo(DNTRequest.GetInt("groupid", -1)))
                if (ug != null)
                {
                    ug.Delete();

                    GeneralConfigInfo config = GeneralConfigInfo.Current;
                    string            text   = "";
                    string[]          array  = config.Reportusergroup.Split(',');
                    for (int i = 0; i < array.Length; i++)
                    {
                        string text2 = array[i];
                        if (text2 != this.userGroupInfo.ID.ToString())
                        {
                            if (String.IsNullOrEmpty(text))
                            {
                                text = text2;
                            }
                            else
                            {
                                text = text + "," + text2;
                            }
                        }
                    }
                    config.Reportusergroup = text;
                    text = "";
                    string[] array2 = config.Photomangegroups.Split(',');
                    for (int j = 0; j < array2.Length; j++)
                    {
                        string text3 = array2[j];
                        if (text3 != this.userGroupInfo.ID.ToString())
                        {
                            if (text == "")
                            {
                                text = text3;
                            }
                            else
                            {
                                text = text + "," + text3;
                            }
                        }
                    }
                    config.Photomangegroups = text;
                    config.Save();

                    AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除管理组", "组ID:" + DNTRequest.GetInt("groupid", -1));
                    base.RegisterStartupScript("PAGE", "window.location.href='adminusergroupgrid.aspx';");
                    return;
                }
                base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='adminusergroupgrid.aspx';</script>");
            }
        }
Esempio n. 2
0
        private void SaveInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                GeneralConfigInfo configinfo = GeneralConfigInfo.Current;

                //GeneralConfigs.Serialiaze(configinfo, base.Server.MapPath("../../config/general.config"));
                configinfo.Save();
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "用户权限设置", "");
                base.RegisterStartupScript("PAGE", "window.location.href='global_userrights.aspx';");
            }
        }
Esempio n. 3
0
        private void UpdateShare_Click(object sender, EventArgs e)
        {
            var sb    = new StringBuilder();
            var array = DNTRequest.GetFormString("newdisplayorder").SplitAsInt(",");

            string[] array2 = DNTRequest.GetFormString("title").Split(',');
            string[] array3 = DNTRequest.GetFormString("site").Split(',');
            var      array4 = DNTRequest.GetFormString("newdisplayorder").SplitAsInt(",");

            string[] stringarray = DNTRequest.GetFormString("sharedisable").Split(',');
            if (array.Length > 0)
            {
                array4 = InsertionSort(array4);
                for (int i = 0; i < array4.Length; i++)
                {
                    for (int j = 0; j < array.Length; j++)
                    {
                        if (array4[i] == array[j])
                        {
                            if (array[j].ToInt() < 0)
                            {
                                sb.Append("0");
                            }
                            else
                            {
                                sb.Append(array[j]);
                            }
                            sb.Append("|");
                            sb.Append(array3[j]);
                            sb.Append("|");
                            sb.Append(array2[j]);
                            sb.Append("|");
                            if (Utils.InArray(array3[j], stringarray))
                            {
                                sb.Append("1");
                            }
                            else
                            {
                                sb.Append("0");
                            }
                            sb.Append(",");
                            break;
                        }
                    }
                }
                GeneralConfigInfo config = GeneralConfigInfo.Current;
                config.Sharelist = sb.ToString().TrimEnd(',');
                config.Save();;
            }
            base.RegisterStartupScript("PAGE", "window.location.href='global_sharelistgrid.aspx';");
        }
Esempio n. 4
0
        private void SaveInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                GeneralConfigInfo config = GeneralConfigInfo.Current;
                config.Bbcodemode        = this.bbcodemode.SelectedValue.ToInt();
                config.Defaulteditormode = this.defaulteditormode.SelectedValue.ToInt();
                config.Allowswitcheditor = this.allowswitcheditor.SelectedValue.ToInt();
                config.Swfupload         = (int)Convert.ToInt16(this.swfupload.SelectedValue);
                config.Save();

                //config.Save();;
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "编辑器设置", "");
                base.RegisterStartupScript("PAGE", "window.location.href='global_editorset.aspx';");
            }
        }
Esempio n. 5
0
        public static void RemoveTemplateInDB(string templateIdList, int uid, string userName, int groupId, string groupTitle, string ip)
        {
            GeneralConfigInfo config = GeneralConfigInfo.Current;

            if (("," + templateIdList + ",").IndexOf("," + config.Templateid + ",") >= 0)
            {
                config.Templateid = 1;
            }
            //GeneralConfigs.Serialiaze(config, Utils.GetMapPath("../../config/general.config"));
            config.Save();
            Discuz.Data.Forums.UpdateForumAndUserTemplateId(templateIdList);
            Discuz.Data.Templates.DeleteTemplateItem(templateIdList);
            var cache = XCache.Current;

            XCache.Remove("/Forum/TemplateList");
            XCache.Remove(CacheKeys.FORUM_TEMPLATE_ID_LIST);
            XCache.Remove(CacheKeys.FORUM_UI_TEMPLATE_LIST_BOX_OPTIONS_FOR_FORUMINDEX);
            XCache.Remove(CacheKeys.FORUM_UI_TEMPLATE_LIST_BOX_OPTIONS);
            AdminVisitLog.InsertLog(uid, userName, groupId, groupTitle, ip, "从数据库中删除模板文件", "ID为:" + templateIdList);
        }
Esempio n. 6
0
 private void SaveInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         GeneralConfigInfo config = GeneralConfigInfo.Current;
         config.Forumtitle   = this.forumtitle.Text;
         config.Webtitle     = this.webtitle.Text;
         config.Weburl       = this.weburl.Text;
         config.Licensed     = this.licensed.SelectedValue.ToInt();
         config.Icp          = this.icp.Text;
         config.Debug        = this.debug.SelectedValue.ToInt();
         config.Statcode     = this.Statcode.Text;
         config.Linktext     = this.Linktext.Text;
         config.Closed       = this.closed.SelectedValue.ToInt();
         config.Closedreason = this.closedreason.Text;
         config.Save();;
         Caches.ReSetConfig();
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "站点设置", "");
         base.RegisterStartupScript("PAGE", "window.location.href='global_siteset.aspx';");
     }
 }
Esempio n. 7
0
        private void SaveGeneralConfigInfo()
        {
            GeneralConfigInfo config = GeneralConfigInfo.Current;

            config.Attachrefcheck        = this.attachrefcheck.SelectedValue.ToInt();
            config.Attachsave            = this.attachsave.SelectedValue.ToInt();
            config.Watermarkstatus       = DNTRequest.GetInt("watermarkstatus", 0);
            config.Watermarktype         = (int)Convert.ToInt16(this.watermarktype.SelectedValue);
            config.Showattachmentpath    = this.showattachmentpath.SelectedValue.ToInt();
            config.Attachimgmaxheight    = this.attachimgmaxheight.Text.ToInt();
            config.Attachimgmaxwidth     = this.attachimgmaxwidth.Text.ToInt();
            config.Attachimgquality      = this.attachimgquality.Text.ToInt();
            config.Watermarktext         = this.watermarktext.Text;
            config.Watermarkpic          = this.watermarkpic.Text;
            config.Watermarkfontname     = this.watermarkfontname.SelectedValue;
            config.Watermarkfontsize     = this.watermarkfontsize.Text.ToInt();
            config.Watermarktransparency = (int)Convert.ToInt16(this.watermarktransparency.Text);
            config.Save();

            //config.Save();;
            AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "附件设置", "");
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsFounderUid(this.userid))
            {
                base.Response.Write(base.GetShowMessage());
                base.Response.End();
                return;
            }
            if (!string.IsNullOrEmpty(Request["accout"]))
            {
                this.TestAccout(Request["accout"]);
            }
            if (base.IsPostBack)
            {
                this.configInfo.Alipayaccout     = DNTRequest.GetFormString("alipayaccount");
                this.configInfo.Cashtocreditrate = DNTRequest.GetFormInt("cashtocreditsrate", 0);
                int num = DNTRequest.GetFormInt("mincreditstobuy", 0);
                if (this.configInfo.Cashtocreditrate > 0)
                {
                    while (num / this.configInfo.Cashtocreditrate < 0.10m)
                    {
                        num++;
                    }
                }
                this.configInfo.Mincreditstobuy           = num;
                this.configInfo.Maxcreditstobuy           = DNTRequest.GetFormInt("maxcreditstobuy", 0);
                this.configInfo.Userbuycreditscountperday = DNTRequest.GetFormInt("userbuycreditscountperday", 0);
                this.configInfo.Alipaypartnercheckkey     = DNTRequest.GetFormString("alipaypartnercheckkey");
                this.configInfo.Alipaypartnerid           = DNTRequest.GetFormString("alipaypartnerid");
                this.configInfo.Usealipaycustompartnerid  = DNTRequest.GetFormInt("usealipaycustompartnerid", 1);
                this.configInfo.Usealipayinstantpay       = DNTRequest.GetFormInt("usealipayinstantpay", 0);

                //GeneralConfigs.SaveConfig(this.configInfo);
                //GeneralConfigs.ResetConfig();
                configInfo.Save();
                GeneralConfigInfo.Current = null;
                base.RegisterStartupScript("PAGE", "window.location.href='global_screditset.aspx';");
            }
        }
Esempio n. 9
0
        private void SaveInfo_Click(object sender, EventArgs e)
        {
            string[][] array = new string[][]
            {
                new string[]
                {
                    this.losslessdel.Text,
                    this.starthreshold.Text,
                    this.hottopic.Text
                },
                new string[]
                {
                    "删帖不减积分时间",
                    "每页主题数",
                    "每页主题数",
                    "星星升级阀值",
                    "热门话题最低帖数"
                }
            };
            for (int i = 0; i < array[0].Length; i++)
            {
                if (array[0][i].ToInt(-1) < 0)
                {
                    base.RegisterStartupScript("", "<script>alert('输入错误:" + array[1][i] + ",只能是0或者正整数');window.location.href='forum_option.aspx';</script>");
                    return;
                }
            }
            if (this.losslessdel.Text.ToInt() > 9999 || this.losslessdel.Text.ToInt() < 0)
            {
                base.RegisterStartupScript("", "<script>alert('删帖不减积分时间期限只能在0-9999之间');window.location.href='forum_option.aspx';</script>");
                return;
            }
            if (Convert.ToInt16(this.starthreshold.Text) > 9999 || Convert.ToInt16(this.starthreshold.Text) < 0)
            {
                base.RegisterStartupScript("", "<script>alert('星星升级阀值只能在0-9999之间');window.location.href='forum_option.aspx';</script>");
                return;
            }
            if (Convert.ToInt16(this.hottopic.Text) > 9999 || Convert.ToInt16(this.hottopic.Text) < 0)
            {
                base.RegisterStartupScript("", "<script>alert('热门话题最低帖数只能在0-9999之间');window.location.href='forum_option.aspx';</script>");
                return;
            }
            if (Convert.ToInt16(this.hottagcount.Text) > 60 || Convert.ToInt16(this.hottagcount.Text) < 0)
            {
                base.RegisterStartupScript("", "<script>alert('首页热门标签(Tag)数量只能在0-60之间');window.location.href='forum_option.aspx';</script>");
            }
            if (this.viewnewtopicminute.Text.ToInt() > 14400 || this.viewnewtopicminute.Text.ToInt() < 5)
            {
                base.RegisterStartupScript("", "<script>alert('查看新帖的设置必须在5-14400之间');window.location.href='forum_option.aspx';</script>");
                return;
            }
            if (!this.ValidateRatevalveset(this.ratevalveset1.Text))
            {
                return;
            }
            if (!this.ValidateRatevalveset(this.ratevalveset2.Text))
            {
                return;
            }
            if (!this.ValidateRatevalveset(this.ratevalveset3.Text))
            {
                return;
            }
            if (!this.ValidateRatevalveset(this.ratevalveset4.Text))
            {
                return;
            }
            if (!this.ValidateRatevalveset(this.ratevalveset5.Text))
            {
                return;
            }
            if (Convert.ToInt16(this.ratevalveset1.Text) >= Convert.ToInt16(this.ratevalveset2.Text) || Convert.ToInt16(this.ratevalveset2.Text) >= Convert.ToInt16(this.ratevalveset3.Text) || Convert.ToInt16(this.ratevalveset3.Text) >= Convert.ToInt16(this.ratevalveset4.Text) || Convert.ToInt16(this.ratevalveset4.Text) >= Convert.ToInt16(this.ratevalveset5.Text))
            {
                base.RegisterStartupScript("", "<script>alert('评分阀值不是递增取值');window.location.href='forum_option.aspx';</script>");
                return;
            }
            if (base.CheckCookie())
            {
                GeneralConfigInfo config = GeneralConfigInfo.Current;
                config.Modworkstatus           = (int)Convert.ToInt16(this.modworkstatus.SelectedValue);
                config.Userstatusby            = (int)Convert.ToInt16(this.userstatusby.SelectedValue);
                config.Rssttl                  = this.rssttl.Text.ToInt();
                config.Losslessdel             = (int)Convert.ToInt16(this.losslessdel.Text);
                config.Editedby                = (int)Convert.ToInt16(this.editedby.SelectedValue);
                config.Allowswitcheditor       = (int)Convert.ToInt16(this.allowswitcheditor.SelectedValue);
                config.Reasonpm                = (int)Convert.ToInt16(this.reasonpm.SelectedValue);
                config.Hottopic                = (int)Convert.ToInt16(this.hottopic.Text);
                config.Starthreshold           = (int)Convert.ToInt16(this.starthreshold.Text);
                config.Fastpost                = (int)Convert.ToInt16(this.fastpost.SelectedValue);
                config.Enabletag               = this.enabletag.SelectedValue.ToInt() == 1;
                config.Ratevalveset            = this.ratevalveset1.Text + "," + this.ratevalveset2.Text + "," + this.ratevalveset3.Text + "," + this.ratevalveset4.Text + "," + this.ratevalveset5.Text;
                config.Forcewww                = (int)Convert.ToInt16(this.forcewww.SelectedValue);
                config.Statstatus              = this.statstatus.SelectedValue.ToBoolean();
                config.Hottagcount             = (int)Convert.ToInt16(this.hottagcount.Text);
                config.Maxmodworksmonths       = (int)Convert.ToInt16(this.maxmodworksmonths.Text);
                config.Replynotificationstatus = (int)Convert.ToInt16(this.replynotificationstatus.SelectedValue);
                config.Replyemailstatus        = (int)Convert.ToInt16(this.replyemailstatus.SelectedValue);
                config.Viewnewtopicminute      = this.viewnewtopicminute.Text.ToInt();
                config.Quickforward            = this.quickforward.SelectedValue.ToInt();
                config.Msgforwardlist          = this.msgforwardlist.Text.Replace("\r\n", ",");
                config.Rssstatus               = (int)Convert.ToInt16(this.rssstatus.SelectedValue);
                config.Cachelog                = (int)Convert.ToInt16(this.cachelog.SelectedValue);
                //config.Silverlight = (int)Convert.ToInt16(this.silverlight.SelectedValue);
                config.Save();

                //config.Save();;
                //TopicStats.SetQueueCount();
                Caches.ReSetConfig();
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "站点功能", "");
                base.RegisterStartupScript("PAGE", "window.location.href='forum_option.aspx';");
            }
        }
Esempio n. 10
0
        private void SaveInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                if (this.edittimelimit.Text.ToInt() > 9999999 || this.edittimelimit.Text.ToInt() < -1)
                {
                    base.RegisterStartupScript("", "<script>alert('编辑帖子时间限制只能在-1-9999999之间');window.location.href='forum_option.aspx';</script>");
                    return;
                }
                if (this.deletetimelimit.Text.ToInt() > 9999999 || this.deletetimelimit.Text.ToInt() < -1)
                {
                    base.RegisterStartupScript("", "<script>alert('删除帖子时间限制只能在-1-9999999之间');window.location.href='forum_option.aspx';</script>");
                    return;
                }
                if (this.minpostsize.Text.ToInt() > 9999999 || this.minpostsize.Text.ToInt() < 0)
                {
                    base.RegisterStartupScript("", "<script>alert('帖子最小字数只能在0-9999999之间');window.location.href='forum_userrights.aspx';</script>");
                    return;
                }
                if (this.maxpostsize.Text.ToInt() > 9999999 || this.maxpostsize.Text.ToInt() < 0)
                {
                    base.RegisterStartupScript("", "<script>alert('帖子最大字数只能在0-9999999之间');window.location.href='forum_userrights.aspx';</script>");
                    return;
                }
                if (this.maxfavorites.Text.ToInt() > 9999999 || this.maxfavorites.Text.ToInt() < 0)
                {
                    base.RegisterStartupScript("", "<script>alert('收藏夹容量只能在0-9999999之间');window.location.href='forum_userrights.aspx';</script>");
                    return;
                }
                if (this.maxpolloptions.Text.ToInt() > 9999999 || this.maxpolloptions.Text.ToInt() < 0)
                {
                    base.RegisterStartupScript("", "<script>alert('最大签名高度只能在0-9999999之间');window.location.href='forum_userrights.aspx';</script>");
                    return;
                }
                if (this.maxattachments.Text.ToInt() > 9999999 || this.maxattachments.Text.ToInt() < 0)
                {
                    base.RegisterStartupScript("", "<script>alert('投票最大选项数只能在0-9999999之间');window.location.href='forum_userrights.aspx';</script>");
                    return;
                }
                if (this.karmaratelimit.Text.ToInt() > 9999 || this.karmaratelimit.Text.ToInt() < 0)
                {
                    base.RegisterStartupScript("", "<script>alert('评分时间限制只能在0-9999之间');window.location.href='forum_userrights.aspx';</script>");
                    return;
                }
                GeneralConfigInfo config = GeneralConfigInfo.Current;
                config.Dupkarmarate    = (int)Convert.ToInt16(this.dupkarmarate.SelectedValue);
                config.Minpostsize     = this.minpostsize.Text.ToInt();
                config.Maxpostsize     = this.maxpostsize.Text.ToInt();
                config.Maxfavorites    = this.maxfavorites.Text.ToInt();
                config.Maxpolloptions  = this.maxpolloptions.Text.ToInt();
                config.Maxattachments  = this.maxattachments.Text.ToInt();
                config.Karmaratelimit  = (int)Convert.ToInt16(this.karmaratelimit.Text);
                config.Moderactions    = (int)Convert.ToInt16(this.moderactions.SelectedValue);
                config.Edittimelimit   = this.edittimelimit.Text.ToInt();
                config.Deletetimelimit = this.deletetimelimit.Text.ToInt();
                config.Save();

                //config.Save();;
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "用户权限设置", "");
                base.RegisterStartupScript("PAGE", "window.location.href='forum_userrights.aspx';");
            }
        }
Esempio n. 11
0
 private void SaveInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         SortedList sortedList = new SortedList();
         sortedList.Add("无动作离线时间", this.onlinetimeout.Text);
         sortedList.Add("最大签名高度", this.maxsigrows.Text);
         sortedList.Add("显示最近访问论坛数量", this.visitedforums.Text);
         sortedList.Add("帖子中同一表情符出现的最大次数", this.smiliesmax.Text);
         string[] array  = Utils.SplitString(DNTRequest.GetFormString("postleft"), ",");
         string[] array2 = Utils.SplitString(DNTRequest.GetFormString("userface"), ",");
         string   text   = "";
         string   text2  = "";
         foreach (DictionaryEntry item in sortedList)
         {
             if (item.Value.ToInt(-1) < 0)
             {
                 base.RegisterStartupScript("", "<script>alert('输入错误:" + item.Key + ",只能是0或者正整数');window.location.href='global_uiandshowstyle.aspx';</script>");
                 return;
             }
         }
         if (this.onlinetimeout.Text.ToInt() <= 0)
         {
             base.RegisterStartupScript("", "<script>alert('无动作离线时间必须大于0');</script>");
         }
         else
         {
             if (this.maxsigrows.Text.ToInt() > 9999 || this.maxsigrows.Text.ToInt() < 0)
             {
                 base.RegisterStartupScript("", "<script>alert('最大签名高度只能在0-9999之间');window.location.href='.aspx';</script>");
                 return;
             }
             if (this.visitedforums.Text.ToInt() > 9999 || this.visitedforums.Text.ToInt() < 0)
             {
                 base.RegisterStartupScript("", "<script>alert('显示最近访问论坛数量只能在0-9999之间');window.location.href='global_uiandshowstyle.aspx';</script>");
                 return;
             }
             if (this.smiliesmax.Text.ToInt() > 1000 || this.smiliesmax.Text.ToInt() < 0)
             {
                 base.RegisterStartupScript("", "<script>alert('帖子中同一表情符出现的最大次数只能在0-1000之间');window.location.href='global_uiandshowstyle.aspx';</script>");
                 return;
             }
             if (this.showratecount.Text.ToInt() > 100 || this.showratecount.Text.ToInt() < 0)
             {
                 base.RegisterStartupScript("", "<script>alert('显示帖子评分的数量必须在0-100之间');window.location.href='global_uiandshowstyle.aspx';</script>");
                 return;
             }
             if (this.tpp.Text.ToInt() > 100 || this.tpp.Text.ToInt() <= 0)
             {
                 base.RegisterStartupScript("", "<script>alert('每页主题数只能在1-100之间');window.location.href='global_uiandshowstyle.aspx';</script>");
                 return;
             }
             if (this.ppp.Text.ToInt() > 100 || this.ppp.Text.ToInt() <= 0)
             {
                 base.RegisterStartupScript("", "<script>alert('每页帖子数只能在1-100之间');window.location.href='global_uiandshowstyle.aspx';</script>");
                 return;
             }
             string[] array3 = array;
             for (int i = 0; i < array3.Length; i++)
             {
                 string str = array3[i];
                 text += str;
                 text += ",";
             }
             string[] array4 = array2;
             for (int j = 0; j < array4.Length; j++)
             {
                 string str2 = array4[j];
                 text2 += str2;
                 text2 += ",";
             }
             GeneralConfigInfo config = GeneralConfigInfo.Current;
             config.Customauthorinfo     = text.TrimEnd(',') + "|" + text2.TrimEnd(',');
             config.Templateid           = this.templateid.SelectedValue.ToInt();
             config.Subforumsindex       = 1;
             config.Stylejump            = this.stylejump.SelectedValue.ToInt();
             config.BrowseCreateTemplate = this.browsecreatetemplate.SelectedValue.ToInt();
             config.Isframeshow          = this.isframeshow.SelectedValue.ToInt();
             config.Whosonlinestatus     = this.whosonlinestatus.SelectedValue.ToInt();
             if (this.showauthorstatusinpost.SelectedValue == "1")
             {
                 config.Onlinetimeout = -this.onlinetimeout.Text.ToInt();
             }
             else
             {
                 config.Onlinetimeout = this.onlinetimeout.Text.ToInt();
             }
             config.Maxonlinelist      = this.maxonlinelist.Text.ToInt();
             config.Forumjump          = this.forumjump.SelectedValue.ToInt();
             config.Smileyinsert       = this.smileyinsert.SelectedValue.ToInt();
             config.Visitedforums      = this.visitedforums.Text.ToInt();
             config.Moddisplay         = this.moddisplay.SelectedValue.ToInt();
             config.Showsignatures     = this.showsignatures.SelectedValue.ToInt();
             config.Showavatars        = this.showavatars.SelectedValue.ToInt();
             config.Showimages         = this.showimages.SelectedValue.ToInt();
             config.Smiliesmax         = this.smiliesmax.Text.ToInt();
             config.Maxsigrows         = this.maxsigrows.Text.ToInt();
             config.WhosOnlineContract = this.whosonlinecontact.SelectedValue.ToBoolean();
             config.Postnocustom       = this.postnocustom.Text;
             config.Quickforward       = this.quickforward.SelectedValue.ToInt();
             config.Msgforwardlist     = this.msgforwardlist.Text.Replace("\r\n", ",");
             string text3 = "";
             foreach (ListItem listItem in this.allowfloatwin.Items)
             {
                 text3 += ((!listItem.Selected) ? (listItem.Value + "|") : "");
             }
             config.Disallowfloatwin = text3.TrimEnd('|');
             config.Disableshare     = this.openshare.SelectedValue.ToInt();
             config.Shownewposticon  = this.shownewposticon.SelectedValue.ToInt();
             config.Ratelisttype     = this.ratelisttype.SelectedValue.ToInt();
             config.DisplayRateCount = this.showratecount.Text.ToInt();
             config.Moderactions     = this.moderactions.SelectedValue.ToInt();
             config.Memliststatus    = this.memliststatus.SelectedValue.ToInt();
             config.Indexpage        = this.Indexpage.SelectedValue.ToInt();
             config.Tpp              = this.tpp.Text.ToInt();
             config.Ppp              = this.ppp.Text.ToInt();
             config.Fastpost         = this.fastpost.SelectedValue.ToInt();
             config.Userstatusby     = this.userstatusby.SelectedValue.ToInt();
             config.Allowchangewidth = this.allowchangewidth.SelectedValue.ToInt();
             config.Showwidthmode    = this.showwidthmode.SelectedValue.ToInt();
             config.Debug            = (int)Convert.ToInt16(this.debug.SelectedValue);
             config.DateDiff         = this.datediff.SelectedValue.ToInt();
             config.Save();;
             AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "界面与显示方式设置", "");
             base.RegisterStartupScript("PAGE", "window.location.href='global_uiandshowstyle.aspx';");
             return;
         }
         return;
     }
 }
Esempio n. 12
0
        public void InsertForum(Int32 parentid, Int32 systemdisplayorder)
        {
            //需要初始化 forumInfo
            forumInfo = new XForum();
            this.forumInfo.ParentID = parentid;
            //this.forumInfo.Layer = layer.ToInt();
            //this.forumInfo.Parentidlist = parentidlist;
            //this.forumInfo.SubforumCount = subforumcount.ToInt();
            this.forumInfo.Name         = this.name.Text.Trim();
            this.forumInfo.Status       = this.status.SelectedValue.ToInt();
            this.forumInfo.DisplayOrder = systemdisplayorder;
            this.forumInfo.TemplateID   = this.templateid.SelectedValue.ToInt();
            this.forumInfo.AllowSmilies = this.setting.Items[0].Selected;
            this.forumInfo.AllowRss     = this.setting.Items[1].Selected;
            //this.forumInfo.AllowHtml = 0;
            this.forumInfo.AllowBbCode  = this.setting.Items[2].Selected;
            this.forumInfo.AllowImgCode = this.setting.Items[3].Selected;
            //this.forumInfo.AllowBlog = 0;
            //this.forumInfo.IsTrade = 0;
            //this.forumInfo.AllowEditRules = 0;
            this.forumInfo.Recyclebin       = this.BoolToInt(this.setting.Items[4].Selected);
            this.forumInfo.Modnewposts      = this.BoolToInt(this.setting.Items[5].Selected);
            this.forumInfo.Modnewtopics     = this.BoolToInt(this.setting.Items[6].Selected);
            this.forumInfo.Jammer           = this.BoolToInt(this.setting.Items[7].Selected);
            this.forumInfo.DisableWatermark = this.setting.Items[8].Selected;
            this.forumInfo.Inheritedmod     = this.BoolToInt(this.setting.Items[9].Selected);
            this.forumInfo.AllowThumbnail   = this.setting.Items[10].Selected;
            this.forumInfo.AllowTag         = this.setting.Items[11].Selected;
            //this.forumInfo.IsTrade = 0;
            int num = 0;

            num = (this.setting.Items[12].Selected ? (num | 1) : (num & -2));
            num = (this.setting.Items[13].Selected ? (num | 16) : (num & -17));
            num = (this.setting.Items[14].Selected ? (num | 4) : (num & -5));
            this.forumInfo.AllowPostSpecial = num;
            this.forumInfo.AllowEditRules   = this.setting.Items[15].Selected;
            this.forumInfo.AllowSpecialOnly = (int)Convert.ToInt16(this.allowspecialonly.SelectedValue) != 0;
            this.forumInfo.AutoClose        = ((this.autocloseoption.SelectedValue == "0") ? 0 : this.autocloseday.Text.ToInt());
            this.forumInfo.Description      = this.description.Text;
            this.forumInfo.Password         = this.password.Text;
            this.forumInfo.Icon             = this.icon.Text;
            //this.forumInfo.PostcrEdits = "";
            //this.forumInfo.ReplycrEdits = "";
            this.forumInfo.Redirect         = this.redirect.Text;
            this.forumInfo.Attachextensions = this.attachextensions.GetSelectString(",");
            this.forumInfo.Moderators       = this.moderators.Text;
            this.forumInfo.Rules            = this.rules.Text;
            this.forumInfo.Seokeywords      = this.seokeywords.Text.Trim();
            this.forumInfo.Seodescription   = this.seodescription.Text.Trim();
            this.forumInfo.RewriteName      = this.rewritename.Text.Trim();
            this.forumInfo.TopicTypes       = this.topictypes.Text;
            this.forumInfo.ColCount         = colcount.SelectedValue == "1" ? 1 : colcountnumber.Text.ToInt();
            this.forumInfo.ViewPerm         = base.Request.Form["viewperm"];
            this.forumInfo.PostPerm         = base.Request.Form["postperm"];
            this.forumInfo.ReplyPerm        = base.Request.Form["replyperm"];
            this.forumInfo.GetattachPerm    = base.Request.Form["getattachperm"];
            this.forumInfo.PostattachPerm   = base.Request.Form["postattachperm"];
            string text;
            int    fid = AdminForums.CreateForums(this.forumInfo, out text, this.userid, this.username, this.usergroupid, this.grouptitle, this.ip);

            if (HttpContext.Current.Request.Files.Count > 0 && !string.IsNullOrEmpty(HttpContext.Current.Request.Files[0].FileName))
            {
                this.forumInfo      = Forums.GetForumInfo(fid);
                this.forumInfo.Icon = AdminForums.UploadForumIcon(this.forumInfo.ID);
                AdminForums.UpdateForumInfo(this.forumInfo).Replace("'", "’");
                ForumOperator.RefreshForumCache();
                GeneralConfigInfo config = GeneralConfigInfo.Current;
                config.Specifytemplate = ((Forums.GetSpecifyForumTemplateCount() > 0) ? 1 : 0);
                config.Save();

                //config.Save();;
            }
            if (string.IsNullOrEmpty(text))
            {
                base.RegisterStartupScript("PAGE", "self.location.href='forum_ForumsTree.aspx';");
                return;
            }
            base.RegisterStartupScript("PAGE", "alert('用户:" + text + "不存在,因为无法设为版主');self.location.href='forum_ForumsTree.aspx';");
        }
Esempio n. 13
0
 private void submitsetting_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         GeneralConfigInfo config = GeneralConfigInfo.Current;
         string            selectedValue;
         if ((selectedValue = this.size.SelectedValue) != null)
         {
             if (!(selectedValue == "1"))
             {
                 if (!(selectedValue == "2"))
                 {
                     if (selectedValue == "3")
                     {
                         config.Attachsave        = 2;
                         config.Fullmytopics      = 1;
                         config.Maxonlines        = 50000;
                         config.Starthreshold     = 2;
                         config.Searchctrl        = 60;
                         config.Hottopic          = 100;
                         config.Maxmodworksmonths = 1;
                         config.Moddisplay        = 1;
                         config.Tpp                   = 15;
                         config.Ppp                   = 10;
                         config.Maxpolloptions        = 20000;
                         config.Maxfavorites          = 100;
                         config.Nocacheheaders        = 0;
                         config.Guestcachepagetimeout = 20;
                         config.Topiccachemark        = 50;
                         config.Postinterval          = 15;
                         config.Maxspm                = 3;
                         config.Fulltextsearch        = 0;
                         //config.TopicQueueStats = 1;
                         //config.TopicQueueStatsCount = 100;
                     }
                 }
                 else
                 {
                     config.Attachsave        = 1;
                     config.Fullmytopics      = 1;
                     config.Maxonlines        = 5000;
                     config.Starthreshold     = 2;
                     config.Searchctrl        = 30;
                     config.Hottopic          = 20;
                     config.Losslessdel       = 200;
                     config.Maxmodworksmonths = 3;
                     config.Moddisplay        = 0;
                     config.Tpp                   = 20;
                     config.Ppp                   = 15;
                     config.Maxpolloptions        = 1000;
                     config.Maxpostsize           = 10000;
                     config.Maxfavorites          = 200;
                     config.Nocacheheaders        = 0;
                     config.Guestcachepagetimeout = 10;
                     config.Topiccachemark        = 20;
                     config.Postinterval          = 10;
                     config.Maxspm                = 4;
                     config.Fulltextsearch        = 0;
                     //config.TopicQueueStats = 1;
                     //config.TopicQueueStatsCount = 30;
                 }
             }
             else
             {
                 config.Attachsave        = 0;
                 config.Fullmytopics      = 0;
                 config.Maxonlines        = 500;
                 config.Starthreshold     = 2;
                 config.Searchctrl        = 10;
                 config.Hottopic          = 10;
                 config.Losslessdel       = 365;
                 config.Maxmodworksmonths = 5;
                 config.Moddisplay        = 0;
                 config.Tpp                   = 30;
                 config.Ppp                   = 20;
                 config.Maxpolloptions        = 10;
                 config.Maxpostsize           = 10000;
                 config.Maxfavorites          = 500;
                 config.Nocacheheaders        = 1;
                 config.Guestcachepagetimeout = 0;
                 config.Topiccachemark        = 0;
                 config.Postinterval          = 5;
                 config.Maxspm                = 5;
                 config.Fulltextsearch        = 0;
                 //config.TopicQueueStats = 0;
                 //config.TopicQueueStatsCount = 20;
             }
         }
         string selectedValue2;
         if ((selectedValue2 = this.safe.SelectedValue) != null)
         {
             if (!(selectedValue2 == "1"))
             {
                 if (!(selectedValue2 == "2"))
                 {
                     if (selectedValue2 == "3")
                     {
                         config.Attachrefcheck    = 1;
                         config.Doublee           = 0;
                         config.Dupkarmarate      = 0;
                         config.Hideprivate       = 1;
                         config.Memliststatus     = 0;
                         config.Seccodestatus     = "login.aspx";
                         config.Rules             = 1;
                         config.Edittimelimit     = 10;
                         config.Karmaratelimit    = 4;
                         config.Newbiespan        = 4;
                         config.Regctrl           = 48;
                         config.Regstatus         = 1;
                         config.Regverify         = 1;
                         config.Secques           = 20;
                         config.Defaulteditormode = 1;
                         config.Allowswitcheditor = 1;
                         config.Watermarktype     = 1;
                         config.Attachimgquality  = 100;
                     }
                 }
                 else
                 {
                     config.Attachrefcheck    = 1;
                     config.Doublee           = 0;
                     config.Dupkarmarate      = 0;
                     config.Hideprivate       = 1;
                     config.Memliststatus     = 1;
                     config.Seccodestatus     = "login.aspx";
                     config.Rules             = 1;
                     config.Edittimelimit     = 20;
                     config.Karmaratelimit    = 1;
                     config.Newbiespan        = 1;
                     config.Regctrl           = 12;
                     config.Regstatus         = 1;
                     config.Regverify         = 1;
                     config.Secques           = 10;
                     config.Defaulteditormode = 0;
                     config.Allowswitcheditor = 1;
                     config.Watermarktype     = 1;
                     config.Attachimgquality  = 85;
                 }
             }
             else
             {
                 config.Doublee           = 1;
                 config.Dupkarmarate      = 1;
                 config.Hideprivate       = 0;
                 config.Memliststatus     = 1;
                 config.Seccodestatus     = "";
                 config.Rules             = 0;
                 config.Edittimelimit     = 0;
                 config.Karmaratelimit    = 0;
                 config.Regctrl           = 0;
                 config.Regstatus         = 1;
                 config.Regverify         = 0;
                 config.Secques           = 5;
                 config.Defaulteditormode = 0;
                 config.Allowswitcheditor = 0;
                 config.Watermarktype     = 0;
                 config.Attachimgquality  = 80;
             }
         }
         string selectedValue3;
         if ((selectedValue3 = this.func.SelectedValue) != null)
         {
             if (!(selectedValue3 == "1"))
             {
                 if (!(selectedValue3 == "2"))
                 {
                     if (selectedValue3 == "3")
                     {
                         config.Archiverstatus   = 1;
                         config.Attachimgpost    = 1;
                         config.Fastpost         = 1;
                         config.Editedby         = 1;
                         config.Forumjump        = 1;
                         config.Modworkstatus    = 1;
                         config.Rssstatus        = 1;
                         config.Smileyinsert     = 1;
                         config.Stylejump        = 1;
                         config.Subforumsindex   = 1;
                         config.Visitedforums    = 20;
                         config.Welcomemsg       = 1;
                         config.Watermarkstatus  = 1;
                         config.Whosonlinestatus = 1;
                         config.Debug            = 1;
                         config.Regadvance       = 1;
                         config.Showsignatures   = 1;
                     }
                 }
                 else
                 {
                     config.Archiverstatus   = 1;
                     config.Attachimgpost    = 1;
                     config.Fastpost         = 1;
                     config.Editedby         = 1;
                     config.Forumjump        = 1;
                     config.Modworkstatus    = 0;
                     config.Rssstatus        = 1;
                     config.Smileyinsert     = 1;
                     config.Stylejump        = 0;
                     config.Subforumsindex   = 0;
                     config.Visitedforums    = 10;
                     config.Welcomemsg       = 0;
                     config.Watermarkstatus  = 0;
                     config.Whosonlinestatus = 1;
                     config.Debug            = 1;
                     config.Regadvance       = 0;
                     config.Showsignatures   = 1;
                 }
             }
             else
             {
                 config.Archiverstatus   = 0;
                 config.Attachimgpost    = 0;
                 config.Fastpost         = 0;
                 config.Editedby         = 0;
                 config.Forumjump        = 0;
                 config.Modworkstatus    = 0;
                 config.Rssstatus        = 0;
                 config.Smileyinsert     = 0;
                 config.Stylejump        = 0;
                 config.Subforumsindex   = 0;
                 config.Visitedforums    = 0;
                 config.Welcomemsg       = 0;
                 config.Watermarkstatus  = 0;
                 config.Whosonlinestatus = 0;
                 config.Debug            = 0;
                 config.Regadvance       = 0;
                 config.Showsignatures   = 0;
             }
         }
         config.Forumtitle = this.forumtitle.Text.Trim();
         config.Forumurl   = this.forumurl.Text.Trim().ToLower();
         config.Webtitle   = this.webtitle.Text.Trim();
         config.Weburl     = this.weburl.Text.Trim().ToLower();
         config.Save();;
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "快速设置", "");
         base.RegisterStartupScript("PAGE", "window.location.href='setting.aspx';");
     }
 }
Esempio n. 14
0
        private void Save_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                if (Convert.ToDouble(this.creditstax.Text.Trim()) > 1.0 || Convert.ToDouble(this.creditstax.Text.Trim()) < 0.0)
                {
                    base.RegisterStartupScript("", "<script>alert('积分交易税必须是0--1之间的小数');window.location.href='global_scoreset.aspx';</script>");
                    return;
                }
                if (Convert.ToDouble(this.transfermincredits.Text.Trim()) < 0.0)
                {
                    base.RegisterStartupScript("", "<script>alert('转账最低余额必须是大于或等于0');window.location.href='global_scoreset.aspx';</script>");
                    return;
                }
                if (Convert.ToDouble(this.exchangemincredits.Text.Trim()) < 0.0)
                {
                    base.RegisterStartupScript("", "<script>alert('兑换最低余额必须是大于或等于0');window.location.href='global_scoreset.aspx';</script>");
                    return;
                }
                if (Convert.ToDouble(this.maxincperthread.Text.Trim()) < 0.0)
                {
                    base.RegisterStartupScript("", "<script>alert('单主题最高收入必须是大于或等于0');window.location.href='global_scoreset.aspx';</script>");
                    return;
                }
                if (Convert.ToDouble(this.maxchargespan.Text.Trim()) < 0.0)
                {
                    base.RegisterStartupScript("", "<script>alert('单主题最高出售时限必须是大于或等于0');window.location.href='global_scoreset.aspx';</script>");
                    return;
                }
                //if (String.IsNullOrEmpty(this.formula.Text.Trim()) || !AdminForums.CreateUpdateUserCreditsProcedure(this.formula.Text.Trim()))
                // 原来计算积分的公式作为存储过程写入,现在暂时固定编码到User.UpdateUserCredits
                if (String.IsNullOrEmpty(this.formula.Text.Trim()))
                {
                    base.RegisterStartupScript("", "<script>alert('总积分计算公式为空或不正确');window.location.href='global_scoreset.aspx';</script>");
                    return;
                }
                if (this.losslessdel.Text.ToInt() > 9999 || this.losslessdel.Text.ToInt() < 0)
                {
                    base.RegisterStartupScript("", "<script>alert('删帖不减积分时间期限只能在0-9999之间');window.location.href='forum_option.aspx';</script>");
                    return;
                }
                this.dsSrc.ReadXml(base.Server.MapPath("../../config/scoreset.config"));
                this.dsSrc.Tables["formula"].Rows[0]["formulacontext"] = this.formula.Text.Trim();
                this.dsSrc.Tables["formula"].Rows[0]["creditstrans"]   = this.creditstrans.SelectedValue;
                if (this.creditstrans.SelectedValue == "0")
                {
                    this.dsSrc.Tables["formula"].Rows[0]["topicattachcreditstrans"] = this.creditstrans.SelectedValue;
                    this.dsSrc.Tables["formula"].Rows[0]["bonuscreditstrans"]       = this.creditstrans.SelectedValue;
                }
                else
                {
                    this.dsSrc.Tables["formula"].Rows[0]["topicattachcreditstrans"] = this.topicattachcreditstrans.SelectedValue;
                    this.dsSrc.Tables["formula"].Rows[0]["bonuscreditstrans"]       = this.bonuscreditstrans.SelectedValue;
                }
                this.dsSrc.Tables["formula"].Rows[0]["creditstax"]         = Convert.ToDouble(this.creditstax.Text);
                this.dsSrc.Tables["formula"].Rows[0]["transfermincredits"] = Convert.ToDouble(this.transfermincredits.Text);
                this.dsSrc.Tables["formula"].Rows[0]["exchangemincredits"] = Convert.ToDouble(this.exchangemincredits.Text);
                this.dsSrc.Tables["formula"].Rows[0]["maxincperthread"]    = Convert.ToDouble(this.maxincperthread.Text);
                this.dsSrc.Tables["formula"].Rows[0]["maxchargespan"]      = Convert.ToDouble(this.maxchargespan.Text);
                this.dsSrc.WriteXml(base.Server.MapPath("../../config/scoreset.config"));

                XCache.Remove(CacheKeys.FORUM_SCORESET);
                XCache.Remove(CacheKeys.FORUM_SCORESET_CREDITS_TRANS);
                XCache.Remove("/Forum/Scoreset//Forum/Scoreset/TopicAttachCreditsTrans");
                XCache.Remove("/Forum/Scoreset/BonusCreditsTrans");
                XCache.Remove(CacheKeys.FORUM_SCORESET_CREDITS_TAX);
                XCache.Remove(CacheKeys.FORUM_SCORESET_TRANSFER_MIN_CREDITS);
                XCache.Remove(CacheKeys.FORUM_SCORESET_EXCHANGE_MIN_CREDITS);
                XCache.Remove(CacheKeys.FORUM_SCORESET_MAX_INC_PER_THREAD);
                XCache.Remove(CacheKeys.FORUM_SCORESET_MAX_CHARGE_SPAN);
                XCache.Remove("/Forum/IsSetDownLoadAttachScore");
                XCache.Remove(CacheKeys.FORUM_VALID_SCORE_UNIT);
                XCache.Remove(CacheKeys.FORUM_RATESCORESET);

                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "修改积分设置", "修改积分设置");
                this.configInfo.Alipayaccout     = DNTRequest.GetFormString("alipayaccount");
                this.configInfo.Cashtocreditrate = DNTRequest.GetFormInt("cashtocreditsrate", 0);
                int num = DNTRequest.GetFormInt("mincreditstobuy", 0);
                if (this.configInfo.Cashtocreditrate > 0)
                {
                    while (num / this.configInfo.Cashtocreditrate < 0.10m)
                    {
                        num++;
                    }
                }
                this.configInfo.Mincreditstobuy           = num;
                this.configInfo.Maxcreditstobuy           = DNTRequest.GetFormInt("maxcreditstobuy", 0);
                this.configInfo.Userbuycreditscountperday = DNTRequest.GetFormInt("userbuycreditscountperday", 0);
                this.configInfo.Alipaypartnercheckkey     = DNTRequest.GetFormString("alipaypartnercheckkey");
                this.configInfo.Alipaypartnerid           = DNTRequest.GetFormString("alipaypartnerid");
                this.configInfo.Usealipaycustompartnerid  = DNTRequest.GetFormInt("usealipaycustompartnerid", 1);
                this.configInfo.Usealipayinstantpay       = DNTRequest.GetFormInt("usealipayinstantpay", 0);
                this.configInfo.Losslessdel = (int)Convert.ToInt16(this.losslessdel.Text);

                //GeneralConfigs.SaveConfig(this.configInfo);
                //GeneralConfigs.ResetConfig();
                configInfo.Save();
                GeneralConfigInfo.Current = null;
                if (this.RefreshUserScore.SelectedValue.IndexOf("1") == 0)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), "Page", "<script>submit_Click();</script>");
                    return;
                }
                base.RegisterStartupScript("PAGE", "window.location.href='global_scoreset.aspx';");
            }
        }
Esempio n. 15
0
        private void UpdateUserGroupInf_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                var dic = new Dictionary <String, Int32>();
                dic.Add("附件最大尺寸", this.maxattachsize.Text.ToInt(-1));
                dic.Add("每天最大附件总尺寸", this.maxsizeperday.Text.ToInt(-1));
                foreach (var item in dic)
                {
                    if (item.Value < 0)
                    {
                        base.RegisterStartupScript("", "<script>alert('输入错误," + item.Key + "只能是0或者正整数');window.location.href='editadminusergroup.aspx';</script>");
                        return;
                    }
                }
                this.userGroupInfo            = UserGroup.FindByID(DNTRequest.GetInt("groupid", -1));
                this.userGroupInfo.System     = 0;
                this.userGroupInfo.Type       = 0;
                this.userGroupInfo.Readaccess = Convert.ToInt32(this.readaccess.Text);
                int num = Convert.ToInt32(this.radminid.SelectedValue);
                if (num > 0 && num <= 3)
                {
                    //adminGroupInfo = new AdminGroup();
                    //adminGroupInfo.AdmingID = (short)this.userGroupInfo.ID;

                    adminGroupInfo = AdminGroup.FindByID(userGroupInfo.ID);
                    adminGroupInfo.AllowEditPost     = admingroupright.Items[0].Selected;
                    adminGroupInfo.AllowEditpoll     = admingroupright.Items[1].Selected;
                    adminGroupInfo.AllowStickthread  = Convert.ToInt32(this.allowstickthread.SelectedValue);
                    adminGroupInfo.AllowModPost      = false;
                    adminGroupInfo.AllowDelPost      = admingroupright.Items[2].Selected;
                    adminGroupInfo.AllowMassprune    = admingroupright.Items[3].Selected;
                    adminGroupInfo.AllowRefund       = false;
                    adminGroupInfo.AllowCensorword   = false;
                    adminGroupInfo.AllowViewIP       = admingroupright.Items[4].Selected;
                    adminGroupInfo.AllowBanIP        = false;
                    adminGroupInfo.AllowEditUser     = admingroupright.Items[5].Selected;
                    adminGroupInfo.AllowModUser      = false;
                    adminGroupInfo.AllowBanUser      = false;
                    adminGroupInfo.AllowPostannounce = false;
                    adminGroupInfo.AllowViewLog      = admingroupright.Items[6].Selected;
                    adminGroupInfo.DisablePostctrl   = admingroupright.Items[7].Selected;
                    adminGroupInfo.AllowViewrealName = admingroupright.Items[8].Selected;
                    adminGroupInfo.AllowBanUser      = admingroupright.Items[9].Selected;
                    adminGroupInfo.AllowBanIP        = admingroupright.Items[10].Selected;
                    adminGroupInfo.AllowModPost      = admingroupright.Items[11].Selected;
                    adminGroupInfo.AllowPostannounce = admingroupright.Items[12].Selected;

                    //AdminGroups.SetAdminGroupInfo(this.adminGroupInfo, this.userGroupInfo.ID);
                    adminGroupInfo.Save();
                    this.userGroupInfo.RadminID = num;
                }
                else
                {
                    this.userGroupInfo.RadminID = 0;
                }

                //AdminGroups.ChangeUserAdminidByGroupid(this.userGroupInfo.RadminID, this.userGroupInfo.ID);
                AdminGroup.ChangeGroup(userGroupInfo.RadminID, userGroupInfo.ID);
                this.userGroupInfo.GroupTitle    = this.groupTitle.Text;
                this.userGroupInfo.Creditshigher = Convert.ToInt32(this.creditshigher.Text);
                this.userGroupInfo.Creditslower  = Convert.ToInt32(this.creditslower.Text);
                this.userGroupInfo.Stars         = Convert.ToInt32(this.stars.Text);
                this.userGroupInfo.Color         = this.color.Text;
                this.userGroupInfo.Groupavatar   = this.groupavatar.Text;
                this.userGroupInfo.MaxPrice      = Convert.ToInt32(this.maxprice.Text);
                this.userGroupInfo.MaxPmNum      = Convert.ToInt32(this.maxpmnum.Text);
                this.userGroupInfo.MaxSigSize    = Convert.ToInt32(this.maxsigsize.Text);
                this.userGroupInfo.MaxAttachSize = Convert.ToInt32(this.maxattachsize.Text);
                this.userGroupInfo.MaxSizeperday = Convert.ToInt32(this.maxsizeperday.Text);
                //this.userGroupInfo.MaxSpaceattachSize = Convert.ToInt32(this.maxspaceattachsize.Text);
                //this.userGroupInfo.MaxSpacephotoSize = Convert.ToInt32(this.maxspacephotosize.Text);
                this.userGroupInfo.AttachExtensions = this.attachextensions.GetSelectString(",");
                this.usergrouppowersetting.GetSetting(ref this.userGroupInfo);
                //if (AdminUserGroups.UpdateUserGroupInfo(this.userGroupInfo))
                if (userGroupInfo.Save() > 0)
                {
                    GeneralConfigInfo config = GeneralConfigInfo.Current;
                    int groupid = this.userGroupInfo.ID;
                    if (this.admingroupright.Items[13].Selected)
                    {
                        if (("," + config.Reportusergroup + ",").IndexOf("," + groupid + ",") == -1)
                        {
                            if (String.IsNullOrEmpty(config.Reportusergroup))
                            {
                                config.Reportusergroup = groupid.ToString();
                            }
                            else
                            {
                                GeneralConfigInfo expr_636 = config;
                                expr_636.Reportusergroup = expr_636.Reportusergroup + "," + groupid.ToString();
                            }
                        }
                    }
                    else
                    {
                        string   text  = "";
                        string[] array = config.Reportusergroup.Split(',');
                        for (int i = 0; i < array.Length; i++)
                        {
                            string text2 = array[i];
                            if (text2 != groupid.ToString())
                            {
                                if (String.IsNullOrEmpty(text))
                                {
                                    text = text2;
                                }
                                else
                                {
                                    text = text + "," + text2;
                                }
                            }
                        }
                        config.Reportusergroup = text;
                    }
                    //if (AlbumPluginProvider.GetInstance() != null)
                    //{
                    //    if (this.admingroupright.Items[this.admingroupright.Items.Count - 1].Selected)
                    //    {
                    //        if (("," + config.Photomangegroups + ",").IndexOf("," + groupid + ",") == -1)
                    //        {
                    //            if (config.Photomangegroups == "")
                    //            {
                    //                config.Photomangegroups = groupid.ToString();
                    //            }
                    //            else
                    //            {
                    //                GeneralConfigInfo expr_75C = config;
                    //                expr_75C.Photomangegroups = expr_75C.Photomangegroups + "," + groupid.ToString();
                    //            }
                    //        }
                    //    }
                    //    else
                    //    {
                    //        string text3 = "";
                    //        string[] array2 = config.Photomangegroups.Split(',');
                    //        for (int j = 0; j < array2.Length; j++)
                    //        {
                    //            string text4 = array2[j];
                    //            if (text4 != groupid.ToString())
                    //            {
                    //                if (text3 == "")
                    //                {
                    //                    text3 = text4;
                    //                }
                    //                else
                    //                {
                    //                    text3 = text3 + "," + text4;
                    //                }
                    //            }
                    //        }
                    //        config.Photomangegroups = text3;
                    //    }
                    //}
                    config.Save();

                    //config.Save();;
                    //XCache.Remove(CacheKeys.FORUM_USER_GROUP_LIST);
                    AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台更新管理组", "组名:" + this.groupTitle.Text);
                    base.RegisterStartupScript("PAGE", "window.location.href='adminusergroupgrid.aspx';");
                    return;
                }
                base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='adminusergroupgrid.aspx';</script>");
            }
        }
Esempio n. 16
0
        private void SaveInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                GeneralConfigInfo config = GeneralConfigInfo.Current;
                var config2 = InvitationConfigInfo.Current;
                if (Convert.ToInt16(this.regverify.SelectedValue) == 1 && Request["verifyemailtempmessage_hidden"].IndexOf("{1}") == -1)
                {
                    base.RegisterStartupScript("erro", "<script>alert('验证请求信息邮件内容模板中必须包含\"{1}\"');</script>");
                    return;
                }
                config.Regstatus                       = (int)Convert.ToInt16(this.regstatus.SelectedValue);
                config.Censoruser                      = this.DelNullRowOrSpace(this.censoruser.Text);
                config.Doublee                         = (int)Convert.ToInt16(this.doublee.SelectedValue);
                config.Emaillogin                      = (int)Convert.ToInt16(this.emaillogin.SelectedValue);
                config.Regverify                       = (int)Convert.ToInt16(this.regverify.SelectedValue);
                config.Accessemail                     = this.accessemail.Text;
                config.Censoremail                     = this.censoremail.Text;
                config.Hideprivate                     = (int)Convert.ToInt16(this.hideprivate.SelectedValue);
                config.Ipdenyaccess                    = this.ipdenyaccess.Text;
                config.Ipaccess                        = this.ipaccess.Text;
                config.Regctrl                         = (int)Convert.ToInt16(this.regctrl.Text);
                config.Ipregctrl                       = this.ipregctrl.Text;
                config.Adminipaccess                   = this.adminipaccess.Text;
                config.Welcomemsg                      = (int)Convert.ToInt16(this.welcomemsg.SelectedValue);
                config.Welcomemsgtxt                   = this.welcomemsgtxt.Text;
                config.Rules                           = (int)Convert.ToInt16(this.rules.SelectedValue);
                config.Rulestxt                        = this.rulestxt.Text;
                config.Newbiespan                      = (int)Convert.ToInt16(this.newbiespan.Text);
                config.Realnamesystem                  = (int)Convert.ToInt16(this.realnamesystem.SelectedValue);
                config.Passwordmode                    = (int)Convert.ToInt16(this.passwordmode.SelectedValue);
                config.CookieDomain                    = this.CookieDomain.Text;
                config.Verifyregisterexpired           = (int)Convert.ToInt16(this.verifyregisterexpired.Text);
                config.Verifyregisteremailtemp         = this.RepairEmailTemplateCodeParameter(Request["verifyemailtempmessage_hidden"]);
                config2.InviteCodePayCount             = this.addextcreditsline.Text.ToInt(0);
                config2.InviteCodeExpireTime           = this.invitecodeexpiretime.Text.ToInt(0);
                config2.InviteCodeMaxCount             = this.invitecodemaxcount.Text.ToInt(0);
                config2.InviteCodePrice                = this.CreateInviteCodePriceString();
                config2.InvitationLoginUserDescription = Request["invitationuserdescriptionmessage_hidden"];
                config2.InvitationVisitorDescription   = Request["invitationvisitordescriptionmessage_hidden"];
                config2.InvitationEmailTemplate        = this.RepairEmailTemplateCodeParameter(Request["invitationemailmodelmessage_hidden"]);
                config2.InviteCodeMaxCountToBuy        = (int)Convert.ToInt16(this.invitecodeusermaxbuy.Text);
                config2.InviteCodeUserCreatePerDay     = (int)Convert.ToInt16(this.invitecodeusercreateperday.Text);
                Hashtable hashtable = new Hashtable();
                hashtable.Add("特殊 IP 注册限制", this.ipregctrl.Text);
                hashtable.Add("IP 禁止访问列表", this.ipdenyaccess.Text);
                hashtable.Add("IP 访问列表", this.ipaccess.Text);
                hashtable.Add("管理员后台IP访问列表", this.adminipaccess.Text);
                string text = "";
                if (!Utils.IsRuleTip(hashtable, "ip", out text))
                {
                    base.RegisterStartupScript("erro", "<script>alert('" + text.ToString() + ",IP格式错误');</script>");
                    return;
                }
                Hashtable hashtable2 = new Hashtable();
                hashtable2.Add("Email 允许地址", this.accessemail.Text);
                hashtable2.Add("Email 禁止地址", this.censoremail.Text);
                string text2 = "";
                if (!Utils.IsRuleTip(hashtable2, "email", out text2))
                {
                    base.RegisterStartupScript("erro", "<script>alert('" + text2.ToString() + ",Email格式错误');</script>");
                    return;
                }
                config.Save();

                //config.Save();;
                //InvitationConfigs.Serialiaze(config2, base.Server.MapPath("../../config/invitation.config"));
                config2.Save();
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "注册与访问控制设置", "");
                base.RegisterStartupScript("PAGE", "window.location.href='global_registerandvisit.aspx';");
            }
        }