Exemplo n.º 1
0
        public static string opresult = ""; //存储操作结果或返回给用户的信息

        #endregion Fields

        #region Methods

        /// <summary>
        /// 添加用户组信息
        /// </summary>
        /// <param name="userGroupInfo"></param>
        /// <returns></returns>
        public static bool AddUserGroupInfo(UserGroupInfo userGroupInfo)
        {
            try
            {
                int Creditshigher = userGroupInfo.ug_scorehight;
                int Creditslower = userGroupInfo.ug_scorelow;
                DataTable dt = SAS.Data.DataProvider.UserGroups.GetUserGroupByCreditsHigherAndLower(Creditshigher, Creditslower);
                if (dt.Rows.Count > 0)
                    return false;

                if (userGroupInfo.ug_pg_id == 0 && !SystemCheckCredits("add", ref Creditshigher, ref Creditslower, 0))
                    return false;

                userGroupInfo.ug_scorehight = Creditshigher;
                userGroupInfo.ug_scorelow = Creditslower;
                Data.DataProvider.UserGroups.CreateUserGroup(userGroupInfo);
                Data.DataProvider.OnlineUsers.AddOnlineList(userGroupInfo.ug_name);

                Caches.ReSetAdminGroupList();
                Caches.ReSetUserGroupList();
                return true;
            }
            catch
            {
                return false;
            }
        }
        public void GetSetting(ref UserGroupInfo usergroupinfo)
        {
            usergroupinfo.ug_allowsearch = Convert.ToInt32(allowsearch.SelectedValue);
            //usergroupinfo.Allowavatar = Convert.ToInt32(allowavatar.SelectedValue);
            usergroupinfo.Reasonpm = Convert.ToInt32(reasonpm.SelectedValue);

            usergroupinfo.ug_allowvisit = usergroupright.Items[0].Selected ? 1 : 0; //是否允许访问论坛
            usergroupinfo.Allowpost = usergroupright.Items[1].Selected ? 1 : 0; //是否允许发帖
            usergroupinfo.Allowreply = usergroupright.Items[2].Selected ? 1 : 0; //是否允许回复
            usergroupinfo.Allowpostpoll = usergroupright.Items[3].Selected ? 1 : 0; //是否允许发起投票
            usergroupinfo.Allowvote = usergroupright.Items[4].Selected ? 1 : 0; //是否允许参与投票
            usergroupinfo.Allowpostattach = usergroupright.Items[5].Selected ? 1 : 0; //是否发布附件
            usergroupinfo.ug_allowdown = usergroupright.Items[6].Selected ? 1 : 0; //是否允许下载附件
            usergroupinfo.Allowsetreadperm = usergroupright.Items[7].Selected ? 1 : 0; //是否允许设置主题阅读积分权限
            usergroupinfo.Allowsetattachperm = usergroupright.Items[8].Selected ? 1 : 0; //是否允许设置附件阅读积分限制
            usergroupinfo.Ug_allowhidecode = usergroupright.Items[9].Selected ? 1 : 0; //是否允许使用hide代码
            usergroupinfo.Ug_allowcusbbcode = usergroupright.Items[10].Selected ? 1 : 0; //是否允许使用Discuz!NT代码
            //usergroupinfo.Allowsigbbcode = usergroupright.Items[11].Selected ? 1 : 0; //签名是否支持Discuz!NT代码
            //usergroupinfo.Allowsigimgcode = usergroupright.Items[12].Selected ? 1 : 0; //签名是否支持图片代码
            usergroupinfo.Allowviewpro = usergroupright.Items[11].Selected ? 1 : 0; //是否允许查看用户资料
            usergroupinfo.Disableperiodctrl = usergroupright.Items[12].Selected ? 1 : 0; //是否不受时间段限制

            //usergroupinfo.Allowdebate = usergroupright.Items[15].Selected ? 1 : 0; //是否允许辩论
            //usergroupinfo.Allowbonus = usergroupright.Items[16].Selected ? 1 : 0; //是否允许悬赏
            //如果勾选允许悬赏
            //if (usergroupright.Items[16].Selected)
            //{
            //    usergroupinfo.Minbonusprice = DNTRequest.GetInt("minbonusprice", 0);
            //    usergroupinfo.Maxbonusprice = DNTRequest.GetInt("maxbonusprice", 0);
            //}
            //else
            //{
            //    usergroupinfo.Minbonusprice = 0;
            //    usergroupinfo.Maxbonusprice = 0;
            //}
            usergroupinfo.Allowviewstats = usergroupright.Items[13].Selected ? 1 : 0; //是否允许查看统计数据
            //usergroupinfo.Allowdiggs = usergroupright.Items[18].Selected ? 1 : 0;   //是否允许辩论支持
            usergroupinfo.Ug_allowhtml = usergroupright.Items[14].Selected ? 1 : 0;    //是否允许html
            usergroupinfo.ug_allowshop = usergroupright.Items[15].Selected ? 1 : 0;    //是否允许交易
            //if (MallPluginProvider.GetInstance() != null)
            //{
            //    usergroupinfo.Allowtrade = usergroupright.Items[usergroupright.Items.Count - 1].Selected ? 1 : 0;   //是否允许交易
            //}
        }
        public void Bind(UserGroupInfo usergroupinfo)
        {
            if (usergroupinfo.ug_allowsearch.ToString() == "0") allowsearch.Items[0].Selected = true;
            if (usergroupinfo.ug_allowsearch.ToString() == "1") allowsearch.Items[1].Selected = true;
            if (usergroupinfo.ug_allowsearch.ToString() == "2") allowsearch.Items[2].Selected = true;

            //if (usergroupinfo.Allowavatar >= 0) allowavatar.Items[usergroupinfo.Allowavatar].Selected = true;
            reasonpm.Items[usergroupinfo.Reasonpm].Selected = true;

            if (usergroupinfo.ug_allowvisit == 1) usergroupright.Items[0].Selected = true; //是否允许访问论坛
            if (usergroupinfo.Allowpost == 1) usergroupright.Items[1].Selected = true; //是否允许发帖
            if (usergroupinfo.Allowreply == 1) usergroupright.Items[2].Selected = true; //是否允许回复
            if (usergroupinfo.Allowpostpoll == 1) usergroupright.Items[3].Selected = true; //是否允许发起投票
            if (usergroupinfo.Allowvote == 1) usergroupright.Items[4].Selected = true; //是否允许参与投票
            if (usergroupinfo.Allowpostattach == 1) usergroupright.Items[5].Selected = true; //是否发布附件
            if (usergroupinfo.ug_allowdown == 1) usergroupright.Items[6].Selected = true; //是否允许下载附件
            if (usergroupinfo.Allowsetreadperm == 1) usergroupright.Items[7].Selected = true; //是否允许设置主题阅读积分权限
            if (usergroupinfo.Allowsetattachperm == 1) usergroupright.Items[8].Selected = true; //是否允许设置附件阅读积分限制
            if (usergroupinfo.Ug_allowhidecode == 1) usergroupright.Items[9].Selected = true; //是否允许使用hide代码
            if (usergroupinfo.Ug_allowcusbbcode == 1) usergroupright.Items[10].Selected = true; //是否允许使用Discuz!NT代码
            //if (usergroupinfo.Allowsigbbcode == 1) usergroupright.Items[11].Selected = true; //签名是否支持Discuz!NT代码
            //if (usergroupinfo.Allowsigimgcode == 1) usergroupright.Items[12].Selected = true; //签名是否支持图片代码
            if (usergroupinfo.Allowviewpro == 1) usergroupright.Items[11].Selected = true; //是否允许查看用户资料
            if (usergroupinfo.Disableperiodctrl == 1) usergroupright.Items[12].Selected = true; //是否不受时间段限制
            //if (usergroupinfo.Allowdebate == 1) usergroupright.Items[15].Selected = true; //是否允许辩论
            //if (usergroupinfo.Allowbonus == 1) usergroupright.Items[16].Selected = true; //是否允许悬赏
            if (usergroupinfo.Allowviewstats == 1) usergroupright.Items[13].Selected = true; //是否允许查看统计数据
            //if (usergroupinfo.Allowdiggs == 1) usergroupright.Items[18].Selected = true; //是否允许辩论支持
            if (usergroupinfo.Ug_allowhtml == 1) usergroupright.Items[14].Selected = true; //是否允许html
            if (usergroupinfo.ug_allowshop == 1) usergroupright.Items[15].Selected = true; //是否允许交易

            //if (MallPluginProvider.GetInstance() != null && usergroupinfo.Allowtrade == 1) usergroupright.Items[usergroupright.Items.Count - 1].Selected = true; //是否允许交易

            //string strScript = "<script type='text/javascript'>\r\nfunction insertBonusPrice()\r\n{\r\n\t";
            //strScript += "\r\n\tvar tdelement = document.getElementById('" + usergroupright.ClientID + "_16').parentNode;";
            //strScript += "\r\n\ttdelement.innerHTML += '&nbsp;最低悬赏价格:<input type=\"text\" name=\"minbonusprice\" id=\"minbonusprice\" class=\"FormBase\" onblur=\"this.className=\\'FormBase\\';\" onfocus=\"this.className=\\'FormFocus\\';\" size=\"4\" maxlength=\"5\" value=\"" + usergroupinfo.Minbonusprice + "\"" + (usergroupinfo.Allowbonus == 0 ? " disabled=\"disabled \"" : "") + " />'";
            //strScript += "\r\n\ttdelement.innerHTML += '&nbsp;最高悬赏价格:<input type=\"text\" name=\"maxbonusprice\" id=\"maxbonusprice\" class=\"FormBase\" onblur=\"this.className=\\'FormBase\\';\" onfocus=\"this.className=\\'FormFocus\\';\" size=\"4\" maxlength=\"5\" value=\"" + usergroupinfo.Maxbonusprice + "\"" + (usergroupinfo.Allowbonus == 0 ? " disabled=\"disabled \"" : "") + " />'";
            //strScript += "\r\n}\r\ninsertBonusPrice();\r\n</script>\r\n";
            //outscript.Text = strScript;
            //usergroupright.Items[16].Attributes.Add("onclick", "bonusPriceSet(this.checked)");
        }
Exemplo n.º 4
0
        /// <summary>
        /// 得到用户可以上传的文件类型
        /// </summary>
        /// <param name="usergroupinfo">当前用户所属用户组信息</param>
        /// <param name="forum">所在版块</param>
        /// <returns></returns>
        public static string GetAllowAttachmentType(UserGroupInfo usergroupinfo, ForumInfo forum)
        {
            //得到用户可以上传的文件类型
            StringBuilder sbAttachmentTypeSelect = new StringBuilder();
            if (!usergroupinfo.ug_attachextensions.Trim().Equals(""))
            {
                sbAttachmentTypeSelect.Append("[id] in (");
                sbAttachmentTypeSelect.Append(usergroupinfo.ug_attachextensions);
                sbAttachmentTypeSelect.Append(")");
            }

            if (!forum.Attachextensions.Equals(""))
            {
                if (sbAttachmentTypeSelect.Length > 0)
                    sbAttachmentTypeSelect.Append(" AND ");

                sbAttachmentTypeSelect.Append("[id] in (");
                sbAttachmentTypeSelect.Append(forum.Attachextensions);
                sbAttachmentTypeSelect.Append(")");
            }
            return sbAttachmentTypeSelect.ToString();
        }
        public void LoadUserGroupInf(int groupid)
        {
            #region 加载相关组信息

            userGroupInfo = AdminUserGroups.AdminGetUserGroupInfo(groupid);

            groupTitle.Text = Utils.RemoveFontTag(userGroupInfo.ug_name);
            creditshigher.Text = userGroupInfo.ug_scorehight.ToString();
            creditslower.Text = userGroupInfo.ug_scorelow.ToString();
            stars.Text = userGroupInfo.Stars.ToString();
            color.Text = userGroupInfo.ug_color;
            groupavatar.Text = userGroupInfo.ug_logo;
            readaccess.Text = userGroupInfo.ug_readaccess.ToString();
            //maxprice.Text = userGroupInfo.Maxprice.ToString();
            maxpmnum.Text = userGroupInfo.Maxpmnum.ToString();
            maxsigsize.Text = userGroupInfo.ug_maxsigsize.ToString();
            maxattachsize.Text = userGroupInfo.Ug_maxattachsize.ToString();
            maxsizeperday.Text = userGroupInfo.Ug_maxsizeperday.ToString();
            maxspaceattachsize.Text = userGroupInfo.ug_maxspaceattachsize.ToString();
            maxspacephotosize.Text = userGroupInfo.ug_maxspacephotosize.ToString();

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

            if (groupid > 0 && groupid <= 3) radminid.Enabled = false;
            radminid.SelectedValue = userGroupInfo.ug_pg_id.ToString();

            usergrouppowersetting.Bind(userGroupInfo);

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

            #endregion
        }
        private void AddUserGroupInf_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_editusergroup.aspx';</script>");
                        return;
                    }
                }
                UserGroupInfo userGroupInfo = new UserGroupInfo();
                userGroupInfo.ug_isSystem = 0;
                //userGroupInfo.Type = 0;
                userGroupInfo.ug_readaccess = Convert.ToInt32(readaccess.Text == "" ? "0" : readaccess.Text);
                userGroupInfo.ug_pg_id = 0;
                userGroupInfo.ug_name = groupTitle.Text;
                userGroupInfo.ug_scorehight = Convert.ToInt32(creditshigher.Text);
                userGroupInfo.ug_scorelow = Convert.ToInt32(creditslower.Text);
                usergrouppowersetting.GetSetting(ref userGroupInfo);
                if (userGroupInfo.ug_scorehight >= userGroupInfo.ug_scorelow)
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败, 积分下限必须小于积分上限');</script>");
                    return;
                }
                //if (userGroupInfo.Allowbonus == 1 && (userGroupInfo.Minbonusprice >= userGroupInfo.Maxbonusprice))
                //{
                //    base.RegisterStartupScript("", "<script>alert('操作失败, 最低悬赏价格必须小于最高悬赏价格');</script>");
                //    return;
                //}
                userGroupInfo.Stars = Convert.ToInt32(stars.Text);
                userGroupInfo.ug_color = color.Text;
                userGroupInfo.ug_logo = groupavatar.Text;
                //userGroupInfo.Maxprice = Convert.ToInt32(maxprice.Text);
                userGroupInfo.Maxpmnum = Convert.ToInt32(maxpmnum.Text);
                userGroupInfo.ug_maxsigsize = Convert.ToInt32(maxsigsize.Text);
                userGroupInfo.Ug_maxattachsize = Convert.ToInt32(maxattachsize.Text);
                userGroupInfo.Ug_maxsizeperday = Convert.ToInt32(maxsizeperday.Text);
                userGroupInfo.ug_maxspaceattachsize = Convert.ToInt32(maxspaceattachsize.Text);
                userGroupInfo.ug_maxspacephotosize = Convert.ToInt32(maxspacephotosize.Text);
                userGroupInfo.ug_attachextensions = attachextensions.GetSelectString(",");
                //userGroupInfo.Raterange = "";

                if (AdminUserGroups.AddUserGroupInfo(userGroupInfo))
                {
                    SAS.Cache.SASCache.GetCacheService().RemoveObject("/SAS/UserGroupList");
                    UserGroups.GetUserGroupList();

                    AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台添加用户组", "组名:" + groupTitle.Text);

                    base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupgrid.aspx';");
                }
                else
                {
                    if (AdminUserGroups.opresult != "")
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupgrid.aspx';</script>");
                    }
                    else
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupgrid.aspx';</script>");
                    }
                }
            }

            #endregion
        }
        private void UpdateUserGroupInf_Click(object sender, EventArgs e)
        {
            #region 更新系统管理组信息

            if (this.CheckCookie())
            {
                userGroupInfo = AdminUserGroups.AdminGetUserGroupInfo(SASRequest.GetInt("groupid", -1));
                userGroupInfo.ug_isSystem = 0;
                userGroupInfo.ug_readaccess = Convert.ToInt32(readaccess.Text);
                userGroupInfo.Allowviewstats = 0;
                userGroupInfo.Allownickname = 0;
                userGroupInfo.Ug_allowhtml = 0;
                userGroupInfo.ug_allowshop = 0;
                userGroupInfo.ug_allowinvisible = 0;
                userGroupInfo.Reasonpm = 0;

                if (radminid.SelectedValue == "0") //当未选取任何管理模板时
                {
                    SAS.Logic.AdminGroups.DeleteAdminGroupInfo((short)userGroupInfo.ug_id);
                    userGroupInfo.ug_pg_id = 0;
                }

                Users.UpdateUserAdminIdByGroupId(userGroupInfo.ug_pg_id, userGroupInfo.ug_id);
                userGroupInfo.ug_name = groupTitle.Text;
                userGroupInfo.ug_scorehight = Convert.ToInt32(creditshigher.Text);
                userGroupInfo.ug_scorelow = Convert.ToInt32(creditslower.Text);
                userGroupInfo.Stars = Convert.ToInt32(stars.Text);
                userGroupInfo.ug_color = color.Text;
                userGroupInfo.ug_logo = groupavatar.Text;
                //userGroupInfo.Maxprice = Convert.ToInt32(maxprice.Text);
                userGroupInfo.Maxpmnum = Convert.ToInt32(maxpmnum.Text);
                userGroupInfo.ug_maxsigsize = Convert.ToInt32(maxsigsize.Text);
                userGroupInfo.Ug_maxattachsize = Convert.ToInt32(maxattachsize.Text);
                userGroupInfo.Ug_maxsizeperday = Convert.ToInt32(maxsizeperday.Text);
                userGroupInfo.ug_maxspaceattachsize = Convert.ToInt32(maxspaceattachsize.Text);
                userGroupInfo.ug_maxspacephotosize = Convert.ToInt32(maxspacephotosize.Text);
                userGroupInfo.ug_attachextensions = attachextensions.GetSelectString(",");

                usergrouppowersetting.GetSetting(ref userGroupInfo);

                if (AdminUserGroups.UpdateUserGroupInfo(userGroupInfo))
                {
                    SAS.Cache.SASCache.GetCacheService().RemoveObject("/SAS/UserGroupList");
                    SAS.Cache.SASCache.GetCacheService().RemoveObject("/SAS/AdminGroupList");
                    AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台更新系统组", "组ID:" + SASRequest.GetInt("groupid", -1));
                    base.RegisterStartupScript("PAGE", "window.location.href='global_sysadminusergroupgrid.aspx';");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_sysadminusergroupgrid.aspx';</script>");
                }
            }

            #endregion
        }
Exemplo n.º 8
0
        /// <summary>
        /// BasePage类构造函数
        /// </summary>
        public BasePage()
        {
            config = GeneralConfigs.GetConfig();
            //if (SpacePluginProvider.GetInstance() == null)
            //    config.Enablespace = 0;
            if (AlbumPluginProvider.GetInstance() == null)
                config.Enablealbum = 0;
            //if (MallPluginProvider.GetInstance() == null)
            //    config.Enablemall = 0;
            LoadUrlConfig();
            userid = Utils.StrToInt(LogicUtils.GetCookie("userid"), -1);

            //清空当前页面查询统计
            #if DEBUG
            SAS.Data.DbHelper.QueryCount = 0;
            SAS.Data.DbHelper.QueryDetail = "";
            #endif

            // 如果启用游客页面缓存,则对游客输出缓存页
            if (userid == -1 && config.Guestcachepagetimeout > 0 && GetUserCachePage(pagename))
                return;
            AddMetaInfo(config.Seokeywords, config.Seodescription, config.Seohead);

            if (config.Nocacheheaders == 1)
            {
                System.Web.HttpContext.Current.Response.BufferOutput = false;
                System.Web.HttpContext.Current.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
                System.Web.HttpContext.Current.Response.Cache.SetExpires(DateTime.Now.AddDays(-1));
                System.Web.HttpContext.Current.Response.Expires = 0;
                System.Web.HttpContext.Current.Response.CacheControl = "no-cache";
                System.Web.HttpContext.Current.Response.Cache.SetNoStore();
            }

            //当为forumlist.aspx或forumindex.aspx,可能出现在线并发问题,这时系统会延时2秒
            if ((pagename != "zshy.aspx") && (pagename != "index.aspx"))
                oluserinfo = OnlineUsers.UpdateInfo(config.Passwordkey, config.Onlinetimeout);
            else
            {
                try
                {
                    oluserinfo = OnlineUsers.UpdateInfo(config.Passwordkey, config.Onlinetimeout);
                }
                catch
                {
                    System.Threading.Thread.Sleep(2000);
                    oluserinfo = OnlineUsers.UpdateInfo(config.Passwordkey, config.Onlinetimeout);
                }
            }

            userid = oluserinfo.Ol_ps_id;
            usergroupid = oluserinfo.Ol_ug_id;
            username = oluserinfo.Ol_name;
            password = oluserinfo.Ol_password;
            userkey = password.Length > 16 ? password.Substring(4, 8).Trim() : "";
            //lastposttime = oluserinfo.Lastposttime;
            lastpostpmtime = oluserinfo.Ol_lastpostpmtime;
            lastsearchtime = oluserinfo.Ol_lastsearchtime;
            olid = oluserinfo.Ol_id;

            //确保头像可以取到
            //if (userid > 0)
            //    useravatar = Avatars.GetAvatarUrl(userid.ToString(), AvatarSize.Small);

            if (Utils.InArray(SASRequest.GetString("selectedtemplateid"), Templates.GetValidTemplateIDList()))
                templateid = SASRequest.GetInt("selectedtemplateid", 0);
            else if (Utils.InArray(Utils.GetCookie(Utils.GetTemplateCookieName()), Templates.GetValidTemplateIDList()))
                templateid = Utils.StrToInt(Utils.GetCookie(Utils.GetTemplateCookieName()), config.Templateid);

            if (templateid == 0)
                templateid = config.Templateid;

            pmsound = Utils.StrToInt(LogicUtils.GetCookie("pmsound"), 0);

            usergroupinfo = UserGroups.GetUserGroupInfo(usergroupid);

            // 取得用户权限id,1管理员,2超版,3版主,0普通组,-1特殊组
            useradminid = usergroupinfo.ug_pg_id;

            mainnavigation = Navs.GetNavigationString(userid, useradminid);
            subnavigation = Navs.GetSubNavigation();
            mainnavigationhassub = Navs.GetMainNavigationHasSub();

            // 如果论坛关闭且当前用户请求页面不是登录页面且用户非管理员, 则跳转至论坛关闭信息页
            if (config.Closed == 1 && pagename != "login.aspx" && pagename != "logout.aspx" && pagename != "register.aspx" && useradminid != 1)
            {
                ShowMessage(1);
                return;
            }

            onlineusercount = (userid != -1) ? OnlineUsers.GetOnlineAllUserCount() : OnlineUsers.GetCacheOnlineAllUserCount();

            //校验用户是否可以访问站点
            if (!ValidateUserPermission())
                return;

            //更新用户在线时长
            if (userid != -1)
                OnlineUsers.UpdateOnlineTime(config.Oltimespan, userid);

            templatepath = Templates.GetTemplateItem(templateid).Directory;
            nowdate = Utils.GetDate();
            nowtime = Utils.GetTime();
            nowdatetime = Utils.GetDateTime();
            ispost = SASRequest.IsPost();
            isget = SASRequest.IsGet();
            link = "";
            script = "";

            templatelistboxoptions = Caches.GetTemplateListBoxOptionsCache();

            string originalTemplate = string.Format("<li><a href=\"###\" onclick=\"window.location.href='{0}showtemplate.aspx?templateid={1}'\">",
                                   "", BaseConfigs.GetSitePath, templateid);
            string newTemplate = string.Format("<li class=\"current\"><a href=\"###\" onclick=\"window.location.href='{0}showtemplate.aspx?templateid={1}'\">",
                                     BaseConfigs.GetSitePath, templateid);
            templatelistboxoptions = templatelistboxoptions.Replace(originalTemplate, newTemplate);

            isseccode = Utils.InArray(pagename, config.Seccodestatus);
            //headerad = Advertisements.GetOneHeaderAd("", 0);
            //footerad = Advertisements.GetOneFooterAd("", 0);

            //校验验证码
            if (isseccode && ispost && !ValidateVerifyCode())
                return;

            //newtopicminute = config.Viewnewtopicminute;
            m_starttick = DateTime.Now;

            Companies.GetCompanyCountSum(out allcount, out passcount, out todaycount, out waitcount);

            ShowPage();

            m_processtime = DateTime.Now.Subtract(m_starttick).TotalMilliseconds / 1000;

            querycount = SAS.Data.DbHelper.QueryCount;
            SAS.Data.DbHelper.QueryCount = 0;

            #if DEBUG
            querydetail = SAS.Data.DbHelper.QueryDetail;
            SAS.Data.DbHelper.QueryDetail = "";
            #endif
        }
Exemplo n.º 9
0
        /// <summary>
        /// 获得用户组数据
        /// </summary>
        /// <returns>用户组数据</returns>
        public static List<UserGroupInfo> GetUserGroupList()
        {
            DataTable dt = GetUserGroupForDataTable();
            List<UserGroupInfo> userGruopInfoList = new List<UserGroupInfo>();

            foreach (DataRow dr in dt.Rows)
            {
                UserGroupInfo info = new UserGroupInfo();

                info.ug_id = TypeConverter.StrToInt(dr["ug_id"].ToString());
                info.ug_name = dr["ug_name"].ToString();
                info.ug_scorehight = TypeConverter.StrToInt(dr["ug_scorehight"].ToString());
                info.ug_scorelow = TypeConverter.StrToInt(dr["ug_scorelow"].ToString());
                info.ug_logo = dr["ug_logo"].ToString().Trim();
                info.ug_readaccess = TypeConverter.StrToInt(dr["ug_readaccess"].ToString().Trim());
                info.Ug_allowcusbbcode = TypeConverter.StrToInt(dr["ug_allowcusbbcode"].ToString().Trim());
                info.ug_allowvisit = TypeConverter.StrToInt(dr["ug_allowvisit"].ToString());
                info.ug_allowcommunity = TypeConverter.StrToInt(dr["ug_allowcommunity"].ToString());
                info.ug_allowdown = TypeConverter.StrToInt(dr["ug_allowdown"].ToString());
                info.ug_allowup = TypeConverter.StrToInt(dr["ug_allowup"].ToString());
                info.ug_allowsearch = TypeConverter.StrToInt(dr["ug_allowsearch"].ToString());
                info.ug_allowavatar = TypeConverter.StrToInt(dr["ug_allowavatar"].ToString());
                info.ug_allowshop = TypeConverter.StrToInt(dr["ug_allowshop"].ToString());
                info.ug_allowinvisible = TypeConverter.StrToInt(dr["ug_allowinvisible"].ToString());
                info.Ug_allowhidecode = TypeConverter.StrToInt(dr["ug_allowhidecode"].ToString());
                info.Ug_allowhtml = TypeConverter.StrToInt(dr["ug_allowhtml"].ToString());
                info.Ug_maxattachsize = TypeConverter.StrToInt(dr["ug_maxattachsize"].ToString());
                info.Ug_maxsizeperday = TypeConverter.StrToInt(dr["ug_maxsizeperday"].ToString());
                info.ug_attachextensions = dr["ug_attachextensions"].ToString();
                info.ug_maxspaceattachsize = TypeConverter.StrToInt(dr["ug_maxspaceattachsize"].ToString());
                info.ug_maxspacephotosize = TypeConverter.StrToInt(dr["ug_maxspacephotosize"].ToString());
                info.ug_maxsigsize = TypeConverter.StrToInt(dr["ug_maxsigsize"].ToString());
                info.ug_pg_id = TypeConverter.StrToInt(dr["ug_pg_id"].ToString());
                info.ug_color = dr["ug_color"].ToString();
                info.ug_isSystem = TypeConverter.StrToInt(dr["ug_isSystem"].ToString());
                info.Allowsetreadperm = TypeConverter.StrToInt(dr["allowsetreadperm"].ToString());
                info.Allowpostattach = TypeConverter.StrToInt(dr["allowpostattach"].ToString());
                info.Allowsetattachperm = TypeConverter.StrToInt(dr["allowsetattachperm"].ToString());
                info.Stars = TypeConverter.StrToInt(dr["stars"].ToString());
                info.Allowpost = TypeConverter.StrToInt(dr["allowpost"].ToString());
                info.Allowreply = TypeConverter.StrToInt(dr["allowreply"].ToString());
                info.Allowpostpoll = TypeConverter.StrToInt(dr["allowpostpoll"].ToString());
                info.Allowvote = TypeConverter.StrToInt(dr["allowvote"].ToString());
                info.Allownickname = TypeConverter.StrToInt(dr["allownickname"].ToString());
                info.Allowviewpro = TypeConverter.StrToInt(dr["allowviewpro"].ToString());
                info.Allowviewstats = TypeConverter.StrToInt(dr["allowviewstats"].ToString());
                info.Disableperiodctrl = TypeConverter.StrToInt(dr["disableperiodctrl"].ToString());
                info.Reasonpm = TypeConverter.StrToInt(dr["reasonpm"].ToString());
                info.Maxpmnum = TypeConverter.StrToInt(dr["maxpmnum"].ToString());

                userGruopInfoList.Add(info);
            }
            return userGruopInfoList;
        }
        public void LoadUserGroupInf(int groupid)
        {
            #region 加载相关组信息

            userGroupInfo = AdminUserGroups.AdminGetUserGroupInfo(groupid);

            groupTitle.Text = Utils.RemoveFontTag(userGroupInfo.ug_name);
            creditshigher.Text = userGroupInfo.ug_scorehight.ToString();
            creditslower.Text = userGroupInfo.ug_scorelow.ToString();
            stars.Text = userGroupInfo.Stars.ToString();
            color.Text = userGroupInfo.ug_color;
            groupavatar.Text = userGroupInfo.ug_logo;
            readaccess.Text = userGroupInfo.ug_readaccess.ToString();
            //maxprice.Text = userGroupInfo.Maxprice.ToString();
            maxpmnum.Text = userGroupInfo.Maxpmnum.ToString();
            maxsigsize.Text = userGroupInfo.ug_maxsigsize.ToString();
            maxattachsize.Text = userGroupInfo.Ug_maxattachsize.ToString();
            maxsizeperday.Text = userGroupInfo.Ug_maxsizeperday.ToString();
            maxspaceattachsize.Text = userGroupInfo.ug_maxspaceattachsize.ToString();
            maxspacephotosize.Text = userGroupInfo.ug_maxspacephotosize.ToString();

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

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

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

            //设置用户权限组初始化信息
            adminGroupInfo = AdminUserGroups.AdminGetAdminGroupInfo(userGroupInfo.ug_id);
            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[1].Selected = adminGroupInfo.Allowdelpost == 1;
                admingroupright.Items[2].Selected = adminGroupInfo.Allowmassprune == 1;
                admingroupright.Items[3].Selected = adminGroupInfo.Allowviewip == 1;
                admingroupright.Items[4].Selected = adminGroupInfo.Allowedituser == 1;
                admingroupright.Items[5].Selected = adminGroupInfo.Allowviewlog == 1;
                //admingroupright.Items[7].Selected = adminGroupInfo.Disablepostctrl == 1;
                admingroupright.Items[6].Selected = adminGroupInfo.Allowviewrealname == 1;
                admingroupright.Items[7].Selected = adminGroupInfo.Allowbanuser == 1;
                admingroupright.Items[8].Selected = adminGroupInfo.Allowbanip == 1;
                admingroupright.Items[9].Selected = adminGroupInfo.Allowmodpost == 1;
                admingroupright.Items[10].Selected = adminGroupInfo.Allowpostannounce == 1;
                //GeneralConfigInfo configInfo = GeneralConfigs.GetConfig();
                //admingroupright.Items[11].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
        }
Exemplo n.º 11
0
 /// <summary>
 /// 更新在线表
 /// </summary>
 /// <param name="userGroupInfo"></param>
 public void UpdateOnlineList(UserGroupInfo userGroupInfo)
 {
     DbParameter[] parms = {
                                 DbHelper.MakeInParam("@groupid", (DbType)SqlDbType.Int, 4, userGroupInfo.ug_id),
                                 DbHelper.MakeInParam("@title", (DbType)SqlDbType.NVarChar, 50, Utils.RemoveFontTag(userGroupInfo.ug_name))
                             };
     string commandText = string.Format("UPDATE [{0}userGroupIcon] SET [ui_ug_name]=@title WHERE [ui_id]=@groupid", BaseConfigs.GetTablePrefix);
     DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
 }
Exemplo n.º 12
0
        public void AddUserGroup(UserGroupInfo userGroupInfo)
        {
            DbParameter[] parms =
                    {
                        DbHelper.MakeInParam("@Radminid",(DbType)SqlDbType.Int,4,userGroupInfo.ug_pg_id),
                        DbHelper.MakeInParam("@Grouptitle",(DbType)SqlDbType.VarChar,200, Utils.RemoveFontTag(userGroupInfo.ug_name)),
                        DbHelper.MakeInParam("@Creditshigher",(DbType)SqlDbType.Int,4,userGroupInfo.ug_scorehight),
                        DbHelper.MakeInParam("@Creditslower",(DbType)SqlDbType.Int,4, userGroupInfo.ug_scorelow),
                        DbHelper.MakeInParam("@Stars",(DbType)SqlDbType.Int,4,userGroupInfo.Stars),
                        DbHelper.MakeInParam("@Color",(DbType)SqlDbType.Char,7,userGroupInfo.ug_color),
                        DbHelper.MakeInParam("@Groupavatar",(DbType)SqlDbType.NVarChar,60,userGroupInfo.ug_logo),
                        DbHelper.MakeInParam("@Readaccess",(DbType)SqlDbType.Int,4,userGroupInfo.ug_readaccess),
                        DbHelper.MakeInParam("@Allowcommunity",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowcommunity),
                        DbHelper.MakeInParam("@Allowvisit",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowvisit),
                        DbHelper.MakeInParam("@Allowpost",(DbType)SqlDbType.Int,4,userGroupInfo.Allowpost),
                        DbHelper.MakeInParam("@Allowreply",(DbType)SqlDbType.Int,4,userGroupInfo.Allowreply),
                        DbHelper.MakeInParam("@Allowpostpoll",(DbType)SqlDbType.Int,4,userGroupInfo.Allowpostpoll),
                        DbHelper.MakeInParam("@Allowgetattach",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowdown),
                        DbHelper.MakeInParam("@Allowpostattach",(DbType)SqlDbType.Int,4,userGroupInfo.Allowpostattach),
                        DbHelper.MakeInParam("@Allowvote",(DbType)SqlDbType.Int,4,userGroupInfo.Allowvote),
                        DbHelper.MakeInParam("@Allowsearch",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowsearch),
                        DbHelper.MakeInParam("@Allowavatar",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowavatar),
                        DbHelper.MakeInParam("@Allowshop",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowshop),
                        DbHelper.MakeInParam("@Allowinvisible",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowinvisible),
                        DbHelper.MakeInParam("@Allowsetreadperm",(DbType)SqlDbType.Int,4,userGroupInfo.Allowsetreadperm),
                        DbHelper.MakeInParam("@Allowsetattachperm",(DbType)SqlDbType.Int,4,userGroupInfo.Allowsetattachperm),
                        DbHelper.MakeInParam("@Allowhidecode",(DbType)SqlDbType.Int,4,userGroupInfo.Ug_allowhidecode),
                        DbHelper.MakeInParam("@Allowhtml",(DbType)SqlDbType.Int,4,userGroupInfo.Ug_allowhtml),
                        DbHelper.MakeInParam("@Allowcusbbcode",(DbType)SqlDbType.Int,4,userGroupInfo.Ug_allowcusbbcode),
                        DbHelper.MakeInParam("@Allownickname",(DbType)SqlDbType.Int,4,userGroupInfo.Allownickname),
                        DbHelper.MakeInParam("@Allowviewpro",(DbType)SqlDbType.Int,4,userGroupInfo.Allowviewpro),
                        DbHelper.MakeInParam("@Allowviewstats",(DbType)SqlDbType.Int,4,userGroupInfo.Allowviewstats),
                        DbHelper.MakeInParam("@Disableperiodctrl",(DbType)SqlDbType.Int,4,userGroupInfo.Disableperiodctrl),
                        DbHelper.MakeInParam("@Reasonpm",(DbType)SqlDbType.Int,4,userGroupInfo.Reasonpm),
                        DbHelper.MakeInParam("@Maxpmnum",(DbType)SqlDbType.SmallInt,2,userGroupInfo.Maxpmnum),
                        DbHelper.MakeInParam("@Maxsigsize",(DbType)SqlDbType.SmallInt,2,userGroupInfo.ug_maxsigsize),
                        DbHelper.MakeInParam("@Maxattachsize",(DbType)SqlDbType.Int,4,userGroupInfo.Ug_maxattachsize),
                        DbHelper.MakeInParam("@Maxsizeperday",(DbType)SqlDbType.Int,4,userGroupInfo.Ug_maxsizeperday),
                        DbHelper.MakeInParam("@Attachextensions",(DbType)SqlDbType.Char,100,userGroupInfo.ug_attachextensions),
                        DbHelper.MakeInParam("@Maxspaceattachsize",(DbType)SqlDbType.Int,4,userGroupInfo.ug_maxspaceattachsize),
                        DbHelper.MakeInParam("@Maxspacephotosize",(DbType)SqlDbType.Int,4,userGroupInfo.ug_maxspacephotosize)
                    };

            string commandText = string.Format("INSERT INTO [{0}userGroup]  ([ug_pg_id],[ug_name],[ug_scorehight],[ug_scorelow],[stars] ,[ug_color],[ug_logo], " +
                                                "[ug_readaccess],[ug_allowcommunity],[ug_allowvisit],[allowpost],[allowreply],[allowpostpoll], [ug_allowdown]," +
                                                "[allowpostattach],[allowvote],[ug_allowsearch],[ug_allowavatar],[ug_allowshop],[ug_allowinvisible]," +
                                                "[allowsetreadperm],[[allowsetattachperm],[Ug_allowhidecode],[Ug_allowhtml],[Ug_allowcusbbcode]," +
                                                "[allownickname],[allowviewpro],[allowviewstats],[disableperiodctrl],[reasonpm],[maxpmnum],[ug_maxsigsize]," +
                                                "[Ug_maxattachsize],[Ug_maxsizeperday],[ug_attachextensions],[ug_maxspaceattachsize],[ug_maxspacephotosize]) VALUES(" +
                                                "@Radminid,@Grouptitle,@Creditshigher,@Creditslower,@Stars,@Color,@Groupavatar,@Readaccess,@Allowcommunity,@Allowvisit,@Allowpost," +
                                                "@Allowreply,@Allowpostpoll,@Allowgetattach,@Allowpostattach,@Allowvote,@Allowsearch,@Allowavatar,@Allowshop," +
                                                "@Allowinvisible,@Allowsetreadperm,@Allowsetattachperm,@Allowhidecode,@Allowhtml,@Allowcusbbcode,@Allownickname," +
                                                "@Allowviewpro,@Allowviewstats,@Disableperiodctrl,@Reasonpm,@Maxpmnum,@Maxsigsize,@Maxattachsize," +
                                                "@Maxsizeperday,@Attachextensions,@Maxspaceattachsize,@Maxspacephotosize)",
                                                 BaseConfigs.GetTablePrefix);

            DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
        }
Exemplo n.º 13
0
 /// <summary>
 /// 更新用户组信息
 /// </summary>
 /// <param name="info">用户组信息</param>
 public static void UpdateUserGroup(UserGroupInfo info)
 {
     DatabaseProvider.GetInstance().UpdateUserGroup(info);
 }
Exemplo n.º 14
0
 /// <summary>
 /// 创建用户组信息
 /// </summary>
 /// <param name="userGroupInfo">用户组信息</param>
 public static void CreateUserGroup(UserGroupInfo userGroupInfo)
 {
     DatabaseProvider.GetInstance().AddUserGroup(userGroupInfo);
 }
Exemplo n.º 15
0
        /// <summary>
        /// 更新用户组信息
        /// </summary>
        /// <param name="userGroupInfo">用户组信息</param>
        /// <returns></returns>
        public static bool UpdateUserGroupInfo(UserGroupInfo userGroupInfo)
        {
            int Creditshigher = userGroupInfo.ug_scorehight;
            int Creditslower = userGroupInfo.ug_scorelow;

            if ((userGroupInfo.ug_id >= 9) && (userGroupInfo.ug_pg_id == 0))
            {
                //当已存在的用户组积分上下限不是当前组的时候,则不允许编辑
                DataTable dt = SAS.Data.DataProvider.UserGroups.GetUserGroupByCreditsHigherAndLower(Creditshigher, Creditslower);
                if (dt.Rows.Count > 0 && userGroupInfo.ug_id.ToString() != dt.Rows[0][0].ToString())
                    return false;

                if (!SystemCheckCredits("update", ref Creditshigher, ref Creditslower, userGroupInfo.ug_id))
                    return false;
            }

            UserGroups.UpdateUserGroup(userGroupInfo);
            SAS.Data.DataProvider.UserGroups.UpdateOnlineList(userGroupInfo);

            Caches.ReSetAdminGroupList();
            Caches.ReSetUserGroupList();
            return true;
        }
        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(SASRequest.GetInt("groupid", -1));
                userGroupInfo.ug_isSystem = 0;
                //userGroupInfo.Type = 0;
                userGroupInfo.ug_readaccess = Convert.ToInt32(readaccess.Text);

                int selectradminid = Convert.ToInt32(radminid.SelectedValue);
                //对于当前用户组中,有管理权限的,则设置管理权限
                if (selectradminid > 0 && selectradminid <= 3)
                {
                    adminGroupInfo = new AdminGroupInfo();
                    adminGroupInfo.Admingid = (short)userGroupInfo.ug_id;
                    adminGroupInfo.AdminGroupName = "";
                    //插入相应的管理组
                    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[1].Selected);
                    adminGroupInfo.Allowmassprune = BoolToByte(admingroupright.Items[2].Selected);
                    //adminGroupInfo.Allowrefund = 0;
                    adminGroupInfo.Allowcensorword = 0; ;
                    adminGroupInfo.Allowviewip = BoolToByte(admingroupright.Items[3].Selected);
                    adminGroupInfo.Allowbanip = 0;
                    adminGroupInfo.Allowedituser = BoolToByte(admingroupright.Items[4].Selected);
                    adminGroupInfo.Allowmoduser = 0;
                    adminGroupInfo.Allowbanuser = 0;
                    adminGroupInfo.Allowpostannounce = 0;
                    adminGroupInfo.Allowviewlog = BoolToByte(admingroupright.Items[5].Selected);
                    //adminGroupInfo.Disablepostctrl = BoolToByte(admingroupright.Items[7].Selected);
                    adminGroupInfo.Allowviewrealname = BoolToByte(admingroupright.Items[6].Selected);
                    adminGroupInfo.Allowbanuser = BoolToByte(admingroupright.Items[7].Selected);
                    adminGroupInfo.Allowbanip = BoolToByte(admingroupright.Items[8].Selected);
                    adminGroupInfo.Allowmodpost = BoolToByte(admingroupright.Items[9].Selected);
                    adminGroupInfo.Allowpostannounce = BoolToByte(admingroupright.Items[10].Selected);

                    SAS.Logic.AdminGroups.SetAdminGroupInfo(adminGroupInfo, userGroupInfo.ug_id);
                    userGroupInfo.ug_pg_id = selectradminid;
                }
                else
                    userGroupInfo.ug_pg_id = 0;

                AdminGroups.ChangeUserAdminidByGroupid(userGroupInfo.ug_pg_id, userGroupInfo.ug_id);

                userGroupInfo.ug_name = groupTitle.Text;
                userGroupInfo.ug_scorehight = Convert.ToInt32(creditshigher.Text);
                userGroupInfo.ug_scorelow = Convert.ToInt32(creditslower.Text);
                userGroupInfo.Stars = Convert.ToInt32(stars.Text);
                userGroupInfo.ug_color = color.Text;
                userGroupInfo.ug_logo = groupavatar.Text;
                //userGroupInfo.Maxprice = Convert.ToInt32(maxprice.Text);
                userGroupInfo.Maxpmnum = Convert.ToInt32(maxpmnum.Text);
                userGroupInfo.ug_maxsigsize = Convert.ToInt32(maxsigsize.Text);
                userGroupInfo.Ug_maxattachsize = Convert.ToInt32(maxattachsize.Text);
                userGroupInfo.Ug_maxsizeperday = Convert.ToInt32(maxsizeperday.Text);
                userGroupInfo.ug_maxspaceattachsize = Convert.ToInt32(maxspaceattachsize.Text);
                userGroupInfo.ug_maxspacephotosize = Convert.ToInt32(maxspacephotosize.Text);
                userGroupInfo.ug_attachextensions = attachextensions.GetSelectString(",");

                usergrouppowersetting.GetSetting(ref userGroupInfo);

                if (AdminUserGroups.UpdateUserGroupInfo(userGroupInfo))
                {
                    #region 是否允许接收举报信息和管理图片评论
                    GeneralConfigInfo configInfo = GeneralConfigs.GetConfig();
                    ////是否允许接收举报信息
                    //int groupid = userGroupInfo.ug_id;
                    //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
                    SAS.Cache.SASCache.GetCacheService().RemoveObject("/SAS/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
        }
Exemplo n.º 17
0
        /// <summary>
        /// 更新用户组信息
        /// </summary>
        /// <param name="userGroupInfo">用户组信息</param>
        public void UpdateUserGroup(UserGroupInfo userGroupInfo)
        {
            DbParameter[] parms =
                    {
                        DbHelper.MakeInParam("@Radminid",(DbType)SqlDbType.Int,4,(userGroupInfo.ug_id == 1) ? 1 : userGroupInfo.ug_pg_id),
                        DbHelper.MakeInParam("@Grouptitle",(DbType)SqlDbType.NVarChar,50, Utils.RemoveFontTag(userGroupInfo.ug_name)),
                        DbHelper.MakeInParam("@Creditshigher",(DbType)SqlDbType.Int,4,userGroupInfo.ug_scorehight),
                        DbHelper.MakeInParam("@Creditslower",(DbType)SqlDbType.Int,4, userGroupInfo.ug_scorelow),
                        DbHelper.MakeInParam("@Stars",(DbType)SqlDbType.Int,4,userGroupInfo.Stars),
                        DbHelper.MakeInParam("@Color",(DbType)SqlDbType.Char,7,userGroupInfo.ug_color),
                        DbHelper.MakeInParam("@Groupavatar",(DbType)SqlDbType.NVarChar,60,userGroupInfo.ug_logo),
                        DbHelper.MakeInParam("@Readaccess",(DbType)SqlDbType.Int,4,userGroupInfo.ug_readaccess),
                        DbHelper.MakeInParam("@Allowcommunity",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowcommunity),
                        DbHelper.MakeInParam("@Allowvisit",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowvisit),
                        DbHelper.MakeInParam("@Allowpost",(DbType)SqlDbType.Int,4,userGroupInfo.Allowpost),
                        DbHelper.MakeInParam("@Allowreply",(DbType)SqlDbType.Int,4,userGroupInfo.Allowreply),
                        DbHelper.MakeInParam("@Allowpostpoll",(DbType)SqlDbType.Int,4,userGroupInfo.Allowpostpoll),
                        DbHelper.MakeInParam("@Allowgetattach",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowdown),
                        DbHelper.MakeInParam("@Allowpostattach",(DbType)SqlDbType.Int,4,userGroupInfo.Allowpostattach),
                        DbHelper.MakeInParam("@Allowvote",(DbType)SqlDbType.Int,4,userGroupInfo.Allowvote),
                        DbHelper.MakeInParam("@Allowsearch",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowsearch),
                        DbHelper.MakeInParam("@Allowavatar",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowavatar),
                        DbHelper.MakeInParam("@Allowuseblog",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowshop),
                        DbHelper.MakeInParam("@Allowinvisible",(DbType)SqlDbType.Int,4,userGroupInfo.ug_allowinvisible),
                        DbHelper.MakeInParam("@Allowsetreadperm",(DbType)SqlDbType.Int,4,userGroupInfo.Allowsetreadperm),
                        DbHelper.MakeInParam("@Allowsetattachperm",(DbType)SqlDbType.Int,4,userGroupInfo.Allowsetattachperm),
                        DbHelper.MakeInParam("@Allowhidecode",(DbType)SqlDbType.Int,4,userGroupInfo.Ug_allowhidecode),
                        DbHelper.MakeInParam("@Allowhtml",(DbType)SqlDbType.Int,4,userGroupInfo.Ug_allowhtml),
                        DbHelper.MakeInParam("@Allowcusbbcode",(DbType)SqlDbType.Int,4,userGroupInfo.Ug_allowcusbbcode),
                        DbHelper.MakeInParam("@Allownickname",(DbType)SqlDbType.Int,4,userGroupInfo.Allownickname),
                        DbHelper.MakeInParam("@Allowviewpro",(DbType)SqlDbType.Int,4,userGroupInfo.Allowviewpro),
                        DbHelper.MakeInParam("@Allowviewstats",(DbType)SqlDbType.Int,4,userGroupInfo.Allowviewstats),
                        DbHelper.MakeInParam("@Disableperiodctrl",(DbType)SqlDbType.Int,4,userGroupInfo.Disableperiodctrl),
                        DbHelper.MakeInParam("@Reasonpm",(DbType)SqlDbType.Int,4,userGroupInfo.Reasonpm),
                        DbHelper.MakeInParam("@Maxpmnum",(DbType)SqlDbType.SmallInt,2,userGroupInfo.Maxpmnum),
                        DbHelper.MakeInParam("@Maxsigsize",(DbType)SqlDbType.SmallInt,2,userGroupInfo.ug_maxsigsize),
                        DbHelper.MakeInParam("@Maxattachsize",(DbType)SqlDbType.Int,4,userGroupInfo.Ug_maxattachsize),
                        DbHelper.MakeInParam("@Maxsizeperday",(DbType)SqlDbType.Int,4,userGroupInfo.Ug_maxsizeperday),
                        DbHelper.MakeInParam("@Attachextensions",(DbType)SqlDbType.Char,100,userGroupInfo.ug_attachextensions),
                        DbHelper.MakeInParam("@Maxspaceattachsize",(DbType)SqlDbType.Int,4,userGroupInfo.ug_maxspaceattachsize),
                        DbHelper.MakeInParam("@Maxspacephotosize",(DbType)SqlDbType.Int,4,userGroupInfo.ug_maxspacephotosize),
                        DbHelper.MakeInParam("@Groupid",(DbType)SqlDbType.Int,4,userGroupInfo.ug_id)
            };

            string commandText = string.Format("UPDATE [{0}userGroup]  SET [ug_pg_id]=@Radminid,[ug_name]=@Grouptitle,[ug_scorehight]=@Creditshigher," +
                                                "[ug_scorelow]=@Creditslower,[stars]=@Stars,[ug_color]=@Color,[ug_logo]=@Groupavatar,[ug_readaccess]=@Readaccess,[ug_allowcommunity]=@Allowcommunity," +
                                                "[ug_allowvisit]=@Allowvisit,[allowpost]=@Allowpost,[allowreply]=@Allowreply,[allowpostpoll]=@Allowpostpoll, [ug_allowdown]=@Allowgetattach," +
                                                "[allowpostattach]=@Allowpostattach,[allowvote]=@Allowvote,[ug_allowsearch]=@Allowsearch,[ug_allowavatar]=@Allowavatar," +
                                                "[ug_allowshop]=@Allowuseblog,[ug_allowinvisible]=@Allowinvisible,[allowsetreadperm]=@Allowsetreadperm,[allowsetattachperm]=@Allowsetattachperm," +
                                                "[ug_allowhidecode]=@Allowhidecode,[ug_allowhtml]=@Allowhtml,[ug_allowcusbbcode]=@Allowcusbbcode,[allownickname]=@Allownickname,[allowviewpro]=@Allowviewpro," +
                                                "[allowviewstats]=@Allowviewstats,[disableperiodctrl]=@Disableperiodctrl,[reasonpm]=@Reasonpm,[maxpmnum]=@Maxpmnum," +
                                                "[ug_maxsigsize]=@Maxsigsize,[ug_maxattachsize]=@Maxattachsize,[ug_maxsizeperday]=@Maxsizeperday,[ug_attachextensions]=@Attachextensions," +
                                                "[ug_maxspaceattachsize]=@Maxspaceattachsize,[ug_maxspacephotosize]=@Maxspacephotosize  WHERE [ug_id]=@Groupid",
                                                BaseConfigs.GetTablePrefix);

            DbHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
        }
Exemplo n.º 18
0
 /// <summary>
 /// 上传附件权限控制
 /// </summary>
 /// <param name="forum">版块信息</param>
 /// <param name="usergroupinfo">当前用户的用户组信息</param>
 /// <param name="userId">当前用户Id</param>
 /// <returns></returns>
 public static bool PostAttachAuthority(ForumInfo forum, UserGroupInfo userGroupInfo, int userId, ref string msg)
 {
     if (!Forums.AllowPostAttachByUserID(forum.Permuserlist, userId))
     {
         if (!Forums.AllowPostAttach(forum.Postattachperm, userGroupInfo.ug_id))
         {
             msg = "您没有在该版块上传附件的权限";
             return false;
         }
         else if (userGroupInfo.Allowpostattach != 1)
         {
             msg = string.Format("您当前的身份 \"{0}\" 没有上传附件的权限", userGroupInfo.ug_name);
             return false;
         }
     }
     return true;
 }
Exemplo n.º 19
0
 /// <summary>
 /// 更新用户组信息
 /// </summary>
 /// <param name="info">用户组信息</param>
 public static void UpdateUserGroup(UserGroupInfo info)
 {
     Data.DataProvider.UserGroups.UpdateUserGroup(info);
 }