예제 #1
0
        private void DelUserInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                int uid = DNTRequest.GetInt("uid", -1);
                if (this.AllowDeleteUser(this.userid, uid))
                {
                    bool delposts = this.deltype.SelectedValue.IndexOf("1") < 0;
                    bool delpms   = this.deltype.SelectedValue.IndexOf("2") < 0;

                    User user = XUser.FindByID(uid);
                    if (user.Delete(delposts, delpms))
                    {
                        Sync.DeleteUsers(uid.ToString(), "");
                        Avatars.DeleteAvatar(uid.ToString());
                        XForum.UpdateForumsFieldModerators(this.userName.Text);
                        Online.DeleteUserByUid(this.userInfo.ID);
                        AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除用户", "用户名:" + this.userName.Text);
                        base.RegisterStartupScript("PAGE", "window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';");
                        return;
                    }
                    base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';</script>");
                    return;
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败,你要删除的用户是创始人用户或是其它管理员,因此不能删除!');window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';</script>");
                }
            }
        }
예제 #2
0
 private void SaveInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         var config = GeneralConfigInfo.Current;
         config.Seotitle       = this.seotitle.Text;
         config.Seokeywords    = this.seokeywords.Text;
         config.Seodescription = this.seodescription.Text;
         config.Seohead        = this.seohead.Text;
         config.Archiverstatus = (int)Convert.ToInt16(this.archiverstatus.SelectedValue);
         config.Sitemapstatus  = (int)Convert.ToInt16(this.sitemapstatus.SelectedValue);
         config.Sitemapttl     = this.sitemapttl.Text.ToInt();
         config.Aspxrewrite    = (int)Convert.ToInt16(this.aspxrewrite.SelectedValue);
         if (this.extname.Text.IsNullOrWhiteSpace())
         {
             base.RegisterStartupScript("", "<script>alert('您未输入相应的伪静态url扩展名!');</script>");
             return;
         }
         config.Extname = this.extname.Text.Trim();
         //if (config.Aspxrewrite == 1)
         //{
         //    AdminForums.SetForumsPathList(true, config.Extname);
         //}
         //else
         //{
         //    AdminForums.SetForumsPathList(false, config.Extname);
         //}
         XCache.Remove(CacheKeys.FORUM_FORUM_LIST);
         config.Iisurlrewrite = iisurlrewrite.SelectedValue.ToInt();
         config.Save();;
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "搜索引擎优化设置", "");
         base.RegisterStartupScript("PAGE", "window.location.href='global_searchengine.aspx';");
     }
 }
예제 #3
0
파일: medalgrid.cs 프로젝트: xiongeee/BBX
        private void SaveMedal_Click(object send, EventArgs e)
        {
            int  num  = 0;
            bool flag = false;

            foreach (object current in this.DataGrid1.GetKeyIDArray())
            {
                int    medalid = int.Parse(current.ToString());
                string name    = this.DataGrid1.GetControlValue(num, "name").Trim();
                string image   = this.DataGrid1.GetControlValue(num, "image").Trim();
                if (String.IsNullOrEmpty(name) || String.IsNullOrEmpty(image))
                {
                    flag = true;
                }
                else
                {
                    //Medals.UpdateMedal(medalid, name, image);
                    var entity = Medal.FindByID(medalid);
                    entity.Name  = name;
                    entity.Image = image;
                    entity.Update();

                    num++;
                }
            }
            AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量更新勋章信息", "");
            //XCache.Remove(CacheKeys.FORUM_UI_MEDALS_LIST);
            if (flag)
            {
                base.RegisterStartupScript("PAGE", "alert('某些信息不完整,未能更新!');window.location.href='global_medalgrid.aspx';");
                return;
            }
            base.RegisterStartupScript("PAGE", "window.location.href='global_medalgrid.aspx';");
        }
예제 #4
0
        private void AddNewRec_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(this.extension.Text))
            {
                base.RegisterStartupScript("", "<script>alert('要添加的附件扩展名不能为空');window.location.href='forum_attachtypesgrid.aspx';</script>");
                return;
            }
            if (String.IsNullOrEmpty(this.maxsize.Text) || this.maxsize.Text.ToInt() <= 0)
            {
                base.RegisterStartupScript("", "<script>alert('要添加的附件最大尺寸不能为空且要大于0');window.location.href='forum_attachtypesgrid.aspx';</script>");
                return;
            }
            foreach (var at in AttachType.FindAllWithCache())
            {
                if (at.Extension.EqualIgnoreCase(this.extension.Text))
                {
                    base.RegisterStartupScript("", "<script>alert('数据库中已存在相同的附件扩展名');window.location.href='forum_attachtypesgrid.aspx';</script>");
                    return;
                }
            }
            AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "添加附件类型", "添加附件类型,扩展名为:" + this.extension.Text);
            try
            {
                //Attachments.AddAttchType(this.extension.Text, this.maxsize.Text);
                AttachType.Add(extension.Text, maxsize.Text.ToInt());

                base.RegisterStartupScript("PAGE", "window.location.href='forum_attachtypesgrid.aspx';");
            }
            catch
            {
                base.RegisterStartupScript("", "<script>alert('无法更新数据库.');window.location.href='forum_attachtypesgrid.aspx';</script>");
            }
        }
예제 #5
0
파일: addidentify.cs 프로젝트: xiongeee/BBX
 private void AddIdentifyInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         if (String.IsNullOrEmpty(this.uploadfile.FileName.Trim()) || String.IsNullOrEmpty(this.uploadfilesmall.FileName.Trim()))
         {
             base.RegisterStartupScript("PAGE", "alert('没有选择鉴定图片');window.location.href='forum_addidentify.aspx';");
             return;
         }
         string text  = this.uploadfile.UpdateFile();
         string text2 = this.uploadfilesmall.UpdateFile();
         if (String.IsNullOrEmpty(text.Trim()))
         {
             base.RegisterStartupScript("PAGE", "alert('没有选择鉴定大图片');window.location.href='forum_addidentify.aspx';");
             return;
         }
         if (String.IsNullOrEmpty(text2.Trim()))
         {
             base.RegisterStartupScript("PAGE", "alert('没有选择鉴定小图片');window.location.href='forum_addidentify.aspx';");
             return;
         }
         if (TopicIdentify.Add(this.name.Text, text))
         {
             string[] array = text.Split('.');
             string   str   = string.Format("{0}_small.{1}", array[0], array[1]);
             Directory.Move(base.Server.MapPath("../../images/identify/") + text2, base.Server.MapPath("../../images/identify/") + str);
             XCache.Remove("/Forum/TopicIdentifys");
             XCache.Remove("/Forum/TopicIndentifysJsArray");
             AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件添加", this.name.Text);
             base.RegisterStartupScript("PAGE", "window.location.href='forum_identifymanage.aspx';");
             return;
         }
         base.RegisterStartupScript("PAGE", "alert('插入失败,可能名称与原有的相同');window.location.href='forum_identifymanage.aspx';");
     }
 }
예제 #6
0
        private void SubmitBatchSet_Click(object sender, EventArgs e)
        {
            string fidlist = Request["Forumtree1"];

            if (String.IsNullOrEmpty(fidlist) || fidlist == "," || fidlist == "0")
            {
                base.RegisterStartupScript("", "<script>alert('您未选中任何版块, 系统无法提交! ');</script>");
                return;
            }
            this.forumInfo = Forums.GetForumInfo(DNTRequest.GetInt("fid", -1));
            //this.forumInfo.AllowHtml = 0;
            //this.forumInfo.AllowBlog = 0;
            //this.forumInfo.IsTrade = 0;
            //this.forumInfo.AllowEditRules = 0;
            this.forumInfo.AllowSmilies     = this.setting.Items[0].Selected;
            this.forumInfo.AllowRss         = this.setting.Items[1].Selected;
            this.forumInfo.AllowBbCode      = this.setting.Items[2].Selected;
            this.forumInfo.AllowImgCode     = this.setting.Items[3].Selected;
            this.forumInfo.Recyclebin       = this.BoolToInt(this.setting.Items[4].Selected);
            this.forumInfo.Modnewposts      = this.BoolToInt(this.setting.Items[5].Selected);
            this.forumInfo.Jammer           = this.BoolToInt(this.setting.Items[6].Selected);
            this.forumInfo.DisableWatermark = this.setting.Items[7].Selected;
            this.forumInfo.Inheritedmod     = this.BoolToInt(this.setting.Items[8].Selected);
            this.forumInfo.AllowThumbnail   = this.setting.Items[9].Selected;
            this.forumInfo.AllowTag         = this.setting.Items[10].Selected;
            int num = 0;

            num = (this.setting.Items[11].Selected ? (num | 1) : (num & -2));
            num = (this.setting.Items[12].Selected ? (num | 16) : (num & -17));
            num = (this.setting.Items[13].Selected ? (num | 4) : (num & -5));
            this.forumInfo.AllowPostSpecial = num;
            this.forumInfo.AllowEditRules   = this.setting.Items[14].Selected;
            this.forumInfo.Password         = this.password.Text;
            this.forumInfo.Attachextensions = this.attachextensions.GetSelectString(",");
            this.forumInfo.ViewPerm         = this.viewperm.GetSelectString(",");
            this.forumInfo.PostPerm         = this.postperm.GetSelectString(",");
            this.forumInfo.ReplyPerm        = this.replyperm.GetSelectString(",");
            this.forumInfo.GetattachPerm    = this.getattachperm.GetSelectString(",");
            this.forumInfo.PostattachPerm   = this.postattachperm.GetSelectString(",");
            BatchSetParams bsp = default(BatchSetParams);

            bsp.SetPassWord         = this.setpassword.Checked;
            bsp.SetAttachExtensions = this.setattachextensions.Checked;
            bsp.SetPostCredits      = this.setpostcredits.Checked;
            bsp.SetReplyCredits     = this.setreplycredits.Checked;
            bsp.SetSetting          = this.setsetting.Checked;
            bsp.SetViewperm         = this.setviewperm.Checked;
            bsp.SetPostperm         = this.setpostperm.Checked;
            bsp.SetReplyperm        = this.setreplyperm.Checked;
            bsp.SetGetattachperm    = this.setgetattachperm.Checked;
            bsp.SetPostattachperm   = this.setpostattachperm.Checked;
            if (XForum.BatchSet(this.forumInfo, bsp, fidlist))
            {
                ForumOperator.RefreshForumCache();
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "复制版块设置", "编辑论坛版块列表为:" + fidlist.Trim());
                base.RegisterStartupScript("PAGE", "window.location.href='forum_ForumsTree.aspx';");
                return;
            }
            base.RegisterStartupScript("", "<script>alert('提交不成功!');window.location.href='forum_ForumsTree.aspx';</script>");
        }
예제 #7
0
 private void ComUsergroup_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         if (this.sourceusergroup.SelectedIndex == 0 || this.targetusergroup.SelectedIndex == 0)
         {
             base.RegisterStartupScript("", "<script>alert('操作失败,请您选择有效的用户组!');</script>");
             return;
         }
         if (this.sourceusergroup.SelectedValue == this.targetusergroup.SelectedValue)
         {
             base.RegisterStartupScript("", "<script>alert('操作失败,同一个用户组不能够合并!');</script>");
             return;
         }
         var src = UserGroup.FindByID(int.Parse(this.sourceusergroup.SelectedValue));
         var des = UserGroup.FindByID(int.Parse(this.targetusergroup.SelectedValue));
         if (src.Creditslower != des.Creditshigher)
         {
             base.RegisterStartupScript("", "<script>alert('操作失败,要合并的用户组必须是积分相连的两个用户组!');</script>");
             return;
         }
         //var userGroupInfo = UserGroup.FindByID(int.Parse(this.targetusergroup.SelectedValue));
         des.Creditshigher = src.Creditshigher;
         //UserGroups.UpdateUserGroup(userGroupInfo);
         des.Save();
         //UserGroups.DeleteUserGroupInfo(int.Parse(this.sourceusergroup.SelectedValue));
         src.Delete();
         UserGroups.ChangeAllUserGroupId(int.Parse(this.sourceusergroup.SelectedValue), int.Parse(this.targetusergroup.SelectedValue));
         DNTCache.Current.RemoveObject(CacheKeys.FORUM_USER_GROUP_LIST);
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "合并用户组", "把组ID:" + this.sourceusergroup.SelectedIndex + " 合并到组ID:" + this.targetusergroup.SelectedIndex);
         base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupgrid.aspx';");
     }
 }
예제 #8
0
        protected void DataGrid_Update(object sender, DataGridCommandEventArgs E)
        {
            int groupid = this.DataGrid1.DataKeys[E.Item.ItemIndex].ToString().ToInt(0);
            int num     = ((TextBox)E.Item.Cells[2].Controls[0]).Text.ToInt(0);

            if (num < 0)
            {
                num = 0;
            }

            string text          = ((TextBox)E.Item.Cells[3].Controls[0]).Text;
            string selectedValue = ((DropDownList)E.Item.FindControl("imgdropdownlist")).SelectedValue;

            AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "在线列表定制", text);
            try
            {
                //UserGroups.UpdateOnlineList(groupid, num, selectedValue, text);
                var gp = OnlineList.FindByGroupID(groupid);
                gp.DisplayOrder = num;
                gp.Title        = text;
                gp.Img          = selectedValue;
                gp.Update();

                this.BindData();
                //XCache.Remove(CacheKeys.FORUM_UI_ONLINE_ICON_LIST);
                base.RegisterStartupScript("PAGE", "window.location.href='global_onlinelistgrid.aspx';");
            }
            catch
            {
                base.RegisterStartupScript("", "<script>alert('无法更新数据库');window.location.href='global_onlinelistgrid.aspx';</script>");
            }
        }
예제 #9
0
 private void AddNewRec_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(this.find.Text))
     {
         base.RegisterStartupScript("", "<script>alert('要添加的过滤内容不能为空');window.location.href='global_wordgrid.aspx';</script>");
         return;
     }
     if (String.IsNullOrEmpty(this.replacement.Text))
     {
         base.RegisterStartupScript("", "<script>alert('要添加的替换内容不能为空');window.location.href='global_wordgrid.aspx';</script>");
         return;
     }
     if (Word.IsExistBanWord(this.find.Text))
     {
         base.RegisterStartupScript("", "<script>alert('数据库中已存在相同的过滤内容');window.location.href='global_wordgrid.aspx';</script>");
         return;
     }
     AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "加入字符过滤", "字符为:" + this.find.Text);
     try
     {
         Word.CreateBanWord(this.username, this.find.Text, this.replacement.Text);
         this.BindData();
         base.RegisterStartupScript("PAGE", "window.location.href='global_wordgrid.aspx';");
     }
     catch
     {
         base.RegisterStartupScript("", "<script>alert('无法更新数据库.');window.location.href='global_wordgrid.aspx';</script>");
     }
 }
예제 #10
0
 private void SaveInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         var config    = GeneralConfigInfo.Current;
         var hashtable = new Hashtable();
         hashtable.Add("禁止访问时间段", this.visitbanperiods.Text);
         hashtable.Add("禁止发帖时间段", this.postbanperiods.Text);
         hashtable.Add("发帖审核时间段", this.postmodperiods.Text);
         hashtable.Add("禁止下载附件时间段", this.attachbanperiods.Text);
         hashtable.Add("禁止全文搜索时间段", this.searchbanperiods.Text);
         string text = "";
         if (!Utils.IsRuleTip(hashtable, "timesect", out text))
         {
             base.RegisterStartupScript("erro", "<script>alert('" + text + ",时间格式错误');</script>");
             return;
         }
         config.Visitbanperiods  = this.visitbanperiods.Text;
         config.Postbanperiods   = this.postbanperiods.Text;
         config.Postmodperiods   = this.postmodperiods.Text;
         config.Searchbanperiods = this.searchbanperiods.Text;
         config.Attachbanperiods = this.attachbanperiods.Text;
         config.Save();;
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "时间段设置", "");
         base.RegisterStartupScript("PAGE", "window.location.href='global_timespan.aspx';");
     }
 }
예제 #11
0
파일: runsql.cs 프로젝트: xiongeee/BBX
 private void RunSqlString_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         if (!base.IsFounderUid(this.userid))
         {
             base.Response.Write(base.GetShowMessage());
             base.Response.End();
             return;
         }
         if (String.IsNullOrEmpty(this.sqlstring.Text.Trim()))
         {
             base.RegisterStartupScript("", "<script language=\"javascript\">alert('请您输入SQL语句!');</script>");
             return;
         }
         //string text = Databases.RunSql(this.sqlstring.Text.Replace("dnt_", BaseConfigs.GetTablePrefix));
         string text = XForum.Meta.Session.Execute(this.sqlstring.Text) + "";
         if (text != string.Empty)
         {
             base.RegisterStartupScript("", "<script language=\"javascript\">showalert('" + text + "');</script>");
             return;
         }
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "运行SQL语句", this.sqlstring.Text);
         base.RegisterStartupScript("PAGE", "window.location.href='global_runsql.aspx';");
     }
 }
예제 #12
0
파일: editbbcode.cs 프로젝트: xiongeee/BBX
        private void UpdateBBCodeInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                foreach (DictionaryEntry item in new SortedList
                {
                    {
                        "参数个数",
                        this.param.Text
                    },

                    {
                        "嵌套次数",
                        this.nest.Text
                    }
                })
                {
                    if (item.Value.ToInt(-1) < 0)
                    {
                        base.RegisterStartupScript("", "<script>alert('输入错误:" + item.Key + ",只能是0或者正整数');window.location.href='forum_editbbcode.aspx';</script>");
                        return;
                    }
                }
                string a = this.icon.UpdateFile();
                if (String.IsNullOrEmpty(a))
                {
                    a = this.ViewState["inco"].ToString();
                }
                this.replacement.is_replace = (this.example.is_replace = (this.explanation.is_replace = (this.paramsdescript.is_replace = (this.paramsdefvalue.is_replace = false))));
                BbCode.UpdateBBCode(int.Parse(this.available.SelectedValue), Regex.Replace(this.tag.Text.Replace("<", "").Replace(">", ""), "^[\\>]|[\\{]|[\\}]|[\\[]|[\\]]|[\\']|[\\.]", ""), a, this.replacement.Text, this.example.Text, this.explanation.Text, this.param.Text, this.nest.Text, this.paramsdescript.Text, this.paramsdefvalue.Text, DNTRequest.GetInt("id", 0));
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "更新" + Utils.ProductName + "代码", "TAB为:" + this.tag.Text);
                base.RegisterStartupScript("PAGE", "window.location.href='forum_bbcodegrid.aspx';");
            }
        }
예제 #13
0
 private void SaveCombinationInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         if (this.sourceforumid.SelectedValue == "0")
         {
             base.RegisterStartupScript("", "<script>alert('请选择相应的源论坛!');</script>");
             return;
         }
         if (this.targetforumid.SelectedValue == "0")
         {
             base.RegisterStartupScript("", "<script>alert('请选择相应的目标论坛!');</script>");
             return;
         }
         var forumInfo = Forums.GetForumInfo(this.targetforumid.SelectedValue.ToInt(0));
         if (forumInfo != null && forumInfo.ParentID == 0 && forumInfo.Layer == 0)
         {
             base.RegisterStartupScript("", "<script>alert('您所选择的目标论坛是\"论坛分类\"而不是\"论坛版块\",因此合并无效!');</script>");
             return;
         }
         if (!XForum.Combination(this.sourceforumid.SelectedValue.ToInt(), this.targetforumid.SelectedValue.ToInt()))
         {
             string scriptstr = "<script>alert('当前节点下面有子结点,因此合并无效!');window.location.href='forum_forumcombination.aspx';</script>";
             base.RegisterStartupScript("", scriptstr);
             return;
         }
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "合并论坛版块", "合并论坛版块" + this.sourceforumid.SelectedValue + "到" + this.targetforumid.SelectedValue);
         base.RegisterStartupScript("PAGE", "window.location.href='forum_forumstree.aspx';");
     }
 }
예제 #14
0
        protected void SaveFriend_Click(object sender, EventArgs e)
        {
            int  num  = 0;
            bool flag = false;

            foreach (object current in this.DataGrid1.GetKeyIDArray())
            {
                int    displayorder = int.Parse(this.DataGrid1.GetControlValue(num, "displayorder"));
                string name         = this.DataGrid1.GetControlValue(num, "name").Trim();
                string url          = this.DataGrid1.GetControlValue(num, "url").Trim();
                string note         = this.DataGrid1.GetControlValue(num, "note").Trim();
                string logo         = this.DataGrid1.GetControlValue(num, "logo").Trim();

                var lnk = ForumLink.FindByID(int.Parse(current.ToString()));
                if (lnk != null)
                {
                    lnk.DisplayOrder = displayorder;
                    lnk.Name         = name;
                    lnk.Url          = url;
                    lnk.Note         = note;
                    lnk.Logo         = logo;
                    lnk.Save();

                    num++;
                }
            }
            AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "批量更新友情链接", "");
            XCache.Remove(CacheKeys.FORUM_FORUM_LINK_LIST);
            if (flag)
            {
                base.RegisterStartupScript("PAGE", "alert('某些信息不完整,未能更新!');window.location.href='global_forumlinksgrid.aspx';");
                return;
            }
            base.RegisterStartupScript("PAGE", "window.location.href='global_forumlinksgrid.aspx';");
        }
예제 #15
0
파일: delforums.cs 프로젝트: xiongeee/BBX
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                //var mpp = MallPluginProvider.GetInstance();
                //if (Request["istrade"] == "1" && mpp != null)
                //{
                //	mpp.EmptyGoodsCategoryFid(DNTRequest.GetInt("fid", 0));
                //	mpp.StaticWriteJsonFile();
                //	XCache.Remove("/Mall/MallSetting/GoodsCategories");
                //}
                //if (Forums.DeleteForum(Request["fid"]))
                var f = XForum.FindByID(Request["fid"].ToInt());
                if (f != null)
                {
                    f.Delete();

                    ForumOperator.RefreshForumCache();
                    AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "删除论坛版块", "删除论坛版块,fid为:" + Request["fid"]);
                    base.RegisterStartupScript("", "<script>window.location.href='forum_ForumsTree.aspx';</script>");
                    return;
                }
                base.RegisterStartupScript("", "<script>alert('对不起,当前节点下面还有子结点,因此不能删除!');window.location.href='forum_ForumsTree.aspx';</script>");
            }
        }
예제 #16
0
        private void UpdateAnnounceInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                //Announcements.UpdateAnnouncement(new AnnouncementInfo
                //{
                //    Id = DNTRequest.GetInt("id", 0),
                //    Poster = this.poster.Text.Trim(),
                //    Title = this.title.Text.Trim(),
                //    Displayorder = this.displayorder.Text.ToInt(),
                //    Starttime = this.starttime.Text.ToDateTime(),
                //    Endtime = this.endtime.Text.ToDateTime(),
                //    Message = Request["announcemessage_hidden"].Trim()
                //});

                var entity = Announcement.FindByID(DNTRequest.GetInt("id", 0));
                entity.Poster       = poster.Text.Trim();
                entity.Title        = title.Text.Trim();
                entity.Message      = Request["announcemessage_hidden"].Trim();
                entity.StartTime    = this.starttime.Text.ToDateTime();
                entity.EndTime      = this.endtime.Text.ToDateTime();
                entity.DisplayOrder = Int32.Parse(displayorder.Text);
                entity.Save();

                XCache.Remove(CacheKeys.FORUM_ANNOUNCEMENT_LIST);
                XCache.Remove(CacheKeys.FORUM_SIMPLIFIED_ANNOUNCEMENT_LIST);
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "更新公告", "更新公告,标题为:" + this.title.Text);
                base.RegisterStartupScript("PAGE", "window.location.href='global_announcegrid.aspx';");
            }
        }
예제 #17
0
 private void DeleteUser_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         string text = Request["uid"].Trim(',');
         if (text != "")
         {
             bool     delposts = this.deltype.SelectedValue.IndexOf("1") < 0;
             bool     delpms   = this.deltype.SelectedValue.IndexOf("2") < 0;
             string[] array    = text.Split(',');
             for (int i = 0; i < array.Length; i++)
             {
                 string text2 = array[i];
                 if (text2 != "" && this.CheckSponser(Utility.ToInt(text2, 0)) && Utility.ToInt(text2, 0) > 1)
                 {
                     int  userid = Utility.ToInt(text2, 0);
                     User user   = XUser.FindByID(userid);
                     if (user.Delete(delposts, delpms))
                     {
                         Sync.DeleteUsers(text2, "");
                         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除用户", "用户名:批量用户删除");
                         base.RegisterStartupScript("PAGE", "window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';");
                     }
                 }
             }
             return;
         }
         base.RegisterStartupScript("", "<script>alert('请选择相应的用户!');window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';</script>");
     }
 }
예제 #18
0
        private void EditIdentify_Click(object sender, EventArgs e)
        {
            int  num  = 0;
            bool flag = true;

            foreach (object item in this.identifygrid.GetKeyIDArray())
            {
                //if (!Identifys.UpdateIdentifyById(int.Parse(item.ToString()), this.identifygrid.GetControlValue(num, "name")))
                //{
                //	flag = false;
                //}
                var ti = TopicIdentify.FindByID(item.ToInt());
                if (ti == null)
                {
                    flag = false;
                }
                else
                {
                    ti.Name = identifygrid.GetControlValue(num, "name");
                    ti.Update();
                }
                num++;
            }
            AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件修改", "");
            if (!flag)
            {
                base.RegisterStartupScript("", "<script>alert('某些记录未能更新,因为与原有的记录名称相同');window.location.href='forum_identifymanage.aspx';</script>");
                return;
            }
            base.RegisterStartupScript("", "<script>window.location.href='forum_identifymanage.aspx';</script>");
        }
예제 #19
0
        public void AddNewRec_Click(object sender, EventArgs e)
        {
            if (!this.CheckValue(this.typename.Text, this.displayorder.Text, this.description.Text))
            {
                return;
            }

            var entity = TopicType.FindByName(this.typename.Text);

            if (entity != null)
            {
                base.RegisterStartupScript("", "<script>alert('数据库中已存在相同的主题分类名称');window.location.href='forum_topictypesgrid.aspx';</script>");
                return;
            }

            //TopicTypes.CreateTopicTypes(this.typename.Text, int.Parse(this.displayorder.Text), this.description.Text);
            entity              = new TopicType();
            entity.Name         = typename.Text;
            entity.DisplayOrder = Int32.Parse(displayorder.Text);
            entity.Description  = description.Text;
            entity.Save();

            AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "添加主题分类", "添加主题分类,名称为:" + this.typename.Text);
            //XCache.Remove("/Forum/TopicTypes");
            base.RegisterStartupScript("", "<script>window.location.href='forum_topictypesgrid.aspx';</script>");
        }
예제 #20
0
파일: medalgrid.cs 프로젝트: xiongeee/BBX
 private void ImportMedal_Click(object sender, EventArgs e)
 {
     AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "导入勋章", "");
     //Medals.InsertMedalList(this.GetMedalFileList());
     Medal.Import(GetMedalFileList());
     base.RegisterStartupScript("PAGE", "window.location.href='global_medalgrid.aspx';");
 }
예제 #21
0
        public void SubmitButton_Click(object sender, EventArgs e)
        {
            bool flag = true;

            for (int i = 1; i <= this.fileList.Count; i++)
            {
                if (DNTRequest.GetFormString("id" + i) != "")
                {
                    try
                    {
                        if (!TopicIdentify.Add(DNTRequest.GetString("name" + i), DNTRequest.GetString("file" + i)))
                        {
                            flag = false;
                        }
                    }
                    catch
                    {
                        base.RegisterStartupScript("", "<script>alert('出现错误,可能名称超出长度!');window.location.href='forum_identifymanage.aspx';</script>");
                    }
                }
            }
            AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "鉴定文件增加", "");
            if (!flag)
            {
                base.RegisterStartupScript("", "<script>alert('某些记录未能插入,因为与数据库中原有的名称相同');window.location.href='forum_identifymanage.aspx';</script>");
                return;
            }
            base.RegisterStartupScript("", "<script>window.location.href='forum_identifymanage.aspx';</script>");
        }
예제 #22
0
        private void DelRec_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                if (Request["delid"] != "")
                {
                    //ForumLinks.DeleteForumLink(Request["delid"]);
                    //var ids = TypeConverter.StringToIntArray(Request["delid"]);
                    var ids = Request["delid"].SplitAsInt(",");
                    //var link = ForumLink.FindByID(WebHelper.RequestInt("delid"));
                    //if (link != null) link.Delete();
                    var links = ForumLink.FindAllByIds(ids);
                    if (links != null && links.Count > 0)
                    {
                        links.Delete();
                    }

                    AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "删除友情链接", "删除友情链接,ID为: " + Request["delid"].Replace("0 ", ""));
                    XCache.Remove(CacheKeys.FORUM_FORUM_LINK_LIST);
                    base.Response.Redirect("global_forumlinksgrid.aspx");
                    return;
                }
                base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='global_forumlinksgrid.aspx';</script>");
            }
        }
예제 #23
0
 private void DelRec_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         string rowid = Request["rowid"];
         if (rowid != "")
         {
             int num = 0;
             XmlDocumentExtender doc = new XmlDocumentExtender();
             doc.Load(this.configPath);
             XmlNodeList childNodes = doc.SelectSingleNode(this.targetNode).ChildNodes;
             string[]    array      = rowid.Split(',');
             for (int i = 0; i < array.Length; i++)
             {
                 string s = array[i];
                 doc.SelectSingleNode(this.targetNode).RemoveChild(childNodes.Item(int.Parse(s) - num));
                 num++;
             }
             doc.Save(this.configPath);
             AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "删除选定的图版轮换页", "删除选定的图版轮换页,ID为: " + Request["id"].Replace("0 ", ""));
             base.Response.Redirect("aggregation_rotatepic.aspx?pagename=" + Request["pagename"]);
             return;
         }
         base.RegisterStartupScript("", "<script>alert('您未选中任何选项');window.location.href='aggregation_rotatepic.aspx?pagename=" + Request["pagename"] + "';</script>");
     }
 }
예제 #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var fid = Request["currentfid"].ToInt();

            if (fid > 0)
            {
                var tfid = Request["targetfid"].ToInt();
                if (!AdminForums.MovingForumsPos(fid, tfid, Request["isaschildnode"].ToInt() == 1))
                {
                    base.RegisterStartupScript("", "<script>alert('当前版块下面有子版块,因此无法移动!');window.location.href='forum_forumsTree.aspx';</script>");
                }
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "移动论坛版块", "移动论坛版块ID:" + fid + "到ID:" + tfid);
            }
            if (!this.Page.IsPostBack)
            {
                var list = XForum.Root.Childs;
                if (list.Count == 0)
                {
                    base.Server.Transfer("forum_AddFirstForum.aspx");
                }
                else
                {
                    this.AddTree(0, list, "");
                    this.str  = "<script type=\"text/javascript\">\r\n  var obj = [" + this.str;
                    this.str  = this.str.Substring(0, this.str.Length - 3);
                    this.str += "];\r\n var newtree = new tree(\"newtree\",obj,\"reSetTree\");";
                    this.str += "</script>";
                }
                this.ShowTreeLabel.Text = this.str;
            }
        }
예제 #25
0
        private void SaveRotatepic_Click(object sender, EventArgs e)
        {
            int  num  = 0;
            bool flag = false;
            var  doc  = new XmlDocumentExtender();

            doc.Load(this.configPath);
            var childNodes = doc.SelectSingleNode(this.targetNode).ChildNodes;

            if (childNodes != null && childNodes.Count > 0)
            {
                doc.InitializeNode(this.targetNode);
            }
            foreach (object arg_5F_0 in this.DataGrid1.GetKeyIDArray())
            {
                string controlValue  = this.DataGrid1.GetControlValue(num, "rotatepicid");
                string controlValue2 = this.DataGrid1.GetControlValue(num, "img");
                string controlValue3 = this.DataGrid1.GetControlValue(num, "url");
                string text          = this.DataGrid1.GetControlValue(num, "titlecontent").Trim();
                if (!Utils.IsNumeric(controlValue) || !Utils.IsURL(controlValue2) || !Utils.IsURL(controlValue3) || String.IsNullOrEmpty(text))
                {
                    flag = true;
                    break;
                }
                bool       flag2    = false;
                XmlElement newChild = doc.CreateElement(this.nodeName);
                doc.AppendChildElementByNameValue(ref newChild, "rotatepicid", controlValue);
                doc.AppendChildElementByNameValue(ref newChild, "pagetype", "1");
                doc.AppendChildElementByNameValue(ref newChild, "img", controlValue2);
                doc.AppendChildElementByNameValue(ref newChild, "url", controlValue3);
                doc.AppendChildElementByNameValue(ref newChild, "titlecontent", text);
                foreach (XmlNode xmlNode in childNodes)
                {
                    if (int.Parse(xmlNode["rotatepicid"].InnerText) > int.Parse(controlValue))
                    {
                        doc.SelectSingleNode(this.targetNode).InsertBefore(newChild, xmlNode);
                        flag2 = true;
                        break;
                    }
                }
                if (!flag2)
                {
                    doc.SelectSingleNode(this.targetNode).AppendChild(newChild);
                }
                num++;
            }
            AggregationFacade.BaseAggregation.ClearAllDataBind();
            if (!flag)
            {
                SiteUrls.Current = null;
                AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "聚合页面论坛广告编辑", "");
                doc.Save(this.configPath);
                base.RegisterStartupScript("PAGE", "window.location.href='aggregation_rotatepic.aspx?pagename=" + Request["pagename"] + "';");
                return;
            }
            base.RegisterStartupScript("", "<script>alert('某行序号、图片路径或点击链接可能是非法URL或说明文字为空,不能进行更新.');window.location.href='aggregation_rotatepic.aspx?pagename=" + Request["pagename"] + "';</script>");
        }
예제 #26
0
파일: AdminTopics.cs 프로젝트: xiongeee/BBX
        public static void BatchChangeTopicsDisplayOrderLevel(string tidList, int displayOrderLevel, int adminUid, string adminUserName, int adminUserGroupId, string adminUserGroupTitle, string adminIp)
        {
            //BBX.Data.Topics.SetDisplayorder(tidList, displayOrderLevel);
            var list = Topic.FindAllByIDs(tidList);

            list.ForEach(e => e.DisplayOrder = displayOrderLevel);
            list.Save();
            AdminVisitLog.InsertLog(adminUid, adminUserName, adminUserGroupId, adminUserGroupTitle, adminIp, "批量置顶主题", "主题ID:" + tidList + "<br /> 置顶级为:" + displayOrderLevel);
        }
예제 #27
0
파일: editbbcode.cs 프로젝트: xiongeee/BBX
 private void DeleteBBCode_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         BbCode.DeleteBBCode(Request["id"]);
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "删除" + Utils.ProductName + "代码", "TAB为:" + this.tag.Text);
         base.RegisterStartupScript("PAGE", "window.location.href='forum_bbcodegrid.aspx';");
     }
 }
예제 #28
0
        private void AddUserGroupInf_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                foreach (DictionaryEntry item in new Hashtable
                {
                    {
                        "附件最大尺寸",
                        this.maxattachsize.Text
                    },

                    {
                        "每天最大附件总尺寸",
                        this.maxsizeperday.Text
                    },

                    {
                        "个人空间附件总尺寸",
                        this.maxspaceattachsize.Text
                    },

                    {
                        "相册空间总尺寸",
                        this.maxspacephotosize.Text
                    }
                })
                {
                    if (item.Value.ToInt(-1) < 0)
                    {
                        base.RegisterStartupScript("", "<script>alert('输入错误," + item.Key.ToString() + "只能是0或者正整数');window.location.href='addusergroupspecial.aspx';</script>");
                        return;
                    }
                }
                this.LoadUserGroupInfo();
                //if (this.AddUserGroupInfo())
                try
                {
                    userGroupInfo.InsertWithCredits();

                    //XCache.Remove(CacheKeys.FORUM_USER_GROUP_LIST);
                    //UserGroup.FindAllWithCache();
                    AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台添加特殊用户组", "组名:" + this.groupTitle.Text);
                    //return true;

                    base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupspecialgrid.aspx';");
                    //return;
                }
                //if (!String.IsNullOrEmpty(AdminUserGroups.opresult))
                catch (Exception ex)
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + ex.Message + "');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                    //return;
                }
                //base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupspecialgrid.aspx';</script>");
            }
        }
예제 #29
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>");
            }
        }
예제 #30
0
파일: addbbcode.cs 프로젝트: xiongeee/BBX
 private void AddAdInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         this.replacement.is_replace = (this.example.is_replace = (this.explanation.is_replace = (this.paramsdescript.is_replace = (this.paramsdefvalue.is_replace = false))));
         BbCode.CreateBBCCode(int.Parse(this.available.SelectedValue), Regex.Replace(this.tag.Text.Replace("<", "").Replace(">", ""), "^[\\>]|[\\{]|[\\}]|[\\[]|[\\]]|[\\']|[\\.]", ""), this.icon.UpdateFile(), this.replacement.Text, this.example.Text, this.explanation.Text, this.param.Text, this.nest.Text, this.paramsdescript.Text, this.paramsdefvalue.Text);
         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "添加" + Utils.ProductName + "代码", "TAG为:" + this.tag.Text);
         base.RegisterStartupScript("", "<script>window.location.href='forum_bbcodegrid.aspx';</script>");
     }
 }