Beispiel #1
0
        public static bool PostReply(ForumInfo forum, int userid, UserGroupInfo usergroupinfo, TopicInfo topic)
        {
            bool canreply = (usergroupinfo.Radminid == 1);

            //是否有回复的权限
            if (topic.Closed == 0)
            {
                if (userid > -1 && Forums.AllowReplyByUserID(forum.Permuserlist, userid))
                {
                    canreply = true;
                }
                else
                {
                    if (Utils.StrIsNullOrEmpty(forum.Replyperm)) //权限设置为空时,根据用户组权限判断
                    {
                        // 验证用户是否有发表主题的权限
                        if (usergroupinfo.Allowreply == 1)
                        {
                            canreply = true;
                        }
                    }
                    else if (Forums.AllowReply(forum.Replyperm, usergroupinfo.Groupid))
                    {
                        canreply = true;
                    }
                }
            }
            return(canreply);
        }