示例#1
0
        protected override void ShowPage()
        {
            pagetitle = "用户控制面板";

            if (!IsLogin()) return; 
           
            score1 = ((decimal)user.Extcredits1).ToString();
            score2 = ((decimal)user.Extcredits2).ToString();
            score3 = ((decimal)user.Extcredits3).ToString();
            score4 = ((decimal)user.Extcredits4).ToString();
            score5 = ((decimal)user.Extcredits5).ToString();
            score6 = ((decimal)user.Extcredits6).ToString();
            score7 = ((decimal)user.Extcredits7).ToString();
            score8 = ((decimal)user.Extcredits8).ToString();

            if (!IsErr() && useradminid > 0)
                admingroupinfo = AdminGroups.GetAdminGroupInfo(usergroupid);

            StringBuilder sbAttachmentTypeSelect = new StringBuilder();
            if (!Utils.StrIsNullOrEmpty(usergroupinfo.Attachextensions))
                sbAttachmentTypeSelect.AppendFormat("[id] in ({0})", usergroupinfo.Attachextensions);

            usergroupattachtype = Attachments.GetAttachmentTypeString(sbAttachmentTypeSelect.ToString());
            newnoticecount = Notices.GetNewNoticeCountByUid(userid);

            //if (user.Avatar.Trim().ToLower().StartsWith("http://"))
            //{
            //    avatarurl = user.Avatar;
            //    avatartype = 2;
            //    avatarwidth = user.Avatarwidth;
            //    avatarheight = user.Avatarheight;
            //}
            //else if (user.Avatar.ToLower().Trim().StartsWith(@"avatars\common\"))
            //    avatartype = 0;
        }
示例#2
0
        /// <summary>
        /// 创建一个新的管理组信息
        /// </summary>
        /// <param name="__admingroupsInfo">要添加的管理组信息</param>
        /// <returns>更改记录数</returns>
        public static int CreateAdminGroupInfo(AdminGroupInfo admingroupsInfo)
        {
            Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");
            Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/AdminGroupList");

            return Discuz.Data.AdminGroups.CreateAdminGroupInfo(admingroupsInfo);
        }
        public void LoadUserGroupInf(int groupid)
        {
            #region 加载相关组信息

            __usergroupinfo = AdminUserGroups.AdminGetUserGroupInfo(groupid);

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

            if (groupid > 0 && groupid <= 3) radminid.Enabled = false;

            radminid.SelectedValue = __usergroupinfo.Radminid.ToString();

            attachextensions.SetSelectByID(__usergroupinfo.Attachextensions.Trim());

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

            if (__admingroupinfo != null)
            {
                //设置管理权限组初始化信息
                admingroupright.SelectedIndex = -1;
                admingroupright.Items[0].Selected = __admingroupinfo.Alloweditpost == 1;
                admingroupright.Items[1].Selected = __admingroupinfo.Alloweditpoll == 1;
                admingroupright.Items[2].Selected = __admingroupinfo.Allowdelpost == 1;
                admingroupright.Items[3].Selected = __admingroupinfo.Allowmassprune == 1;
                admingroupright.Items[4].Selected = __admingroupinfo.Allowviewip == 1;
                admingroupright.Items[5].Selected = __admingroupinfo.Allowedituser == 1;
                admingroupright.Items[6].Selected = __admingroupinfo.Allowviewlog == 1;
                admingroupright.Items[7].Selected = __admingroupinfo.Disablepostctrl == 1;
                admingroupright.Items[8].Selected = __admingroupinfo.Allowviewrealname == 1;
                admingroupright.Items[9].Selected = __admingroupinfo.Allowbanuser == 1;
                admingroupright.Items[10].Selected = __admingroupinfo.Allowbanip == 1;
                GeneralConfigInfo configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config"));
                admingroupright.Items[11].Selected = ("," + configinfo.Reportusergroup + ",").IndexOf("," + groupid + ",") != -1; //是否允许接收举报信息
                admingroupright.Items[12].Selected = ("," + configinfo.Photomangegroups + ",").IndexOf("," + groupid + ",") != -1;//是否允许管理图片评论
                if (__admingroupinfo.Allowstickthread.ToString() != "") allowstickthread.SelectedValue = __admingroupinfo.Allowstickthread.ToString();

            }

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

            #endregion
        }
示例#4
0
        protected override void ShowPage()
        {
            pagetitle = "查看用户信息";

            if (usergroupinfo.Allowviewpro != 1)
            {
                AddErrLine(string.Format("您当前的身份 \"{0}\" 没有查看用户资料的权限", usergroupinfo.Grouptitle));
                if (userid < 1)
                    needlogin = true;

                return;
            }

            if (DNTRequest.GetString("username").Trim() == "" && DNTRequest.GetString("userid").Trim() == "")
            {
                AddErrLine("错误的URL链接");
                return;
            }


            int id = DNTRequest.GetInt("userid", -1);
            if (id == -1)
                id = Users.GetUserId(Utils.UrlDecode(DNTRequest.GetString("username")));

            if (id == -1)
            {
                AddErrLine("该用户不存在");
                return;
            }

            user = Users.GetUserInfo(id);
            if (user == null)
            {
                AddErrLine("该用户不存在");
                return;
            }

            //用户设定Email保密时,清空用户的Email属性以避免被显示
            if (user.Showemail != 1 && id != userid)
                user.Email = "";

            //获取积分机制和用户组信息,底层有缓存
            score = Scoresets.GetValidScoreName();
            group = UserGroups.GetUserGroupInfo(user.Groupid);
            admininfo = AdminUserGroups.AdminGetAdminGroupInfo(usergroupid);
            score1 = ((decimal)user.Extcredits1).ToString();
            score2 = ((decimal)user.Extcredits2).ToString();
            score3 = ((decimal)user.Extcredits3).ToString();
            score4 = ((decimal)user.Extcredits4).ToString();
            score5 = ((decimal)user.Extcredits5).ToString();
            score6 = ((decimal)user.Extcredits6).ToString();
            score7 = ((decimal)user.Extcredits7).ToString();
            score8 = ((decimal)user.Extcredits8).ToString();
        }
示例#5
0
 /// <summary>
 /// 获得到指定管理组信息
 /// </summary>
 /// <returns>管理组信息</returns>
 public static AdminGroupInfo[] GetAdminGroupList()
 {
     DataTable dt = DatabaseProvider.GetInstance().GetAdminGroupList();
     AdminGroupInfo[] admingroupArray = new AdminGroupInfo[dt.Rows.Count];
     int Index = 0;
     foreach (DataRow dr in dt.Rows)
     {
         admingroupArray[Index] = LoadAdminGroupInfo(dr);
         Index++;
     }
     dt.Dispose();
     return admingroupArray;
 }
示例#6
0
 /// <summary>
 /// 设置管理组信息
 /// </summary>
 /// <param name="__admingroupsInfo">管理组信息</param>
 /// <returns>更改记录数</returns>
 public static int SetAdminGroupInfo(AdminGroupInfo admingroupsInfo, int userGroupId)
 {
     //当已有记录时
     if (AdminGroups.GetAdminGroupInfo(userGroupId) != null)
     {
         //更新相应的管理组
         return Discuz.Data.AdminGroups.SetAdminGroupInfo(admingroupsInfo);
     }
     else
     { //建立相应的用户组
         return CreateAdminGroupInfo(admingroupsInfo);
     }
 }
示例#7
0
		protected override void ShowPage()
		{
			pagetitle = "查看用户信息";
			
			if (usergroupinfo.Allowviewpro != 1)
			{
				AddErrLine(string.Format("您当前的身份 \"{0}\" 没有查看用户资料的权限", usergroupinfo.Grouptitle));
                if (userid < 1)
                    needlogin = true;
				return;
			}

			if (DNTRequest.GetString("username").Trim() == "" && DNTRequest.GetString("userid").Trim() == "")
			{
				AddErrLine("错误的URL链接");
				return;
			}

			int id = DNTRequest.GetInt("userid", -1);
			
			if (id == -1)
			{
				id = Discuz.Forum.Users.GetUserID(Utils.UrlDecode(DNTRequest.GetString("username")));
			}

			if (id == -1)
			{
				AddErrLine("该用户不存在");
				return;
			}

			user = Discuz.Forum.Users.GetUserInfo(id);
			if (user == null)
			{
				AddErrLine("该用户不存在");
				return;
			}

			//用户设定Email保密时,清空用户的Email属性以避免被显示
			if (user.Showemail != 1)
			{
				user.Email = "";
			}
			//获取金币机制和用户组信息,底层有缓存
            score = Scoresets.GetValidScoreName();
			group = UserGroups.GetUserGroupInfo(user.Groupid);
            admininfo = AdminUserGroups.AdminGetAdminGroupInfo(usergroupid);
            
		}
示例#8
0
        /// <summary>
        /// 获得到指定管理组信息
        /// </summary>
        /// <returns>管理组信息</returns>
        public static AdminGroupInfo[] GetAdminGroupList()
        {
            Discuz.Cache.DNTCache cache = Discuz.Cache.DNTCache.GetCacheService();
            AdminGroupInfo[] admingroupArray = cache.RetrieveObject("/AdminGroupList") as AdminGroupInfo[];
            if (admingroupArray == null)
            {
                DataTable dt = DatabaseProvider.GetInstance().GetAdminGroupList();
                admingroupArray = new AdminGroupInfo[dt.Rows.Count];
                AdminGroupInfo admingroup;
                int Index = 0;
                foreach (DataRow dr in dt.Rows)
                {
                    admingroup = new AdminGroupInfo();
                    admingroup.Admingid = short.Parse(dr["admingid"].ToString());
                    admingroup.Alloweditpost = byte.Parse(dr["alloweditpost"].ToString());
                    admingroup.Alloweditpoll = byte.Parse(dr["alloweditpoll"].ToString());
                    admingroup.Allowstickthread = byte.Parse(dr["allowstickthread"].ToString());
                    admingroup.Allowmodpost = byte.Parse(dr["allowmodpost"].ToString());
                    admingroup.Allowdelpost = byte.Parse(dr["allowdelpost"].ToString());
                    admingroup.Allowmassprune = byte.Parse(dr["allowmassprune"].ToString());
                    admingroup.Allowrefund = byte.Parse(dr["allowrefund"].ToString());
                    admingroup.Allowcensorword = byte.Parse(dr["allowcensorword"].ToString());
                    admingroup.Allowviewip = byte.Parse(dr["allowviewip"].ToString());
                    admingroup.Allowbanip = byte.Parse(dr["allowbanip"].ToString());
                    admingroup.Allowedituser = byte.Parse(dr["allowedituser"].ToString());
                    admingroup.Allowmoduser = byte.Parse(dr["allowmoduser"].ToString());
                    admingroup.Allowbanuser = byte.Parse(dr["allowbanuser"].ToString());
                    admingroup.Allowpostannounce = byte.Parse(dr["allowpostannounce"].ToString());
                    admingroup.Allowviewlog = byte.Parse(dr["allowviewlog"].ToString());
                    admingroup.Disablepostctrl = byte.Parse(dr["disablepostctrl"].ToString());
                    admingroupArray[Index] = admingroup;
                    Index++;
                }

                cache.AddObject("/AdminGroupList", admingroupArray);

                dt.Dispose();
            }
            return admingroupArray;
        }
示例#9
0
 private static AdminGroupInfo LoadAdminGroupInfo(DataRow dr)
 {
     AdminGroupInfo admingroup = new AdminGroupInfo();
     admingroup.Admingid = short.Parse(dr["admingid"].ToString());
     admingroup.Alloweditpost = byte.Parse(dr["alloweditpost"].ToString());
     admingroup.Alloweditpoll = byte.Parse(dr["alloweditpoll"].ToString());
     admingroup.Allowstickthread = byte.Parse(dr["allowstickthread"].ToString());
     admingroup.Allowmodpost = byte.Parse(dr["allowmodpost"].ToString());
     admingroup.Allowdelpost = byte.Parse(dr["allowdelpost"].ToString());
     admingroup.Allowmassprune = byte.Parse(dr["allowmassprune"].ToString());
     admingroup.Allowrefund = byte.Parse(dr["allowrefund"].ToString());
     admingroup.Allowcensorword = byte.Parse(dr["allowcensorword"].ToString());
     admingroup.Allowviewip = byte.Parse(dr["allowviewip"].ToString());
     admingroup.Allowbanip = byte.Parse(dr["allowbanip"].ToString());
     admingroup.Allowedituser = byte.Parse(dr["allowedituser"].ToString());
     admingroup.Allowmoduser = byte.Parse(dr["allowmoduser"].ToString());
     admingroup.Allowbanuser = byte.Parse(dr["allowbanuser"].ToString());
     admingroup.Allowpostannounce = byte.Parse(dr["allowpostannounce"].ToString());
     admingroup.Allowviewlog = byte.Parse(dr["allowviewlog"].ToString());
     admingroup.Disablepostctrl = byte.Parse(dr["disablepostctrl"].ToString());
     admingroup.Allowviewrealname = byte.Parse(dr["allowviewrealname"].ToString());
     return admingroup;
 }
示例#10
0
 /// <summary>
 /// ���ù�������Ϣ
 /// </summary>
 /// <param name="__admingroupsInfo">��������Ϣ</param>
 /// <returns>���ļ�¼��</returns>
 public int SetAdminGroupInfo(AdminGroupInfo admingroupsInfo)
 {
     DbParameter[] parms = {
                                DbHelper.MakeInParam("@admingid",DbType.Int16,2,admingroupsInfo.Admingid),
                                DbHelper.MakeInParam("@alloweditpost",DbType.Byte,1,admingroupsInfo.Alloweditpost),
                                DbHelper.MakeInParam("@alloweditpoll",DbType.Byte,1,admingroupsInfo.Alloweditpoll),
                                DbHelper.MakeInParam("@allowstickthread",DbType.Byte,1,admingroupsInfo.Allowstickthread),
                                DbHelper.MakeInParam("@allowmodpost",DbType.Byte,1,admingroupsInfo.Allowmodpost),
                                DbHelper.MakeInParam("@allowdelpost",DbType.Byte,1,admingroupsInfo.Allowdelpost),
                                DbHelper.MakeInParam("@allowmassprune",DbType.Byte,1,admingroupsInfo.Allowmassprune),
                                DbHelper.MakeInParam("@allowrefund",DbType.Byte,1,admingroupsInfo.Allowrefund),
                                DbHelper.MakeInParam("@allowcensorword",DbType.Byte,1,admingroupsInfo.Allowcensorword),
                                DbHelper.MakeInParam("@allowviewip",DbType.Byte,1,admingroupsInfo.Allowviewip),
                                DbHelper.MakeInParam("@allowbanip",DbType.Byte,1,admingroupsInfo.Allowbanip),
                                DbHelper.MakeInParam("@allowedituser",DbType.Byte,1,admingroupsInfo.Allowedituser),
                                DbHelper.MakeInParam("@allowmoduser",DbType.Byte,1,admingroupsInfo.Allowmoduser),
                                DbHelper.MakeInParam("@allowbanuser",DbType.Byte,1,admingroupsInfo.Allowbanuser),
                                DbHelper.MakeInParam("@allowpostannounce",DbType.Byte,1,admingroupsInfo.Allowpostannounce),
                                DbHelper.MakeInParam("@allowviewlog",DbType.Byte,1,admingroupsInfo.Allowviewlog),
                                DbHelper.MakeInParam("@disablepostctrl",DbType.Byte,1,admingroupsInfo.Disablepostctrl),
                                DbHelper.MakeInParam("@allowviewrealname",DbType.Byte,1,admingroupsInfo.Allowviewrealname)
                            };
     return DbHelper.ExecuteNonQuery(CommandType.StoredProcedure, BaseConfigs.GetTablePrefix + "updateadmingroup", parms);
 }
示例#11
0
        private bool DoOperations(ForumInfo forum, AdminGroupInfo admininfo, int reasonpm)
        {
            string operationName = "";
            string next = DNTRequest.GetFormString("next");
            string referer = DNTRequest.GetFormString("referer");

            DataTable dt = null;

            #region DoOperation

            string reason = DNTRequest.GetString("reason");
            if (operation != "identify")
            {
                if (reason.Equals(""))
                {
                    AddErrLine("操作原因不能为空");
                    return false;
                }
                else
                {
                    if (reason.Length > 200)
                    {
                        AddErrLine("操作原因不能多于200个字符");
                        return false;
                    }
                }
            }

            if ("delete,highlight,close,movecategory".IndexOf(operation) == -1)
            {
                AddErrLine("未知的操作参数");
                return false;
            }
            //执行提交操作
            if (next.Trim() != "")
                referer = string.Format("goodsadmin.aspx?action={0}&categoryid={1}&goodsid={2}", next, categoryid, goodslist);
            else
                referer = string.Format(base.ShowGoodsListAspxRewrite(categoryid, 1));

            #region switch operation

            switch (operation)
            {
                case "delete":
                    operationName = "删除商品";
                    if (!DoDeleteOperation(forum))
                        return false;
                    break;
                case "highlight": //设置高亮
                    operationName = "设置高亮";
                    if (!DoHighlightOperation())
                        return false;
                    break;
                case "close":
                    operationName = "关闭商品/取消";
                    if (!DoCloseOperation())
                        return false;
                    break;
                case "movecategory":
                    operationName = "移动商品";
                    if (!DoMoveOperation())
                        return false;
                    break;
                default:
                    operationName = "未知操作";
                    break;
            }

            #endregion

            if (next.CompareTo("") == 0)
                AddMsgLine("管理操作成功,现在将转入商品列表");
            else
                AddMsgLine("管理操作成功,现在将转入后续操作");

            dt = Goods.GetGoodsList(goodslist);
            if (config.Modworkstatus == 1)
            {
                if (dt != null)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        AdminModeratorLogs.InsertLog(this.userid.ToString(), username, usergroupid.ToString(),
                                                     this.usergroupinfo.Grouptitle, Utils.GetRealIP(),
                                                     Utils.GetDateTime(), this.forumid.ToString(), this.forumname,
                                                     dr["goodsid"].ToString(), dr["title"].ToString(), operationName,
                                                     reason);

                        if (reasonpm == 1)
                        {
                            int posterid = Utils.StrToInt(dr["selleruid"], -1);
                            if (posterid != -1) //是游客,管理操作就不发短消息了
                            {
                                if (PrivateMessages.GetPrivateMessageCount(posterid, -1) <
                                    UserGroups.GetUserGroupInfo(Users.GetShortUserInfo(posterid).Groupid).Maxpmnum)
                                {
                                    PrivateMessageInfo __privatemessageinfo = new PrivateMessageInfo();

                                    string curdatetime = Utils.GetDateTime();
                                    // 收件箱
                                    __privatemessageinfo.Message = 
                                                 Utils.HtmlEncode(
                                                         string.Format(
                                                                    "这是由论坛系统自动发送的通知短消息。\r\n以下您所发表的商品被 {0} {1} 执行 {2} 操作。\r\n\r\n商品: {3} \r\n操作理由: {4}\r\n\r\n如果您对本管理操作有异议,请与我取得联系。",
                                                                    Utils.RemoveHtml(this.usergroupinfo.Grouptitle), username,
                                                                    operationName, dr["title"].ToString().Trim(),
                                                                    reason));
                                    __privatemessageinfo.Subject = Utils.HtmlEncode("您发表的商品被执行管理操作");
                                    __privatemessageinfo.Msgto = dr["seller"].ToString();
                                    __privatemessageinfo.Msgtoid = posterid;
                                    __privatemessageinfo.Msgfrom = username;
                                    __privatemessageinfo.Msgfromid = userid;
                                    __privatemessageinfo.New = 1;
                                    __privatemessageinfo.Postdatetime = curdatetime;
                                    __privatemessageinfo.Folder = 0;
                                    PrivateMessages.CreatePrivateMessage(__privatemessageinfo, 0);
                                }
                            }
                        }
                    }
                    dt.Dispose();
                }
            }


            //执行完某一操作后转到后续操作
            SetUrl(referer);
            if (next != string.Empty)
                HttpContext.Current.Response.Redirect(BaseConfigs.GetForumPath + referer, false);
            else
                AddScript("window.setTimeout('redirectURL()', 2000);function redirectURL() {window.location='" + referer + "';}");

            SetShowBackLink(false);

            #endregion

            return true;
        }
示例#12
0
        /// <summary>
        /// 常规项验证
        /// </summary>
        /// <param name="admininfo"></param>
        /// <param name="postmessage"></param>
        private void NormalValidate(AdminGroupInfo admininfo, string postmessage, ShortUserInfo user)
        {
            if (ForumUtils.IsCrossSitePost())
            {
                AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                return;
            }

            if (forum.Applytopictype == 1 && forum.Postbytopictype == 1 && !Utils.StrIsNullOrEmpty(topictypeselectoptions))
            {
                if (DNTRequest.GetString("typeid").Trim().Equals(""))
                    AddErrLine("主题类型不能为空");
                //检测所选主题分类是否有效
                if (!Forums.IsCurrentForumTopicType(DNTRequest.GetString("typeid").Trim(), forum.Topictypes))
                    AddErrLine("错误的主题类型");
            }
            if (Utils.StrIsNullOrEmpty(DNTRequest.GetString("title")))
                AddErrLine("标题不能为空");
            else if (DNTRequest.GetString("title").IndexOf(" ") != -1)
                AddErrLine("标题不能包含全角空格符");
            else if (DNTRequest.GetString("title").Length > 60)
                AddErrLine("标题最大长度为60个字符,当前为 " + DNTRequest.GetString("title").Length + " 个字符");

            if (Utils.StrIsNullOrEmpty(postmessage.Replace(" ", "")))
                AddErrLine("内容不能为空");

            if (admininfo != null && admininfo.Disablepostctrl != 1)
            {
                if (postmessage.Length < config.Minpostsize)
                    AddErrLine("您发表的内容过少, 系统设置要求帖子内容不得少于 " + config.Minpostsize.ToString() + " 字多于 " + config.Maxpostsize.ToString() + " 字");
                else if (postmessage.Length > config.Maxpostsize)
                    AddErrLine("您发表的内容过多, 系统设置要求帖子内容不得少于 " + config.Minpostsize.ToString() + " 字多于 " + config.Maxpostsize.ToString() + " 字");
            }

            //新用户广告强力屏蔽检查
            if ((config.Disablepostad == 1) && useradminid < 1)  //如果开启新用户广告强力屏蔽检查或是游客
            {
                if ((config.Disablepostadpostcount != 0 && user.Posts <= config.Disablepostadpostcount) ||
                    (config.Disablepostadregminute != 0 && DateTime.Now.AddMinutes(-config.Disablepostadregminute) <= Convert.ToDateTime(user.Joindate)))
                {
                    foreach (string regular in config.Disablepostadregular.Replace("\r", "").Split('\n'))
                    {
                        if (Posts.IsAD(regular, DNTRequest.GetString("title"), postmessage))
                            AddErrLine("发帖失败,内容中似乎有广告信息,请检查标题和内容,如有疑问请与管理员联系");
                    }
                }
            }
        }
示例#13
0
        private string condition = ""; //查询条件
       

        protected override void ShowPage()
        {
            if (config.Enablemall == 0) //未启用交易模式
            {
                AddErrLine("系统未开启交易模式, 当前页面暂时无法访问!");
                return;
            }
            else
                goodscategoryfid = Discuz.Mall.GoodsCategories.GetGoodsCategoryWithFid();

            forumnav = "";
            forumallowrss = 0;
            if (categoryid <= 0)
            {
                AddErrLine("无效的商品分类ID");
                return;
            }

            if (config.Enablemall == 2) //开启高级模式
            {
                AddLinkRss("mallgoodslist.aspx?categoryid=" + categoryid, "商品列表");
                AddErrLine("当前页面在开启商城(高级)模式下无法访问, 系统将会重定向到商品列表页面!");
                return;
            }

            goodscategoryinfo = GoodsCategories.GetGoodsCategoryInfoById(categoryid);
            if (goodscategoryinfo != null && goodscategoryinfo.Categoryid > 0)
            {
                forumid = GoodsCategories.GetCategoriesFid(goodscategoryinfo.Categoryid);
            }
            else 
            {
                AddErrLine("无效的商品分类ID");
                return;
            }

            ///得到广告列表
            ///头部
            headerad = Advertisements.GetOneHeaderAd("", forumid);
            footerad = Advertisements.GetOneFooterAd("", forumid);
            pagewordad = Advertisements.GetPageWordAd("", forumid);
            doublead = Advertisements.GetDoubleAd("", forumid);
            floatad = Advertisements.GetFloatAd("", forumid);
            mediaad = Advertisements.GetMediaAd(templatepath, "", forumid);

            disablepostctrl = 0;
            if (userid > 0 && useradminid > 0)
                admingroupinfo = AdminGroups.GetAdminGroupInfo(usergroupid);

            if (admingroupinfo != null)
                this.disablepostctrl = admingroupinfo.Disablepostctrl;

            if (forumid == -1)
            {
                AddLinkRss("tools/rss.aspx", "最新商品");
                AddErrLine("无效的商品分类ID");
                return;
            }
            else
            {
                forum = Forums.GetForumInfo(forumid);
                // 检查是否具有版主的身份
                if (useradminid > 0)
                    ismoder = Moderators.IsModer(useradminid, userid, forumid);

                #region 对搜索条件进行检索

                string orderStr = "goodsid";

                if (DNTRequest.GetString("search").Trim() != "") //进行指定查询
                {
                    //所在城市信息
                    cond = DNTRequest.GetInt("locus_2", -1);                    
                    if (cond < 1)
                        condition = "";
                    else
                    {
                        locus = Locations.GetLocusByLID(cond);
                        condition = "AND [lid] = " + cond;
                    }

                    //排序的字段
                    order = DNTRequest.GetInt("order", -1);
                    switch (order)
                    {
                        case 2:
                            orderStr = "expiration"; //到期日
                            break;
                        case 1:
                            orderStr = "price"; //商品价格
                            break;
                        default:
                            orderStr = "goodsid";
                            break;
                    }

                    if (DNTRequest.GetInt("direct", -1) == 0)
                        direct = 0;
                }

                #endregion

                if (forum == null)
                {
                    if (config.Rssstatus == 1)
                        AddLinkRss("tools/rss.aspx", Utils.EncodeHtml(config.Forumtitle) + " 最新商品");

                    AddErrLine("不存在的商品分类ID");
                    return;
                }


                //当版块有外部链接时,则直接跳转
                if (forum.Redirect != null && forum.Redirect != string.Empty)
                {
                    System.Web.HttpContext.Current.Response.Redirect(forum.Redirect);
                    return;
                }

                if (forum.Istrade <= 0)
                {
                    AddErrLine("当前版块不允许商品交易");
                    forumnav = "";
                    return;
                }

                if (forum.Fid < 1)
                {
                    if (config.Rssstatus == 1 && forum.Allowrss == 1)
                        AddLinkRss("tools/" + base.RssAspxRewrite(forum.Fid), Utils.EncodeHtml(forum.Name) + " 最新商品");

                    AddErrLine("不存在的商品分类ID");
                    return;
                }
                if (config.Rssstatus == 1)
                    AddLinkRss("tools/" + base.RssAspxRewrite(forum.Fid), Utils.EncodeHtml(forum.Name) + " 最新商品");

                forumname = forum.Name;
                pagetitle = Utils.RemoveHtml(forum.Name);
                subforumcount = forum.Subforumcount;
                forumnav = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);
                navhomemenu = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname);

                //更新页面Meta中的Description项, 提高SEO友好性
                UpdateMetaInfo(config.Seokeywords, forum.Description, config.Seohead);

                // 是否显示版块密码提示 1为显示, 0不显示
                showforumlogin = 1;
                // 如果版块未设密码
                if (forum.Password == "")
                    showforumlogin = 0;
                else
                {
                    // 如果检测到相应的cookie正确
                    if (Utils.MD5(forum.Password) == ForumUtils.GetCookie("forum" + forumid.ToString() + "password"))
                        showforumlogin = 0;
                    else
                    {
                        // 如果用户提交的密码正确则保存cookie
                        if (forum.Password == DNTRequest.GetString("forumpassword"))
                        {
                            ForumUtils.WriteCookie("forum" + forumid.ToString() + "password", Utils.MD5(forum.Password));
                            showforumlogin = 0;
                        }
                    }
                }

                if (!Forums.AllowViewByUserId(forum.Permuserlist, userid)) //判断当前用户在当前版块浏览权限
                {
                    if (forum.Viewperm == null || forum.Viewperm == string.Empty) //当板块权限为空时,按照用户组权限
                    {
                        if (useradminid != 1 && (usergroupinfo.Allowvisit != 1 || usergroupinfo.Allowtrade != 1))
                        {
                            AddErrLine("您当前的身份 \"" + usergroupinfo.Grouptitle + "\" 没有浏览该商品分类的权限");
                            if (userid == -1)
                            {
                                needlogin = true;
                            }
                            return;
                        }
                    }
                    else //当板块权限不为空,按照板块权限
                    {
                        if (!Forums.AllowView(forum.Viewperm, usergroupid))
                        {
                            AddErrLine("您没有浏览该商品分类的权限");
                            if (userid == -1)
                            {
                                needlogin = true;
                            }
                            return;
                        }
                    }
                }


                ////判断是否有发主题的权限
                if (userid > -1 && Forums.AllowPostByUserID(forum.Permuserlist, userid))
                    canposttopic = true;

                if (forum.Postperm == null || forum.Postperm == string.Empty) //权限设置为空时,根据用户组权限判断
                {
                    // 验证用户是否有发表交易的权限
                    if (usergroupinfo.Allowtrade == 1)
                    {
                        canposttopic = true;
                    }
                }
                else if (Forums.AllowPost(forum.Postperm, usergroupid))
                {
                    canposttopic = true;
                }

                // 如果当前用户非管理员并且论坛设定了禁止发帖时间段,当前时间如果在其中的一个时间段内,不允许用户发帖
                if (useradminid != 1 && usergroupinfo.Disableperiodctrl != 1)
                {
                    string visittime = "";
                    if (Scoresets.BetweenTime(config.Postbanperiods, out visittime))
                        canposttopic = false;
                }

                if (newpmcount > 0)
                {
                    pmlist = PrivateMessages.GetPrivateMessageListForIndex(userid, 5, 1, 1);
                    showpmhint = Convert.ToInt32(Users.GetShortUserInfo(userid).Newsletter) > 4;
                }

                //得到子分类JSON格式
                subcategoriesjson = GoodsCategories.GetSubCategoriesJson(categoryid);
                //得到当前用户请求的页数
                pageid = DNTRequest.GetInt("page", 1);
                //获取主题总数
                goodscount = Goods.GetGoodsCount(categoryid, condition);

                // 得到gpp设置
                if (gpp <= 0)
                    gpp = config.Gpp;

                if (gpp <= 0)
                    gpp = 16;
           
                //修正请求页数中可能的错误
                if (pageid < 1)
                    pageid = 1;

                if (forum.Layer > 0)
                {
                    //获取总页数
                    pagecount = goodscount % gpp == 0 ? goodscount / gpp : goodscount / gpp + 1;
                    if (pagecount == 0)
                        pagecount = 1;

                    if (pageid > pagecount)
                        pageid = pagecount;

                    goodslist = Goods.GetGoodsInfoList(categoryid, gpp, pageid, condition, orderStr, direct);

                    ForumUtils.WriteCookie("referer", string.Format("showgoodslist.aspx?categoryid={0}&page={1}&order={2}&direct={3}&locus2={4}&search={5}", categoryid.ToString(), pageid.ToString(), orderStr, direct, cond, DNTRequest.GetString("search")));

                    //得到页码链接
                    if (DNTRequest.GetString("search") == "")
                    {
                        if (categoryid == 0)
                        {
                            if (config.Aspxrewrite == 1)
                            {
                                pagenumbers = Utils.GetStaticPageNumbers(pageid, pagecount, "showgoodslist-" + categoryid.ToString(), config.Extname, 8);
                            }
                            else
                            {
                                pagenumbers = Utils.GetPageNumbers(pageid, pagecount, "showgoodslist.aspx?categoryid=" + categoryid.ToString(), 8);
                            }

                        }
                        else //当有类型条件时
                        {
                            pagenumbers = Utils.GetPageNumbers(pageid, pagecount, "showgoodslist.aspx?categoryid=" + categoryid, 8);
                        }
                    }
                    else
                    {
                        pagenumbers = Utils.GetPageNumbers(pageid, pagecount,
                                         "showgoodslist.aspx?search=" + DNTRequest.GetString("search") + "&order=" + 2 + "&direct=" + direct + "&categoryid=" + categoryid + "&locus_2=" + cond , 8);
                    }
                }
            }


            forumlistboxoptions = Caches.GetForumListBoxOptionsCache();

            OnlineUsers.UpdateAction(olid, UserAction.ShowForum.ActionID, forumid, forumname, -1, "");


            showforumonline = false;
            onlineiconlist = Caches.GetOnlineGroupIconList();
            if (forumtotalonline < config.Maxonlinelist || DNTRequest.GetString("showonline") == "yes")
            {
                showforumonline = true;
                onlineuserlist = OnlineUsers.GetForumOnlineUserCollection(forumid, out forumtotalonline, out forumtotalonlineguest,
                                                             out forumtotalonlineuser, out forumtotalonlineinvisibleuser);
            }

            if (DNTRequest.GetString("showonline") == "no")
                showforumonline = false;

            ForumUtils.UpdateVisitedForumsOptions(forumid);
            visitedforumsoptions = ForumUtils.GetVisitedForumsOptions(config.Visitedforums);
            //因为目前还未提供RSS功能,所以下面两项为0
            forumallowrss = 0; 
        }
示例#14
0
        public static bool CheckPostTimeSpan(UserGroupInfo userGroupInfo, AdminGroupInfo admininfo, OnlineUserInfo olUserInfo, ShortUserInfo shortUserInfo, ref string msg)
        {
            // 如果当前用户非管理员并且论坛设定了禁止发帖时间段,当前时间如果在其中的一个时间段内,不允许用户发帖
            if (olUserInfo.Adminid != 1 && userGroupInfo.Disableperiodctrl != 1)
            {
                string visittime = "";
                if (Scoresets.BetweenTime(GeneralConfigs.GetConfig().Postbanperiods, out visittime))
                {
                    msg = "在此时间段( " + visittime + " )内用户不可以发帖";
                    return false;
                }
            }

            if (admininfo == null || admininfo.Disablepostctrl != 1)
            {
                int Interval = Utils.StrDateDiffSeconds(olUserInfo.Lastposttime, GeneralConfigs.GetConfig().Postinterval);
                if (Interval < 0)
                {
                    msg = "系统规定发帖间隔为" + GeneralConfigs.GetConfig().Postinterval.ToString() + "秒, 您还需要等待 " + (Interval * -1).ToString() + " 秒";
                    return false;
                }
                else if (olUserInfo.Userid != -1)
                {
                    //ShortUserInfo shortUserInfo = Discuz.Data.Users.GetShortUserInfo(olUserInfo.Userid);
                    string joindate = (shortUserInfo != null) ? shortUserInfo.Joindate : "";
                    if (joindate == "")
                    {
                        msg = "您的用户资料出现错误";
                        return false;
                    }
                    Interval = Utils.StrDateDiffMinutes(joindate, GeneralConfigs.GetConfig().Newbiespan);
                    if (Interval < 0)
                    {
                        msg = "系统规定新注册用户必须要在" + GeneralConfigs.GetConfig().Newbiespan.ToString() + "分钟后才可以发帖, 您还需要等待 " + (Interval * -1).ToString() + " 分钟";
                        return false;
                    }
                }
            }
            return true;
        }
示例#15
0
        /// <summary>
        /// 验证帖子信息
        /// </summary>
        /// <param name="admininfo"></param>
        /// <param name="user"></param>
        /// <param name="ishtmlon"></param>
        private void SetPostInfo(AdminGroupInfo admininfo, ShortUserInfo user, bool ishtmlon)
        {
            if (postinfo.Layer == 0 && forum.Applytopictype == 1 && forum.Postbytopictype == 1 && topictypeselectoptions != string.Empty)
            {
                if (Utils.StrIsNullOrEmpty(DNTRequest.GetString("typeid")) || DNTRequest.GetString("typeid").Trim() == "0")
                {
                    AddErrLine("主题类型不能为空");
                    return;
                }

                if (!Forums.IsCurrentForumTopicType(DNTRequest.GetString("typeid").Trim(), forum.Topictypes))
                {
                    AddErrLine("错误的主题类型");
                    return;
                }
            }

            //这段代码有什么作用,和下面的SetAttachmentInfo方法做的事情是否有重复?能否拿掉?
            ///删除附件
            if (DNTRequest.GetInt("isdeleteatt", 0) == 1)
            {
                if (DNTRequest.GetFormInt("aid", 0) > 0 && Attachments.DeleteAttachment(DNTRequest.GetFormInt("aid", 0)) > 0)
                {
                    attachmentlist = Attachments.GetAttachmentListByPid(postinfo.Pid);
                    attachmentcount = Attachments.GetAttachmentCountByPid(postinfo.Pid);
                }
                AddLinkCss(BaseConfigs.GetForumPath + "templates/" + templatepath + "/editor.css", "css");
                // 帖子内容
                message = postinfo.Message;
                ispost = false;

                return;
            }
            //
            #region 检查标题和内容信息
            if (string.IsNullOrEmpty(postTitle.Trim().Replace(" ", "")) && postinfo.Layer == 0)
                AddErrLine("标题不能为空");
            else if (postTitle.Length > 60)
                AddErrLine("标题最大长度为60个字符,当前为 " + postTitle.Length.ToString() + " 个字符");

            //string postmessage = DNTRequest.GetString("message");
            if (postMessage.Equals("") || postMessage.Replace(" ", "").Equals(""))
                AddErrLine("内容不能为空");

            if (admininfo != null && disablepostctrl != 1)
            {
                if (postMessage.Length < config.Minpostsize)
                    AddErrLine("您发表的内容过少, 系统设置要求帖子内容不得少于 " + config.Minpostsize.ToString() + " 字多于 " + config.Maxpostsize.ToString() + " 字");
                else if (postMessage.Length > config.Maxpostsize)
                    AddErrLine("您发表的内容过多, 系统设置要求帖子内容不得少于 " + config.Minpostsize.ToString() + " 字多于 " + config.Maxpostsize.ToString() + " 字");
            }

            //新用户广告强力屏蔽检查
            if ((config.Disablepostad == 1) && useradminid < 1)  //如果开启新用户广告强力屏蔽检查或是游客
            {
                if ((config.Disablepostadpostcount != 0 && user.Posts <= config.Disablepostadpostcount) ||
                    (config.Disablepostadregminute != 0 && DateTime.Now.AddMinutes(-config.Disablepostadregminute) <= Convert.ToDateTime(user.Joindate)))
                {
                    foreach (string regular in config.Disablepostadregular.Replace("\r", "").Split('\n'))
                    {
                        if (Posts.IsAD(regular, postTitle, postMessage))
                        {
                            AddErrLine("发帖失败,内容中有不符合新用户强力广告屏蔽规则的字符,请检查标题和内容,如有疑问请与管理员联系");
                            return;
                        }
                    }
                }
            }

            #endregion
            string[] pollitem = Utils.SplitString(DNTRequest.GetString("PollItemname"), "\r\n");
            int topicprice = 0;
            string tmpprice = DNTRequest.GetString("topicprice");

            if (postinfo.Layer == 0)
            {

                #region 投票信息
                //string[] pollitem = Utils.SplitString(DNTRequest.GetString("PollItemname"), "\r\n");

                if (!Utils.StrIsNullOrEmpty(DNTRequest.GetString("updatepoll")) && topic.Special == 1)
                {
                    pollinfo.Multiple = DNTRequest.GetInt("multiple", 0);

                    // 验证用户是否有发布投票的权限
                    if (usergroupinfo.Allowpostpoll != 1)
                    {
                        AddErrLine("您当前的身份 \"" + usergroupinfo.Grouptitle + "\" 没有发布投票的权限");
                        return;
                    }

                    if (pollitem.Length < 2)
                        AddErrLine("投票项不得少于2个");
                    else if (pollitem.Length > config.Maxpolloptions)
                        AddErrLine("系统设置为投票项不得多于" + config.Maxpolloptions + "个");
                    else
                    {
                        for (int i = 0; i < pollitem.Length; i++)
                            if (Utils.StrIsNullOrEmpty(pollitem[i]))
                                AddErrLine("投票项不能为空");
                    }
                }
                #endregion

                #region 悬赏信息
                //int topicprice = 0;
                //string tmpprice = DNTRequest.GetString("topicprice");

                if (Regex.IsMatch(tmpprice, "^[0-9]*[0-9][0-9]*$") || tmpprice == string.Empty)
                {
                    topicprice = Utils.StrToInt(tmpprice, 0) > 32767 ? 32767 : Utils.StrToInt(tmpprice, 0);
                    //当不是正在进行的悬赏...
                    if (topic.Special != 2)
                    {
                        if (topicprice > usergroupinfo.Maxprice && usergroupinfo.Maxprice > 0)
                        {
                            if (userextcreditsinfo.Unit.Equals(""))
                                AddErrLine(string.Format("主题售价不能高于 {0} {1}", usergroupinfo.Maxprice, userextcreditsinfo.Name));
                            else
                                AddErrLine(string.Format("主题售价不能高于 {0} {1}({2})", usergroupinfo.Maxprice, userextcreditsinfo.Name, userextcreditsinfo.Unit));
                        }
                        else if (topicprice > 0 && usergroupinfo.Maxprice <= 0)
                            AddErrLine(string.Format("您当前的身份 \"{0}\" 未被允许出售主题", usergroupinfo.Grouptitle));
                        else if (topicprice < 0)
                            AddErrLine("主题售价不能为负数");
                    }
                    else
                    {
                        if (usergroupinfo.Radminid != 1)
                        {
                            if (usergroupinfo.Allowbonus == 0)
                                AddErrLine(string.Format("您当前的身份 \"{0}\" 未被允许进行悬赏", usergroupinfo.Grouptitle));

                            if (topicprice < usergroupinfo.Minbonusprice || topicprice > usergroupinfo.Maxbonusprice)
                                AddErrLine(string.Format("悬赏价格超出范围, 您应在 {0} - {1} {2}{3} 范围内进行悬赏", usergroupinfo.Minbonusprice, usergroupinfo.Maxbonusprice,
                                    userextcreditsinfo.Unit, userextcreditsinfo.Name));
                        }
                    }
                }
                else
                {
                    if (topic.Special != 2)
                        AddErrLine("主题售价只能为整数");
                    else
                        AddErrLine("悬赏价格只能为整数");
                }
                #endregion

                #region 辩论信息
                if (!Utils.StrIsNullOrEmpty(DNTRequest.GetString("updatedebate")) && topic.Special == 4)
                {
                    if (usergroupinfo.Allowdebate != 1)
                    {
                        AddErrLine("您当前的身份 \"" + usergroupinfo.Grouptitle + "\" 没有发布辩论的权限");
                        return;
                    }
                    if (Utils.StrIsNullOrEmpty(DNTRequest.GetString("positiveopinion")))
                    {
                        AddErrLine("正方观点不能为空");
                        return;
                    }
                    if (Utils.StrIsNullOrEmpty(DNTRequest.GetString("negativeopinion")))
                    {
                        AddErrLine("反方观点不能为空");
                        return;
                    }
                    if (Utils.StrIsNullOrEmpty(DNTRequest.GetString("terminaltime")))
                    {
                        AddErrLine("辩论的结束日期不能为空");
                        return;
                    }
                    if (!Utils.IsDateString(DNTRequest.GetString("terminaltime")))
                    {
                        AddErrLine("结束日期格式不正确");
                        return;
                    }
                }
                #endregion

            }

            #region 绑定并检查主题和帖子信息
            if (useradminid == 1)
            {
                postinfo.Title = Utils.HtmlEncode(postTitle);

                if (usergroupinfo.Allowhtml == 0)
                    postinfo.Message = Utils.HtmlEncode(postMessage);
                else
                    postinfo.Message = ishtmlon ? postMessage :
                            Utils.HtmlEncode(postMessage);
            }
            else
            {
                postinfo.Title = Utils.HtmlEncode(ForumUtils.BanWordFilter(postTitle));
                    
                if (usergroupinfo.Allowhtml == 0)
                    postinfo.Message = Utils.HtmlEncode(ForumUtils.BanWordFilter(postMessage));
                else
                    postinfo.Message = ishtmlon ? ForumUtils.BanWordFilter(postMessage) :
                            Utils.HtmlEncode(ForumUtils.BanWordFilter(postMessage));
            }
            postinfo.Title = postinfo.Title.Length > 60 ? postinfo.Title.Substring(0, 60) : postinfo.Title;

            if (useradminid != 1 && (ForumUtils.HasBannedWord(postTitle) || ForumUtils.HasBannedWord(postMessage)))
            {
                string bannedWord = ForumUtils.GetBannedWord(postTitle) == string.Empty ? ForumUtils.GetBannedWord(postMessage) : ForumUtils.GetBannedWord(postTitle);
                AddErrLine(string.Format("对不起, 您提交的内容包含不良信息  <font color=\"red\">{0}</font>, 请返回修改!", bannedWord));
                return;
            }

            //if (useradminid != 1 && (ForumUtils.HasAuditWord(postinfo.Title) || ForumUtils.HasAuditWord(postinfo.Message)))
            //{
            //    AddErrLine("对不起, 管理员设置了需要对发帖进行审核, 您没有权力编辑已通过审核的帖子, 请返回修改!");
            //    return;
            //}

            topic.Displayorder = Topics.GetTitleDisplayOrder(usergroupinfo, useradminid, forum, topic, message, disablepostctrl);

            #endregion
            // 检察上面验证是否有错误
            if (IsErr())
                return;
            //如果是不是管理员组,或者编辑间隔超过60秒,则附加编辑信息
            if (Utils.StrDateDiffSeconds(postinfo.Postdatetime, 60) > 0 && config.Editedby == 1 && useradminid != 1)
                postinfo.Lastedit = username + " 最后编辑于 " + Utils.GetDateTime();

            postinfo.Usesig = Utils.StrToInt(DNTRequest.GetString("usesig"), 0);
            postinfo.Htmlon = (usergroupinfo.Allowhtml == 1 && ishtmlon ? 1 : 0);
            postinfo.Smileyoff = smileyoff == 0 ? TypeConverter.StrToInt(DNTRequest.GetString("smileyoff")) : smileyoff;
            postinfo.Bbcodeoff = (usergroupinfo.Allowcusbbcode == 1 ? TypeConverter.StrToInt(DNTRequest.GetString("bbcodeoff")) : 1);
            postinfo.Parseurloff = TypeConverter.StrToInt(DNTRequest.GetString("parseurloff"));
            postinfo.Invisible = needaudit ? 1 : 0;

            //如果当前用户就是作者或所在管理组有编辑的权限
            if (userid == postinfo.Posterid || (admininfo != null && admininfo.Alloweditpost == 1 && Moderators.IsModer(useradminid, userid, forumid)))
                alloweditpost = true;
            else
            {
                AddErrLine("您当前的身份不是作者");
                return;
            }

            if (!alloweditpost)
            {
                AddErrLine("您当前的身份没有编辑帖子的权限");
                return;
            }

            if (alloweditpost)
                SetTopicInfo(pollitem, topicprice, postMessage);
        }
        private void UpdateUserGroupInf_Click(object sender, EventArgs e)
        {
            #region ���¹�������Ϣ

            if (this.CheckCookie())
            {

                Hashtable ht = new Hashtable();
                ht.Add("�������ߴ�", maxattachsize.Text);
                ht.Add("ÿ����󸽼��ܳߴ�", maxsizeperday.Text);
                ht.Add("���˿ռ丽���ܳߴ�", maxspaceattachsize.Text);
                ht.Add("���ռ��ܳߴ�", maxspacephotosize.Text);

                foreach (DictionaryEntry de in ht)
                {
                    if (!Utils.IsInt(de.Value.ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('�������," + de.Key.ToString() + "ֻ����0����������');window.location.href='global_editadminusergroup.aspx';</script>");
                        return;
                    }

                }
                userGroupInfo = AdminUserGroups.AdminGetUserGroupInfo(DNTRequest.GetInt("groupid", -1));
                userGroupInfo.System = 0;
                userGroupInfo.Type = 0;
                userGroupInfo.Readaccess = Convert.ToInt32(readaccess.Text);

                int selectradminid = Convert.ToInt32(radminid.SelectedValue);
                //���ڵ�ǰ�û�����,�й���Ȩ�޵�,�����ù���Ȩ��
                if (selectradminid > 0 && selectradminid <= 3)
                {
                    adminGroupInfo = new AdminGroupInfo();
                    adminGroupInfo.Admingid = (short)userGroupInfo.Groupid;
                    //������Ӧ�Ĺ�����
                    adminGroupInfo.Alloweditpost = BoolToByte(admingroupright.Items[0].Selected);
                    adminGroupInfo.Alloweditpoll = BoolToByte(admingroupright.Items[1].Selected);
                    adminGroupInfo.Allowstickthread = (byte)Convert.ToInt16(allowstickthread.SelectedValue);
                    adminGroupInfo.Allowmodpost = 0;
                    adminGroupInfo.Allowdelpost = BoolToByte(admingroupright.Items[2].Selected);
                    adminGroupInfo.Allowmassprune = BoolToByte(admingroupright.Items[3].Selected);
                    adminGroupInfo.Allowrefund = 0;
                    adminGroupInfo.Allowcensorword = 0; ;
                    adminGroupInfo.Allowviewip = BoolToByte(admingroupright.Items[4].Selected);
                    adminGroupInfo.Allowbanip = 0;
                    adminGroupInfo.Allowedituser = BoolToByte(admingroupright.Items[5].Selected);
                    adminGroupInfo.Allowmoduser = 0;
                    adminGroupInfo.Allowbanuser = 0;
                    adminGroupInfo.Allowpostannounce = 0;
                    adminGroupInfo.Allowviewlog = BoolToByte(admingroupright.Items[6].Selected);
                    adminGroupInfo.Disablepostctrl = BoolToByte(admingroupright.Items[7].Selected);
                    adminGroupInfo.Allowviewrealname = BoolToByte(admingroupright.Items[8].Selected);
                    adminGroupInfo.Allowbanuser = BoolToByte(admingroupright.Items[9].Selected);
                    adminGroupInfo.Allowbanip = BoolToByte(admingroupright.Items[10].Selected);
                    adminGroupInfo.Allowmodpost = BoolToByte(admingroupright.Items[11].Selected);
                    adminGroupInfo.Allowpostannounce = BoolToByte(admingroupright.Items[12].Selected);

                    Discuz.Forum.AdminGroups.SetAdminGroupInfo(adminGroupInfo, userGroupInfo.Groupid);
                    userGroupInfo.Radminid = selectradminid;
                }
                else
                    userGroupInfo.Radminid = 0;

                AdminGroups.ChangeUserAdminidByGroupid(userGroupInfo.Radminid, userGroupInfo.Groupid);

                userGroupInfo.Grouptitle = groupTitle.Text;
                userGroupInfo.Creditshigher = Convert.ToInt32(creditshigher.Text);
                userGroupInfo.Creditslower = Convert.ToInt32(creditslower.Text);
                userGroupInfo.Stars = Convert.ToInt32(stars.Text);
                userGroupInfo.Color = color.Text;
                userGroupInfo.Groupavatar = groupavatar.Text;
                userGroupInfo.Maxprice = Convert.ToInt32(maxprice.Text);
                userGroupInfo.Maxpmnum = Convert.ToInt32(maxpmnum.Text);
                userGroupInfo.Maxsigsize = Convert.ToInt32(maxsigsize.Text);
                userGroupInfo.Maxattachsize = Convert.ToInt32(maxattachsize.Text);
                userGroupInfo.Maxsizeperday = Convert.ToInt32(maxsizeperday.Text);
                userGroupInfo.Maxspaceattachsize = Convert.ToInt32(maxspaceattachsize.Text);
                userGroupInfo.Maxspacephotosize = Convert.ToInt32(maxspacephotosize.Text);
                //userGroupInfo.MaxFriendsCount = Convert.ToInt32(maxfriendscount.Text);
                userGroupInfo.Attachextensions = attachextensions.GetSelectString(",");

                usergrouppowersetting.GetSetting(ref userGroupInfo);

                if (AdminUserGroups.UpdateUserGroupInfo(userGroupInfo))
                {
                    #region �Ƿ�������վٱ���Ϣ�͹���ͼƬ����
                    GeneralConfigInfo configInfo = GeneralConfigs.GetConfig();
                    //�Ƿ�������վٱ���Ϣ
                    int groupid = userGroupInfo.Groupid;
                    if (admingroupright.Items[13].Selected)
                    {
                        if (("," + configInfo.Reportusergroup + ",").IndexOf("," + groupid + ",") == -1)
                        {
                            if (configInfo.Reportusergroup == "")
                            {
                                configInfo.Reportusergroup = groupid.ToString();
                            }
                            else
                            {
                                configInfo.Reportusergroup += "," + groupid.ToString();
                            }
                        }
                    }
                    else
                    {
                        string tempstr = "";
                        foreach (string report in configInfo.Reportusergroup.Split(','))
                        {
                            if (report != groupid.ToString())
                            {
                                if (tempstr == "")
                                {
                                    tempstr = report;
                                }
                                else
                                {
                                    tempstr += "," + report;
                                }
                            }
                        }
                        configInfo.Reportusergroup = tempstr;
                    }
                    //�Ƿ��������ͼƬ����
                    if (AlbumPluginProvider.GetInstance() != null)
                    {
                        if (admingroupright.Items[admingroupright.Items.Count - 1].Selected)
                        {
                            if (("," + configInfo.Photomangegroups + ",").IndexOf("," + groupid + ",") == -1)
                            {
                                if (configInfo.Photomangegroups == "")
                                {
                                    configInfo.Photomangegroups = groupid.ToString();
                                }
                                else
                                {
                                    configInfo.Photomangegroups += "," + groupid.ToString();
                                }
                            }
                        }
                        else
                        {
                            string tempstr = "";
                            foreach (string photomangegroup in configInfo.Photomangegroups.Split(','))
                            {
                                if (photomangegroup != groupid.ToString())
                                {
                                    if (tempstr == "")
                                    {
                                        tempstr = photomangegroup;
                                    }
                                    else
                                    {
                                        tempstr += "," + photomangegroup;
                                    }
                                }
                            }
                            configInfo.Photomangegroups = tempstr;
                        }
                    }

                    GeneralConfigs.Serialiaze(configInfo, Server.MapPath("../../config/general.config"));
                    #endregion
                    Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");

                    AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "��̨���¹�����", "����:" + groupTitle.Text);
                    base.RegisterStartupScript("PAGE", "window.location.href='global_adminusergroupgrid.aspx';");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('����ʧ��');window.location.href='global_adminusergroupgrid.aspx';</script>");
                }
            }

            #endregion
        }
        private void AddUserGroupInf_Click(object sender, EventArgs e)
        {
            #region 插入相关组信息数据

            if (this.CheckCookie())
            {
                if (radminid.SelectedValue == "0")
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败,请您选择相应的管理组, 再点击提交按钮!');</script>");
                    return;
                }

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

                Hashtable ht = new Hashtable();
                ht.Add("附件最大尺寸", maxattachsize.Text);
                ht.Add("每天最大附件总尺寸", maxsizeperday.Text);
                ht.Add("个人空间附件总尺寸", maxspaceattachsize.Text);
                ht.Add("相册空间总尺寸", maxspacephotosize.Text);
                foreach (DictionaryEntry de in ht)
                {
                    if (!Utils.IsInt(de.Value.ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('输入错误," + de.Key.ToString() + "只能是0或者正整数');window.location.href='global_addadminusergroup.aspx';</script>");
                        return;
                    }
                }

                UserGroupInfo userGroupInfo = new UserGroupInfo();
                userGroupInfo.System = 0;
                userGroupInfo.Type = 0;
                userGroupInfo.Readaccess = Convert.ToInt32(readaccess.Text == "" ? "0" : readaccess.Text);
                userGroupInfo.Allowdirectpost = 1;
                userGroupInfo.Allowmultigroups = 0;
                userGroupInfo.Allowcstatus = 0;
                userGroupInfo.Allowuseblog = 0;
                userGroupInfo.Allowinvisible = 0;
                userGroupInfo.Allowtransfer = 0;
                userGroupInfo.Allowhtml = 0;
                userGroupInfo.Allownickname = 0;
                userGroupInfo.Allowviewstats = 0;
                userGroupInfo.Grouptitle = groupTitle.Text;
                userGroupInfo.Creditshigher = Convert.ToInt32(creditshigher.Text);
                userGroupInfo.Creditslower = Convert.ToInt32(creditslower.Text);
                userGroupInfo.Stars = Convert.ToInt32(stars.Text);
                userGroupInfo.Color = color.Text;
                userGroupInfo.Groupavatar = groupavatar.Text;
                userGroupInfo.Maxprice = Convert.ToInt32(maxprice.Text);
                userGroupInfo.Maxpmnum = Convert.ToInt32(maxpmnum.Text);
                userGroupInfo.Maxsigsize = Convert.ToInt32(maxsigsize.Text);
                userGroupInfo.Maxattachsize = Convert.ToInt32(maxattachsize.Text);
                userGroupInfo.Maxsizeperday = Convert.ToInt32(maxsizeperday.Text);
                userGroupInfo.Maxspaceattachsize = Convert.ToInt32(maxspaceattachsize.Text);
                userGroupInfo.Maxspacephotosize = Convert.ToInt32(maxspacephotosize.Text);
                userGroupInfo.Attachextensions = attachextensions.GetSelectString(",");
                userGroupInfo.Raterange = "";
                userGroupInfo.Radminid = Convert.ToInt32(radminid.SelectedValue);
                usergrouppowersetting.GetSetting(ref userGroupInfo);
                if (AdminUserGroups.AddUserGroupInfo(userGroupInfo))
                {
                    #region 是否允许接收举报信息和管理图片评论
                    GeneralConfigInfo configInfo = GeneralConfigs.GetConfig();
                    //是否允许接收举报信息
                    int groupid = UserGroups.GetMaxUserGroupId();
                    if (admingroupright.Items[13].Selected)
                    {
                        if (("," + configInfo.Reportusergroup + ",").IndexOf("," + groupid + ",") == -1)
                        {
                            if (configInfo.Reportusergroup == "")
                            {
                                configInfo.Reportusergroup = groupid.ToString();
                            }
                            else
                            {
                                configInfo.Reportusergroup += "," + groupid.ToString();
                            }
                        }
                    }
                    //是否允许管理图片评论
                    if (admingroupright.Items[14].Selected)
                    {
                        if (("," + configInfo.Photomangegroups + ",").IndexOf("," + groupid + ",") == -1)
                        {
                            if (configInfo.Photomangegroups == "")
                            {
                                configInfo.Photomangegroups = groupid.ToString();
                            }
                            else
                            {
                                configInfo.Photomangegroups += "," + groupid.ToString();
                            }
                        }
                    }
                    GeneralConfigs.Serialiaze(configInfo, Server.MapPath("../../config/general.config"));
                    #endregion
                    AdminGroupInfo adminGroupInfo = new AdminGroupInfo();
                    //int adminId = DatabaseProvider.GetInstance().GetMaxUserGroupId() + 1;
                    adminGroupInfo.Admingid = (short)UserGroups.GetMaxUserGroupId();

                    //插入相应的管理组
                    adminGroupInfo.Alloweditpost = BoolToByte(admingroupright.Items[0].Selected);
                    adminGroupInfo.Alloweditpoll = BoolToByte(admingroupright.Items[1].Selected);
                    adminGroupInfo.Allowstickthread = (byte)Convert.ToInt16(allowstickthread.SelectedValue);
                    adminGroupInfo.Allowmodpost = 0;
                    adminGroupInfo.Allowdelpost = BoolToByte(admingroupright.Items[2].Selected);
                    adminGroupInfo.Allowmassprune = BoolToByte(admingroupright.Items[3].Selected);
                    adminGroupInfo.Allowrefund = 0;
                    adminGroupInfo.Allowcensorword = 0;
                    adminGroupInfo.Allowviewip = BoolToByte(admingroupright.Items[4].Selected);
                    adminGroupInfo.Allowbanip = 0;
                    adminGroupInfo.Allowedituser = BoolToByte(admingroupright.Items[5].Selected);
                    adminGroupInfo.Allowmoduser = 0;
                    adminGroupInfo.Allowbanuser = 0;
                    adminGroupInfo.Allowpostannounce = 0;
                    adminGroupInfo.Allowviewlog = BoolToByte(admingroupright.Items[6].Selected);
                    adminGroupInfo.Disablepostctrl = BoolToByte(admingroupright.Items[7].Selected);
                    adminGroupInfo.Allowviewrealname = BoolToByte(admingroupright.Items[8].Selected);
                    adminGroupInfo.Allowbanuser = BoolToByte(admingroupright.Items[9].Selected);
                    adminGroupInfo.Allowbanip = BoolToByte(admingroupright.Items[10].Selected);
                    adminGroupInfo.Allowmodpost = BoolToByte(admingroupright.Items[11].Selected);
                    adminGroupInfo.Allowpostannounce = BoolToByte(admingroupright.Items[12].Selected);

                    AdminGroups.CreateAdminGroupInfo(adminGroupInfo);
                
                    AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台添加管理组", "组名:" + groupTitle.Text);

                    base.RegisterStartupScript("PAGE", "window.location.href='global_adminusergroupgrid.aspx';");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_adminusergroupgrid.aspx';</script>");
                }
            }

            #endregion
        }
示例#18
0
 /// <summary>
 /// 检查是否具有版主的身份
 /// </summary>
 public void IsModer()
 {
     // 检查是否具有版主的身份
     if (useradminid != 0)
     {
         ismoder = Moderators.IsModer(useradminid, userid, forum.Fid) ? 1 : 0;
         admininfo = AdminGroups.GetAdminGroupInfo(usergroupid); //得到管理组信息
         if (admininfo != null)
             disablepostctrl = admininfo.Disablepostctrl;
     }
 }
        public void LoadUserGroupInf(int groupid)
        {
            #region �����������Ϣ

            userGroupInfo = AdminUserGroups.AdminGetUserGroupInfo(groupid);

            groupTitle.Text = Utils.RemoveFontTag(userGroupInfo.Grouptitle);
            creditshigher.Text = userGroupInfo.Creditshigher.ToString();
            creditslower.Text = userGroupInfo.Creditslower.ToString();
            stars.Text = userGroupInfo.Stars.ToString();
            color.Text = userGroupInfo.Color;
            groupavatar.Text = userGroupInfo.Groupavatar;
            readaccess.Text = userGroupInfo.Readaccess.ToString();
            maxprice.Text = userGroupInfo.Maxprice.ToString();
            maxpmnum.Text = userGroupInfo.Maxpmnum.ToString();
            maxsigsize.Text = userGroupInfo.Maxsigsize.ToString();
            maxattachsize.Text = userGroupInfo.Maxattachsize.ToString();
            maxsizeperday.Text = userGroupInfo.Maxsizeperday.ToString();
            maxspaceattachsize.Text = userGroupInfo.Maxspaceattachsize.ToString();
            maxspacephotosize.Text = userGroupInfo.Maxspacephotosize.ToString();
            //maxfriendscount.Text = userGroupInfo.MaxFriendsCount.ToString();

            if (groupid > 0 && groupid <= 3) radminid.Enabled = false;

            radminid.SelectedValue = userGroupInfo.Radminid.ToString();

            attachextensions.SetSelectByID(userGroupInfo.Attachextensions.Trim());

            //�����û�Ȩ�����ʼ����Ϣ
            adminGroupInfo = AdminUserGroups.AdminGetAdminGroupInfo(userGroupInfo.Groupid);
            usergrouppowersetting.Bind(userGroupInfo);

            if (adminGroupInfo != null)
            {
                //���ù���Ȩ�����ʼ����Ϣ
                admingroupright.SelectedIndex = -1;
                admingroupright.Items[0].Selected = adminGroupInfo.Alloweditpost == 1;
                admingroupright.Items[1].Selected = adminGroupInfo.Alloweditpoll == 1;
                admingroupright.Items[2].Selected = adminGroupInfo.Allowdelpost == 1;
                admingroupright.Items[3].Selected = adminGroupInfo.Allowmassprune == 1;
                admingroupright.Items[4].Selected = adminGroupInfo.Allowviewip == 1;
                admingroupright.Items[5].Selected = adminGroupInfo.Allowedituser == 1;
                admingroupright.Items[6].Selected = adminGroupInfo.Allowviewlog == 1;
                admingroupright.Items[7].Selected = adminGroupInfo.Disablepostctrl == 1;
                admingroupright.Items[8].Selected = adminGroupInfo.Allowviewrealname == 1;
                admingroupright.Items[9].Selected = adminGroupInfo.Allowbanuser == 1;
                admingroupright.Items[10].Selected = adminGroupInfo.Allowbanip == 1;
                admingroupright.Items[11].Selected = adminGroupInfo.Allowmodpost == 1;
                admingroupright.Items[12].Selected = adminGroupInfo.Allowpostannounce == 1;
                GeneralConfigInfo configInfo = GeneralConfigs.GetConfig();
                admingroupright.Items[13].Selected = ("," + configInfo.Reportusergroup + ",").IndexOf("," + groupid + ",") != -1; //�Ƿ�������վٱ���Ϣ
                admingroupright.Items[admingroupright.Items.Count - 1].Selected = ("," + configInfo.Photomangegroups + ",").IndexOf("," + groupid + ",") != -1;//�Ƿ��������ͼƬ����
                if (adminGroupInfo.Allowstickthread.ToString() != "") allowstickthread.SelectedValue = adminGroupInfo.Allowstickthread.ToString();

            }

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

            #endregion
        }
示例#20
0
        protected override void ShowPage()
        {
            pagetitle = "用户管理";

            if (userid == -1)
            {
                AddErrLine("请先登录");
                return;
            }
            if (ForumUtils.IsCrossSitePost(DNTRequest.GetUrlReferrer(), DNTRequest.GetHost()) || Utils.StrIsNullOrEmpty(action))
            {
                AddErrLine("非法提交");
                return;
            }
            if (action == "")
            {
                AddErrLine("操作类型参数为空");
                return;
            }
            // 如果拥有管理组身份
            admininfo = AdminGroups.GetAdminGroupInfo(usergroupid);
            // 如果所属管理组不存在
            if (admininfo == null)
            {
                AddErrLine("你没有管理权限");
                return;
            }
            if (operateduid == -1)
            {
                AddErrLine("没有选择要操作的用户");
                return;
            }
            operateduser = Users.GetShortUserInfo(operateduid);
            if (operateduser == null)
            {
                AddErrLine("选择的用户不存在");
                return;
            }
            if (operateduser.Adminid > 0)
            {
                AddErrLine("无法对拥有管理权限的用户进行操作, 请管理员登录后台进行操作");
                return;
            }
            operatedusername = operateduser.Username;
            

            if (!ispost)
            {
                Utils.WriteCookie("reurl", DNTRequest.GetUrlReferrer());
                if (action == "banuser")
                {
                    operationtitle = "禁止用户";
                    switch (operateduser.Groupid)
                    {
                        case 4:
                            bantype = 1;
                            groupexpiry = "(" + Utils.FormatDate(operateduser.Groupexpiry) + ")";
                            break;
                        case 5: 
                            bantype = 2;
                            groupexpiry = "(" + Utils.FormatDate(operateduser.Groupexpiry) + ")";
                            break;
                        case 6: 
                            bantype = 3;
                            groupexpiry = "(" + Utils.FormatDate(operateduser.Groupexpiry) + ")";
                            break;
                        default:
                            bantype = 0; 
                            break;
                    }
                    if (admininfo.Allowbanuser != 1)
                    {
                        AddErrLine("您没有禁止用户的权限");
                        return;
                    }
                }
            }
            else if (action == "banuser")
            {
                operationtitle = "禁止用户";
                DoBanUserOperation();
            }
        }
示例#21
0
        protected override void ShowPage()
        {
            //pageid = DNTRequest.GetInt("page", 1);
            pagetitle = "管理面板";
            about = DNTRequest.GetString("about");
            auditTopicCount = Topics.GetUnauditNewTopicCount(DNTRequest.GetString("forumid"), -2);
            auditPostCount = Posts.GetUnauditNewPostCount(DNTRequest.GetString("forumid"), tableid, 1);
            if (useradminid < 1 || useradminid > 3)
            {
                AddErrLine(string.Format("您当前的身份 \"{0}\" 没有管理权限", usergroupinfo.Grouptitle));
                return;
            }

            if (Utils.StrIsNullOrEmpty(Utils.GetCookie("cplogincookie")))
            {
                if (operation != "login")
                {
                    Utils.WriteCookie("reurl", DNTRequest.GetRawUrl());
                    Context.Response.Redirect(BaseConfigs.GetForumPath + "modcp.aspx?operation=login&forumid=" + forumid);
                    return;
                }
                needshowlogin = true;
            }

            Utils.WriteCookie("cplogincookie", Utils.GetCookie("cplogincookie"), 20);
            ismoder = Moderators.IsModer(useradminid, userid, forumid);
            admingroupinfo = AdminUserGroups.AdminGetAdminGroupInfo(this.usergroupid);

            if (admingroupinfo == null)
            {
                AddErrLine("您所在的管理组不存在");
                return;
            }

            #region 公告管理
            if (admingroupinfo.Allowpostannounce == 1 && Utils.InArray(operation.ToLower(), "addannouncements,list,manage,add,editannouncements,updateannouncements"))
            {
                switch (operation.ToLower())
                {
                    case "addannouncements": AddAnnouncements(); break;
                    case "list": ShowAnnouncements(); break;
                    case "manage": ManageAnnouncements(); break;
                    case "add": AddAnnouncements(); break;
                    case "editannouncements": EditAnnouncements(); break;
                    case "updateannouncements": UpdateAnnouncements(); break;
                }
                return;
            }
            #endregion

            switch (operation.ToLower())
            {
                #region 用户管理
                case "edituser":
                    if (admingroupinfo.Allowedituser == 1)
                        EditUser();
                    break;
                case "updateuser":
                    if (admingroupinfo.Allowedituser == 1)
                        UpdateUser();
                    break;
                case "banusersearch":
                    if (admingroupinfo.Allowbanuser == 1)
                        BanUserSearch();
                    break;
                case "banuser":
                    if (admingroupinfo.Allowbanuser == 1)
                        UpdateBanUser();
                    break;
                case "ipban":
                    if (admingroupinfo.Allowbanip == 1)
                    {
                        string ipkey = DNTRequest.GetInt("ip1new", 0) + "." + DNTRequest.GetInt("ip2new", 0) + "." + DNTRequest.GetInt("ip3new", 0) + "." + DNTRequest.GetInt("ip4new", 0);

                        if (ipkey == "0.0.0.0" && Utils.StrIsNullOrEmpty(DNTRequest.GetFormString("chkbanip")))
                            EditBanIp();
                        else
                        {
                            if (!VertifyIp(ipkey))
                                return;

                            BanIp(ipkey);
                            DelBanIp();
                        }
                    }
                    break;
                case "showbannedlist": ShowBannedList(); break;
                #endregion

                #region 版块管理
                case "forumaccesslist":
                    SetDropdownOptions();//带缩进的论坛信息
                    SearchForumSpecialUser();
                    if (DNTRequest.GetString("op") == "access_successful")
                        tip = "access_successful";
                    break;
                case "forumaccessupdate": UpdatePermuserListUser(); break;
                case "editforum": SetDropdownOptions(); GetForumInfo(); break;
                case "updateforum": UpdateForum(); break;
                #endregion

                #region 版块管理
                case "audittopic":
                    if (admingroupinfo.Allowmodpost == 1)
                    {
                        SetDropdownOptions();
                        posttablelist = Posts.GetAllPostTableName();
                        GetTopicList();
                        AuditNewTopic();
                    }
                    break;
                case "auditpost":
                    if (admingroupinfo.Allowmodpost == 1)
                    {
                        SetDropdownOptions();
                        posttablelist = Posts.GetAllPostTableName();
                        AuditPost();
                        GetPostList();
                    }
                    break;
                case "attention":
                    SetDropdownOptions();
                    GetAttentionTopics();
                    break;
                #endregion

                case "userout": UserOut(); break;
                case "login": Login(); break;
                case "logs": GetLogs(); break;

                case "deleteuserpost": DelUserPost(); break;
                default: break;
            }
        }
示例#22
0
        /// <summary>
        /// 获取主题帖信息
        /// </summary>
        /// <param name="admininfo"></param>
        /// <returns></returns>
        public PostInfo GetPostAndTopic(AdminGroupInfo admininfo)
        {
            PostInfo postinfo = new PostInfo();
            if (postid == -1 && topicid == -1)
            {
                AddErrLine("无效的主题ID");
                return postinfo;
            }

            if (postid != -1)
            {
                postinfo = Posts.GetPostInfo(topicid, postid);
                if (postinfo == null)
                {
                    AddErrLine("无效的帖子ID");
                    return postinfo;
                }
                if (topicid != postinfo.Tid)
                {
                    AddErrLine("主题ID无效");
                    return postinfo;
                }
            }

            if (!DNTRequest.GetString("quote").Equals(""))
            {
                if ((postinfo.Message.IndexOf("[hide]") > -1) && (postinfo.Message.IndexOf("[/hide]") > -1))
                    message = "[quote] 原帖由 [b]" + postinfo.Poster + "[/b] 于 " + postinfo.Postdatetime + " 发表\r\n ***隐藏帖*** [/quote]";
                else
                    message = "[quote] 原帖由 [b]" + postinfo.Poster + "[/b] 于 " + postinfo.Postdatetime + " 发表\r\n" + UBB.ClearAttachUBB(Utils.GetSubString(postinfo.Message, 200, "......")) + " [/quote]";
            }


            // 获取该主题的信息
            topic = Topics.GetTopicInfo(topicid);
            // 如果该主题不存在
            if (topic == null)
            {
                AddErrLine("不存在的主题ID");
                return postinfo;
            }

            topictitle = topic.Title.Trim();
            pagetitle = topictitle;
            forumid = topic.Fid;

            // 如果当前用户非管理员并且该主题已关闭,不允许用户发帖
            if ((admininfo == null || !Moderators.IsModer(admininfo.Admingid, userid, forumid)) && topic.Closed == 1)
                AddErrLine("主题已关闭无法回复");

            if (topic.Readperm > usergroupinfo.Readaccess && topic.Posterid != userid && useradminid != 1 && !Utils.InArray(username, forum.Moderators.Split(',')))
                AddErrLine("本主题阅读权限为: " + topic.Readperm + ", 您当前的身份 \"" + usergroupinfo.Grouptitle + "\" 阅读权限不够");

            return postinfo;
        }
示例#23
0
        private string condition = ""; //查询条件

        protected override void ShowPage()
        {
            if (userid > 0 && useradminid > 0)
                admingroupinfo = AdminGroups.GetAdminGroupInfo(usergroupid);

            if (config.Rssstatus == 1)
                AddLinkRss("tools/rss.aspx", "最新主题");
            
            #region 版块信息设置
            //当所选论坛为多个时或全部时
            if (forumid == -1)
            {
                //用户点选相应的论坛
                forums = (!Utils.StrIsNullOrEmpty(DNTRequest.GetString("fidlist")) ? DNTRequest.GetString("fidlist") : DNTRequest.GetString("forums")).ToLower();
                //如果是选择全部版块
                if (forums == "all")
                    forums = "";

                if (forums == "")
                {
                    foreach (ForumInfo forumInfo in Forums.GetForumList())
                        forums += string.Format(",{0}", forumInfo.Fid);
                }
                forums = Utils.StrIsNullOrEmpty(forums) ? GetAllowviewForums(forums.Trim(',')) : GetAllowviewForums(forums);
            }

            navhomemenu = Caches.GetForumListMenuDivCache(usergroupid, userid, config.Extname);
            if (forumid > 0)
            {
                forum = Forums.GetForumInfo(forumid);
                pagetitle = Utils.RemoveHtml(forum.Name);
                forumnav = ForumUtils.UpdatePathListExtname(forum.Pathlist.Trim(), config.Extname);
                showforumlogin = ShowForumLogin();

                if (!UserAuthority.VisitAuthority(forum, usergroupinfo, userid, ref msg))
                {
                    AddErrLine(msg);
                    return;
                }
                // 得到子版块列表
                subforumlist = Forums.GetSubForumCollection(forumid, forum.Colcount, config.Hideprivate, usergroupid, config.Moddisplay);
            }
            #endregion

            //设置查询条件
            SetCondition();

            if (IsErr()) return;

            pagetitle = (type == "digest" ? "查看精华" : "查看新帖");

            pmlist = (newpmcount > 0 ? PrivateMessages.GetPrivateMessageListForIndex(userid, 5, 1, 1) : null);
            SetPageIdAndNumber();
            topiclist = Topics.GetTopicListByCondition(tpp, pageid, 0, 10, config.Hottopic, forum.Autoclose, forum.Topictypeprefix, condition, GetOrder(), direct);

            OnlineUsers.UpdateAction(olid, UserAction.ShowForum.ActionID, forumid, config.Onlinetimeout);
            ForumUtils.UpdateVisitedForumsOptions(forumid);
        }
示例#24
0
        /// <summary>
        /// 获取主题帖信息
        /// </summary>
        /// <param name="admininfo"></param>
        /// <returns></returns>
        public PostInfo GetPostAndTopic(AdminGroupInfo admininfo)
        {
            PostInfo postinfo = new PostInfo();

            //如果帖子id和主题id都没有指定
            if (postid == -1 && topicid == -1)
            {
                AddErrLine("无效的主题ID");
                return postinfo;
            }

            //如果帖子id被指定
            if (postid != -1)
            {
                postinfo = Posts.GetPostInfo(topicid, postid);
                if (postinfo == null)
                {
                    AddErrLine("无效的帖子ID");
                    return postinfo;
                }
                if (topicid != postinfo.Tid)
                {
                    AddErrLine("主题ID无效");
                    return postinfo;
                }

                //如果帖子作者是禁止发言,禁止访问,禁止IP用户组或者帖子invisible属性小于0,则不允许引用及回复

                if (!string.IsNullOrEmpty(DNTRequest.GetString("quote")))
                {
                    if (Utils.InArray(Users.GetShortUserInfo(postinfo.Posterid).Groupid.ToString(), "4,5,6") || postinfo.Invisible != 0)
                        postinfo.Message = "**** 作者被禁止或删除 内容自动屏蔽 ****";

                    if ((postinfo.Message.IndexOf("[hide]") > -1) && (postinfo.Message.IndexOf("[/hide]") > -1))
                        message = string.Format("[quote] 原帖由 [b]{0}[/b] 于 {1} 发表\r\n ***隐藏帖*** [/quote]", postinfo.Poster, postinfo.Postdatetime);
                    //message = "[quote] 原帖由 [b]" + postinfo.Poster + "[/b] 于 " + postinfo.Postdatetime + " 发表\r\n ***隐藏帖*** [/quote]";
                    else
                        message = string.Format("[quote]{0}\r\n [color=#999999]{1} 发表于 {2} [/color][url={3}#{4}][img]{5}images/common/back.gif[/img][/url][/size][/quote]"
                        , UBB.ClearAttachUBB(Utils.GetSubString(postinfo.Message, 200, "......")), postinfo.Poster, postinfo.Postdatetime, DNTRequest.GetUrlReferrer(), postid, Utils.GetRootUrl(forumpath));
                }
            }

            // 获取该主题的信息
            topic = Topics.GetTopicInfo(topicid);
            // 如果该主题不存在
            if (topic == null)
            {
                AddErrLine("不存在的主题ID");
                return postinfo;
            }

            topictitle = topic.Title.Trim();
            pagetitle = topictitle;
            forumid = topic.Fid;

            // 如果当前用户非管理员并且该主题已关闭,不允许用户发帖
            if ((admininfo == null || !Moderators.IsModer(admininfo.Admingid, userid, forumid)) && topic.Closed == 1)
            {
                AddErrLine("主题已关闭无法回复");
                return postinfo;
            }

            if (topic.Readperm > usergroupinfo.Readaccess && topic.Posterid != userid && useradminid != 1)
            {
                if (forum.Moderators != null && !Utils.InArray(username, forum.Moderators.Split(',')))
                    AddErrLine("本主题阅读权限为: " + topic.Readperm + ", 您当前的身份 \"" + usergroupinfo.Grouptitle + "\" 阅读权限不够");
            }

            return postinfo;
        }
示例#25
0
 public static string GetPostMessage(UserGroupInfo usergroupinfo, AdminGroupInfo adminGroupInfo, string postmessage, bool ishtmlon)
 {
     string message;
     if (adminGroupInfo != null && adminGroupInfo.Admingid == 1)
     {
         if (usergroupinfo.Allowhtml == 0)
             message = Utils.HtmlEncode(postmessage);
         else
             message = ishtmlon ? postmessage : Utils.HtmlEncode(postmessage);
     }
     else
     {
         if (usergroupinfo.Allowhtml == 0)
             message = Utils.HtmlEncode(ForumUtils.BanWordFilter(postmessage));
         else
             message = ishtmlon ? ForumUtils.BanWordFilter(postmessage) : Utils.HtmlEncode(ForumUtils.BanWordFilter(postmessage));
     }
     return message;
 }
示例#26
0
        /// <summary>
        /// 常规项验证
        /// </summary>
        /// <param name="admininfo"></param>
        /// <param name="postmessage"></param>
        private void NormalValidate(AdminGroupInfo admininfo, string postmessage, ShortUserInfo user)
        {
            if (ForumUtils.IsCrossSitePost())
            {
                AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                return;
            }
            else if (posttitle.Length > 60)
                AddErrLine("标题最大长度为60个字符,当前为 " + posttitle.Length + " 个字符");

            if (Utils.StrIsNullOrEmpty(postmessage.Replace(" ", "")))
                AddErrLine("内容不能为空");

            if (admininfo != null && admininfo.Disablepostctrl != 1)
            {
                if (postmessage.Length < config.Minpostsize)
                    AddErrLine("您发表的内容过少, 系统设置要求帖子内容不得少于 " + config.Minpostsize + " 字多于 " + config.Maxpostsize + " 字");
                else if (postmessage.Length > config.Maxpostsize)
                    AddErrLine("您发表的内容过多, 系统设置要求帖子内容不得少于 " + config.Minpostsize + " 字多于 " + config.Maxpostsize + " 字");
            }

            if (topic.Special == 4 && DNTRequest.GetInt("debateopinion", 0) == 0)
                AddErrLine("请选择您在辩论中的观点");

            if (topic.Special == 4)
            {
                DebateInfo debateexpand = Debates.GetDebateTopic(topic.Tid);
                if (debateexpand.Terminaltime < DateTime.Now)
                    AddErrLine("此辩论主题已经到期");
            }

            //新用户广告强力屏蔽检查
            if ((config.Disablepostad == 1) && useradminid < 1)  //如果开启新用户广告强力屏蔽检查或是游客
            {
                if ((config.Disablepostadpostcount != 0 && user.Posts <= config.Disablepostadpostcount) ||
                    (config.Disablepostadregminute != 0 && DateTime.Now.AddMinutes(-config.Disablepostadregminute) <= Convert.ToDateTime(user.Joindate)))
                {
                    foreach (string regular in config.Disablepostadregular.Replace("\r", "").Split('\n'))
                    {
                        if (Posts.IsAD(regular, posttitle, postmessage))
                        {
                            AddErrLine("发帖失败,内容中有不符合新用户强力广告屏蔽规则的字符,请检查标题和内容,如有疑问请与管理员联系");
                        }
                    }
                }
            }
        }
示例#27
0
        /// <summary>
        /// 创建主题信息
        /// </summary>
        /// <param name="admininfo"></param>
        /// <param name="postmessage"></param>
        /// <param name="isbonus"></param>
        /// <param name="topicprice"></param>
        /// <returns></returns>
        public TopicInfo CreateTopic(AdminGroupInfo admininfo, string postmessage, bool isbonus, int topicprice)
        {
            TopicInfo topicinfo = new TopicInfo();
            topicinfo.Fid = forumid;
            topicinfo.Iconid = (DNTRequest.GetInt("iconid", 0) < 0 || DNTRequest.GetInt("iconid", 0) > 15) ? 0 :
                                DNTRequest.GetInt("iconid", 0);
            message = Posts.GetPostMessage(usergroupinfo, admininfo, postmessage,
                (TypeConverter.StrToInt(DNTRequest.GetString("htmlon")) == 1));

            topicinfo.Title = (useradminid == 1) ? Utils.HtmlEncode(DNTRequest.GetString("title")) :
                               Utils.HtmlEncode(ForumUtils.BanWordFilter(DNTRequest.GetString("title")));

            if (useradminid != 1 && (ForumUtils.HasBannedWord(topicinfo.Title) || ForumUtils.HasBannedWord(message)))
            {
                AddErrLine("对不起, 您提交的内容包含不良信息, 因此无法提交, 请返回修改!"); return topicinfo;
            }

            topicinfo.Typeid = DNTRequest.GetInt("typeid", 0);
            if (usergroupinfo.Allowsetreadperm == 1)
                topicinfo.Readperm = DNTRequest.GetInt("topicreadperm", 0) > 255 ? 255 : DNTRequest.GetInt("topicreadperm", 0);

            topicinfo.Price = topicprice;
            topicinfo.Poster = username;
            topicinfo.Posterid = userid;
            topicinfo.Postdatetime = curdatetime;
            topicinfo.Lastpost = curdatetime;
            topicinfo.Lastposter = username;
            topicinfo.Displayorder = Topics.GetTitleDisplayOrder(usergroupinfo, useradminid, forum, topicinfo, message, disablepost);

            string htmltitle = DNTRequest.GetString("htmltitle").Trim();
            if (!Utils.StrIsNullOrEmpty(htmltitle) && Utils.HtmlDecode(htmltitle).Trim() != topicinfo.Title)
            {
                //按照  附加位/htmltitle(1位)/magic(3位)/以后扩展(未知位数) 的方式来存储  例: 11001
                topicinfo.Magic = 11000;
            }

            //标签(Tag)操作                
            string tags = DNTRequest.GetString("tags").Trim();
            string[] tagArray = null;
            if (enabletag && !Utils.StrIsNullOrEmpty(tags))
            {
                if (ForumUtils.InBanWordArray(tags))
                {
                    AddErrLine("标签中含有系统禁止词语,请修改");
                    return topicinfo;
                }

                tagArray = Utils.SplitString(tags, " ", true, 2, 10);
                if (tagArray.Length > 0 && tagArray.Length <= 5)
                {
                    if (topicinfo.Magic == 0)
                        topicinfo.Magic = 10000;

                    topicinfo.Magic = Utils.StrToInt(topicinfo.Magic.ToString() + "1", 0);
                }
                else
                {
                    AddErrLine("超过标签数的最大限制或单个标签长度没有介于2-10之间,最多可填写 5 个标签");
                    return topicinfo;
                }
            }

            if (isbonus)
            {
                topicinfo.Special = 2;

                //检查积分是否足够
                if (mybonustranscredits < topicprice && usergroupinfo.Radminid != 1)
                {
                    AddErrLine(string.Format("无法进行悬赏<br /><br />您当前的{0}为 {1} {3}<br/>悬赏需要{0} {2} {3}", bonusextcreditsinfo.Name, mybonustranscredits, topicprice, bonusextcreditsinfo.Unit));
                    return topicinfo;
                }
                else
                    Users.UpdateUserExtCredits(topicinfo.Posterid, Scoresets.GetBonusCreditsTrans(),
                                       -topicprice * (Scoresets.GetCreditsTax() + 1)); //计算税后的实际支付
            }

            if (type == "poll")
                topicinfo.Special = 1;

            if (type == "debate") //辩论帖
                topicinfo.Special = 4;

            if (!Moderators.IsModer(useradminid, userid, forumid))
                topicinfo.Attention = 1;

            if (ForumUtils.IsHidePost(postmessage) && usergroupinfo.Allowhidecode == 1)
                topicinfo.Hide = 1;

            topicinfo.Tid = Topics.CreateTopic(topicinfo);

            canhtmltitle = config.Htmltitle == 1 && Utils.InArray(usergroupid.ToString(), config.Htmltitleusergroup);
            //保存htmltitle
            if (canhtmltitle && !Utils.StrIsNullOrEmpty(htmltitle) && htmltitle != topicinfo.Title)
                Topics.WriteHtmlTitleFile(htmltitle, topicinfo.Tid);

            if (enabletag && tagArray != null && tagArray.Length > 0)
            {
                if (ForumUtils.HasBannedWord(tags))
                {
                    AddErrLine("标签中含有系统禁止词语,请修改");
                    return topicinfo;
                }
                ForumTags.CreateTopicTags(tagArray, topicinfo.Tid, userid, curdatetime);
            }

            if (type == "debate")
            {
                DebateInfo debatetopic = new DebateInfo();
                debatetopic.Tid = topicinfo.Tid;
                debatetopic.Positiveopinion = DNTRequest.GetString("positiveopinion");
                debatetopic.Negativeopinion = DNTRequest.GetString("negativeopinion");
                debatetopic.Terminaltime = Convert.ToDateTime(DNTRequest.GetString("terminaltime"));
                Topics.CreateDebateTopic(debatetopic);
            }

            Topics.AddParentForumTopics(forum.Parentidlist.Trim(), 1, 1);
            return topicinfo;
        }
示例#28
0
        /// <summary>
        /// 置顶操作
        /// </summary>
        /// <param name="admininfo"></param>
        /// <returns></returns>
        private bool DoDisplayOrderOperation(AdminGroupInfo admininfo)
        {
            if (!ismoder)
            {
                titlemessage = true;
                AddErrLine("您没有置顶的管理权限");
                return false;
            }

            displayorder = DNTRequest.GetFormInt("level", -1);
            if (displayorder < 0 || displayorder > 3)
            {
                titlemessage = true;
                AddErrLine("置顶参数超出范围");
                return false;
            }
            // 检查用户所在管理组是否具有置顶的管理权限
            if (admininfo.Admingid != 1 && admininfo.Allowstickthread < displayorder)
            {
                titlemessage = true;
                AddErrLine(string.Format("您没有{0}级置顶的管理权限", displayorder));
                return false;
            }

            TopicAdmins.SetTopTopicList(forumid, topiclist, short.Parse(displayorder.ToString()));
            return true;
        }
示例#29
0
		/// <summary>
		/// 创建一个新的管理组信息
		/// </summary>
		/// <param name="__admingroupsInfo">要添加的管理组信息</param>
		/// <returns>更改记录数</returns>
		public int CreateAdminGroupInfo(AdminGroupInfo __admingroupsInfo)
		{
			IDataParameter[] prams = {
									  DbHelper.MakeInParam("@admingid",(DbType)SqlDbType.SmallInt,2,__admingroupsInfo.Admingid),
									  DbHelper.MakeInParam("@alloweditpost",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Alloweditpost),
									  DbHelper.MakeInParam("@alloweditpoll",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Alloweditpoll),
									  DbHelper.MakeInParam("@allowstickthread",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowstickthread),
									  DbHelper.MakeInParam("@allowmodpost",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowmodpost),
									  DbHelper.MakeInParam("@allowdelpost",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowdelpost),
									  DbHelper.MakeInParam("@allowmassprune",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowmassprune),
									  DbHelper.MakeInParam("@allowrefund",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowrefund),
									  DbHelper.MakeInParam("@allowcensorword",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowcensorword),
									  DbHelper.MakeInParam("@allowviewip",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowviewip),
									  DbHelper.MakeInParam("@allowbanip",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowbanip),
									  DbHelper.MakeInParam("@allowedituser",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowedituser),
									  DbHelper.MakeInParam("@allowmoduser",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowmoduser),
									  DbHelper.MakeInParam("@allowbanuser",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowbanuser),
									  DbHelper.MakeInParam("@allowpostannounce",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowpostannounce),
									  DbHelper.MakeInParam("@allowviewlog",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowviewlog),
									  DbHelper.MakeInParam("@disablepostctrl",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Disablepostctrl),
									  DbHelper.MakeInParam("@allowviewrealname",(DbType)SqlDbType.TinyInt,1,__admingroupsInfo.Allowviewrealname)
								  };
			return DbHelper.ExecuteNonQuery(CommandType.StoredProcedure, BaseConfigs.GetTablePrefix + "createadmingroup", prams);
		}
示例#30
0
        /// <summary>
        /// 进行相关操作
        /// </summary>
        /// <param name="forum"></param>
        /// <param name="admininfo"></param>
        /// <param name="reasonpm"></param>
        /// <returns></returns>
        private bool DoOperations(ForumInfo forum, AdminGroupInfo admininfo, int reasonpm)
        {
            string operationName = "";
            string next = DNTRequest.GetFormString("next");
            //string referer = forumpath + Urls.ShowForumAspxRewrite(forumid, 1, forum.Rewritename);
            string referer = string.Empty;
            if (operation == "delete")
                referer = forumpath + Urls.ShowForumAspxRewrite(forumid, 1, forum.Rewritename);
            else
                referer = DNTRequest.GetUrlReferrer();

            DataTable dt = null;

            #region DoOperation

            string reason = DNTRequest.GetString("reason");
            int sendmsg = DNTRequest.GetFormInt("sendmessage", 0);
            if (issendmessage && sendmsg == 0)
            {
                titlemessage = true;
                AddErrLine("操作必须发送短消息通知用户");
                return false;
            }

            if (operation != "identify" && operation != "bonus" && isreason)
            {
                if (Utils.StrIsNullOrEmpty(reason))
                {
                    titlemessage = true;
                    AddErrLine("操作原因不能为空");
                    return false;
                }
                else if (reason.Length > 200)
                {
                    titlemessage = true;
                    AddErrLine("操作原因不能多于200个字符");
                    return false;
                }
            }
            if ("delete,move,type,highlight,close,displayorder,digest,copy,split,merge,bump,repair,rate,cancelrate,delposts,identify,bonus,banpost".IndexOf(operation) == -1)
            {
                titlemessage = true;
                AddErrLine("未知的操作参数");
                return false;
            }

            //执行提交操作
            if (!Utils.StrIsNullOrEmpty(next.Trim()))
                referer = string.Format("topicadmin.aspx?action={0}&forumid={1}&topicid={2}", next, forumid, topiclist);

            int operationid = 0;
            bool istopic = false;
            string subjecttype;
            string postoperations = "rate,delposts,banpost";
            if (postoperations.Contains(operation))
            {
                dt = Posts.GetPostList(postidlist, topiclist);
                subjecttype = "帖子";
            }
            else
            {
                dt = Topics.GetTopicList(topiclist, -1);
                istopic = true;
                subjecttype = "主题";
            }

            #region switch operation
            switch (operation)
            {
                case "delete":
                    #region delete
                    operationName = "删除主题";
                    if (!DoDeleteOperation(forum))
                        return false;
                    operationid = 1;
                    break;
                    #endregion
                case "move":
                    #region move
                    operationName = "移动主题";
                    if (!DoMoveOperation())
                        return false;
                    operationid = 2;
                    break;
                    #endregion
                case "type":
                    #region type
                    operationName = "主题分类";
                    if (!DoTypeOperation())
                        return false;
                    operationid = 3;
                    break;
                    #endregion
                case "highlight":
                    #region highlight
                    operationName = "设置高亮";
                    if (!DoHighlightOperation())
                        return false;
                    operationid = 4;
                    break;
                    #endregion
                case "close":
                    #region close
                    operationName = "关闭主题/取消";
                    if (!DoCloseOperation())
                        return false;
                    operationid = 5;
                    break;
                    #endregion
                case "displayorder":
                    #region displayorder
                    operationName = "主题置顶/取消";
                    if (!DoDisplayOrderOperation(admininfo))
                        return false;
                    operationid = 6;
                    break;
                    #endregion
                case "digest": //设置精华
                    #region digest
                    operationName = "设置精华/取消";
                    if (!DoDigestOperation())
                        return false;
                    operationid = 7;
                    break;
                    #endregion
                case "copy": //复制主题";
                    #region copy
                    operationName = "复制主题";
                    if (!DoCopyOperation())
                        return false;
                    operationid = 8;
                    break;
                    #endregion
                case "split":
                    #region split
                    operationName = "分割主题";
                    if (!DoSplitOperation())
                        return false;
                    operationid = 9;
                    break;
                    #endregion
                case "merge":
                    #region merge
                    operationName = "合并主题";
                    if (!DoMergeOperation())
                        return false;
                    operationid = 10;
                    break;
                    #endregion
                case "bump": //提升主题
                    #region bump
                    operationName = "提升/下沉主题";
                    if (!DoBumpTopicsOperation())
                        return false;
                    operationid = 11;
                    break;
                    #endregion
                case "repair": //修复主题
                    #region repair
                    operationName = "修复主题";
                    if (!ismoder)
                    {
                        titlemessage = true;
                        AddErrLine("您没有修复主题的权限");
                        return false;
                    }
                    TopicAdmins.RepairTopicList(topiclist);
                    operationid = 12;
                    break;
                    #endregion
                case "rate":
                    #region rate
                    operationName = "帖子评分";
                    if (!DoRateOperation(reason))
                        return false;
                    operationid = 13;
                    break;
                    #endregion
                case "delposts":
                    #region delposts
                    operationName = "批量删帖";
                    int layer = 1;
                    bool flag = DoDelpostsOperation(reason, forum, ref layer);
                    if (layer == 0)
                        return true;
                    if (!flag)
                        return false;
                    operationid = 14;
                    break;
                    #endregion
                case "identify":
                    #region identify
                    operationName = "鉴定主题";
                    if (!DoIndentifyOperation())
                        return false;
                    operationid = 15;
                    break;
                    #endregion
                case "cancelrate":
                    #region cancelrate
                    operationName = "撤销评分";
                    if (!DoCancelRateOperation(reason))
                        return false;
                    operationid = 16;
                    break;
                    #endregion
                case "bonus":
                    #region bonus
                    operationName = "结帖";

                    if (!DoBonusOperation())
                        return false;
                    operationid = 16;
                    break;
                    #endregion
                case "banpost":
                    #region banpost
                    operationName = "屏蔽帖子";
                    if (!DoBanPostOperatopn())
                        return false;
                    operationid = 17;
                    break;
                    #endregion
                default: operationName = "未知操作"; break;
            }

            #endregion

            AddMsgLine(next.CompareTo("") == 0 ? "管理操作成功,现在将转入主题列表" : "管理操作成功,现在将转入后续操作");

            if (!operation.Equals("rate") && config.Modworkstatus == 1)
            {
                if (postidlist.Equals(""))
                {
                    foreach (string tid in topiclist.Split(','))
                    {
                        string title = "";
                        if (operation != "delete")
                        {
                            TopicInfo topicinfo = Topics.GetTopicInfo(Utils.StrToInt(tid, -1));
                            title = topicinfo.Title;
                        }
                        AdminModeratorLogs.InsertLog(userid.ToString(), username, usergroupid.ToString(),
                                                       usergroupinfo.Grouptitle, Utils.GetRealIP(),
                                                       Utils.GetDateTime(), forumid.ToString(), forumname,
                                                       tid, title, operationName, reason);
                    }
                }
                else
                {
                    string[] postarray = postidlist.Split(',');
                    TopicInfo topinfo = Topics.GetTopicInfo(Utils.StrToInt(topiclist, -1));
                    foreach (string postid in postarray)
                    {
                        PostInfo postinfo = Posts.GetPostInfo(Utils.StrToInt(topiclist, 0), Utils.StrToInt(postid, 0));
                        string postitle = topinfo.Title;
                        if (postinfo == null && operation == "delposts")
                            subjecttype = "回复的主题";
                        else if (postinfo.Title == "" && operation == "delposts")
                            subjecttype = "回复的主题";
                        else
                            postitle = postinfo.Title;

                        AdminModeratorLogs.InsertLog(userid.ToString(), username, usergroupid.ToString(),
                                                     usergroupinfo.Grouptitle, Utils.GetRealIP(),
                                                     Utils.GetDateTime(), forumid.ToString(), forumname,
                                                     postid, postitle, operationName, reason);
                    }
                }
            }
            SendMessage(operationid, dt, istopic, operationName, reason, sendmsg, subjecttype);

            //执行完某一操作后转到后续操作
            SetUrl(referer);
            if (next != string.Empty)
                HttpContext.Current.Response.Redirect(BaseConfigs.GetForumPath + referer, false);
            else
                AddScript("window.setTimeout('redirectURL()', 2000);function redirectURL() {window.location='" + referer + "';}");

            SetShowBackLink(false);

            #endregion

            return true;
        }