Ejemplo n.º 1
0
        private void UpdateUserGroupInf_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                this.userGroupInfo                  = UserGroup.FindByID(DNTRequest.GetInt("groupid", -1));
                this.userGroupInfo.System           = 0;
                this.userGroupInfo.Type             = 0;
                this.userGroupInfo.Readaccess       = Convert.ToInt32(this.readaccess.Text);
                this.userGroupInfo.AllowViewstats   = false;
                this.userGroupInfo.AllowNickName    = false;
                this.userGroupInfo.AllowHtml        = false;
                this.userGroupInfo.AllowCstatus     = false;
                this.userGroupInfo.AllowUsebLog     = false;
                this.userGroupInfo.AllowInvisible   = false;
                this.userGroupInfo.AllowTransfer    = false;
                this.userGroupInfo.AllowMultigroups = false;
                this.userGroupInfo.ReasonPm         = 0;
                Users.UpdateUserAdminIdByGroupId(this.userGroupInfo.RadminID, this.userGroupInfo.ID);
                this.userGroupInfo.GroupTitle         = this.groupTitle.Text;
                this.userGroupInfo.Creditshigher      = Convert.ToInt32(this.creditshigher.Text);
                this.userGroupInfo.Creditslower       = Convert.ToInt32(this.creditslower.Text);
                this.userGroupInfo.Stars              = Convert.ToInt32(this.stars.Text);
                this.userGroupInfo.Color              = this.color.Text;
                this.userGroupInfo.Groupavatar        = this.groupavatar.Text;
                this.userGroupInfo.MaxPrice           = Convert.ToInt32(this.maxprice.Text);
                this.userGroupInfo.MaxPmNum           = Convert.ToInt32(this.maxpmnum.Text);
                this.userGroupInfo.MaxSigSize         = Convert.ToInt32(this.maxsigsize.Text);
                this.userGroupInfo.MaxAttachSize      = Convert.ToInt32(this.maxattachsize.Text);
                this.userGroupInfo.MaxSizeperday      = Convert.ToInt32(this.maxsizeperday.Text);
                this.userGroupInfo.MaxSpaceattachSize = Convert.ToInt32(this.maxspaceattachsize.Text);
                this.userGroupInfo.MaxSpacephotoSize  = Convert.ToInt32(this.maxspacephotosize.Text);
                this.userGroupInfo.AttachExtensions   = this.attachextensions.GetSelectString(",");
                this.usergrouppowersetting.GetSetting(ref this.userGroupInfo);
                //if (AdminUserGroups.UpdateUserGroupInfo(this.userGroupInfo))
                userGroupInfo.Save();
                {
                    DNTCache.Current.RemoveObject(CacheKeys.FORUM_USER_GROUP_LIST);

                    //DNTCache.Current.RemoveObject(CacheKeys.FORUM_ADMIN_GROUP_LIST);
                    AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台更新系统组", "组ID:" + DNTRequest.GetInt("groupid", -1));
                    base.RegisterStartupScript("PAGE", "window.location.href='global_sysadminusergroupgrid.aspx';");
                    return;
                }
                base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_sysadminusergroupgrid.aspx';</script>");
            }
        }
Ejemplo n.º 2
0
        private void UpdateUserGroupInf_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                foreach (DictionaryEntry dictionaryEntry in new Hashtable
                {
                    {
                        "附件最大尺寸",
                        this.maxattachsize.Text
                    },

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

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

                    {
                        "相册空间总尺寸",
                        this.maxspacephotosize.Text
                    }
                })
                {
                    if (!Utils.IsInt(dictionaryEntry.Value.ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('输入错误," + dictionaryEntry.Key.ToString() + "只能是0或者正整数');window.location.href='global_editadminusergroup.aspx';</script>");
                        return;
                    }
                }
                this.userGroupInfo            = UserGroup.FindByID(DNTRequest.GetInt("groupid", -1));
                this.userGroupInfo.System     = 0;
                this.userGroupInfo.Type       = 0;
                this.userGroupInfo.Readaccess = Convert.ToInt32(this.readaccess.Text);
                int num = Convert.ToInt32(this.radminid.SelectedValue);
                if (num > 0 && num <= 3)
                {
                    adminGroupInfo                   = new AdminGroup();
                    adminGroupInfo.AdmingID          = (short)this.userGroupInfo.ID;
                    adminGroupInfo.AllowEditPost     = admingroupright.Items[0].Selected;
                    adminGroupInfo.AllowEditpoll     = admingroupright.Items[1].Selected;
                    adminGroupInfo.AllowStickthread  = Convert.ToInt16(this.allowstickthread.SelectedValue) > 0;
                    adminGroupInfo.AllowModPost      = false;
                    adminGroupInfo.AllowDelPost      = admingroupright.Items[2].Selected;
                    adminGroupInfo.AllowMassprune    = admingroupright.Items[3].Selected;
                    adminGroupInfo.AllowRefund       = false;
                    adminGroupInfo.AllowCensorword   = false;
                    adminGroupInfo.AllowViewIP       = admingroupright.Items[4].Selected;
                    adminGroupInfo.AllowBanIP        = false;
                    adminGroupInfo.AllowEditUser     = admingroupright.Items[5].Selected;
                    adminGroupInfo.AllowModUser      = false;
                    adminGroupInfo.AllowBanUser      = false;
                    adminGroupInfo.AllowPostannounce = false;
                    adminGroupInfo.AllowViewLog      = admingroupright.Items[6].Selected;
                    adminGroupInfo.DisablePostctrl   = admingroupright.Items[7].Selected;
                    adminGroupInfo.AllowViewrealName = admingroupright.Items[8].Selected;
                    adminGroupInfo.AllowBanUser      = admingroupright.Items[9].Selected;
                    adminGroupInfo.AllowBanIP        = admingroupright.Items[10].Selected;
                    adminGroupInfo.AllowModPost      = admingroupright.Items[11].Selected;
                    adminGroupInfo.AllowPostannounce = admingroupright.Items[12].Selected;

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

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

                    //config.Save();;
                    DNTCache.Current.RemoveObject(CacheKeys.FORUM_USER_GROUP_LIST);
                    AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台更新管理组", "组名:" + this.groupTitle.Text);
                    base.RegisterStartupScript("PAGE", "window.location.href='global_adminusergroupgrid.aspx';");
                    return;
                }
                base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_adminusergroupgrid.aspx';</script>");
            }
        }
Ejemplo n.º 3
0
        private void UpdateUserGroupInf_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                foreach (DictionaryEntry dictionaryEntry in new Hashtable
                {
                    {
                        "附件最大尺寸",
                        this.maxattachsize.Text
                    },

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

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

                    {
                        "相册空间总尺寸",
                        this.maxspacephotosize.Text
                    }
                })
                {
                    if (!Utils.IsInt(dictionaryEntry.Value.ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('输入错误," + dictionaryEntry.Key.ToString() + "只能是0或者正整数');window.location.href='global_editusergroup.aspx';</script>");
                        return;
                    }
                }
                if (this.creditshigher.Enabled && (Convert.ToInt32(this.creditshigher.Text) < Convert.ToInt32(this.ViewState["creditshigher"].ToString()) || Convert.ToInt32(this.creditslower.Text) > Convert.ToInt32(this.ViewState["creditslower"].ToString())))
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败, 您所输入的积分上下限范围应在" + this.ViewState["creditshigher"].ToString() + "至" + this.ViewState["creditslower"].ToString() + "之间');</script>");
                }
                else
                {
                    this.userGroupInfo            = UserGroup.FindByID(DNTRequest.GetInt("groupid", -1));
                    this.userGroupInfo.System     = 0;
                    this.userGroupInfo.Type       = 0;
                    this.userGroupInfo.Readaccess = Convert.ToInt32(this.readaccess.Text);
                    this.usergrouppowersetting.GetSetting(ref this.userGroupInfo);
                    this.userGroupInfo.GroupTitle    = this.groupTitle.Text;
                    this.userGroupInfo.Creditshigher = Convert.ToInt32(this.creditshigher.Text);
                    this.userGroupInfo.Creditslower  = Convert.ToInt32(this.creditslower.Text);
                    if (this.userGroupInfo.Creditshigher >= this.userGroupInfo.Creditslower)
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败, 积分下限必须小于积分上限');</script>");
                        return;
                    }
                    if (this.userGroupInfo.AllowBonus && this.userGroupInfo.MinBonusprice >= this.userGroupInfo.MaxBonusprice)
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败, 最低悬赏价格必须小于最高悬赏价格');</script>");
                        return;
                    }
                    this.userGroupInfo.Stars              = Convert.ToInt32(this.stars.Text);
                    this.userGroupInfo.Color              = this.color.Text;
                    this.userGroupInfo.Groupavatar        = this.groupavatar.Text;
                    this.userGroupInfo.MaxPrice           = Convert.ToInt32(this.maxprice.Text);
                    this.userGroupInfo.MaxPmNum           = Convert.ToInt32(this.maxpmnum.Text);
                    this.userGroupInfo.MaxSigSize         = Convert.ToInt32(this.maxsigsize.Text);
                    this.userGroupInfo.MaxAttachSize      = Convert.ToInt32(this.maxattachsize.Text);
                    this.userGroupInfo.MaxSizeperday      = Convert.ToInt32(this.maxsizeperday.Text);
                    this.userGroupInfo.MaxSpaceattachSize = Convert.ToInt32(this.maxspaceattachsize.Text);
                    this.userGroupInfo.MaxSpacephotoSize  = Convert.ToInt32(this.maxspacephotosize.Text);
                    this.userGroupInfo.AttachExtensions   = this.attachextensions.GetSelectString(",");
                    //if (AdminUserGroups.UpdateUserGroupInfo(this.userGroupInfo))
                    userGroupInfo.Save();
                    {
                        DNTCache.Current.RemoveObject(CacheKeys.FORUM_USER_GROUP_LIST);
                        UserGroup.FindAllWithCache();
                        AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台更新用户组", "组ID:" + DNTRequest.GetInt("groupid", -1));
                        base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupgrid.aspx';");
                        return;
                    }
                    if (AdminUserGroups.opresult != "")
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupgrid.aspx';</script>");
                        return;
                    }
                    base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupgrid.aspx';</script>");
                    return;
                }
                return;
            }
        }
Ejemplo n.º 4
0
        private void UpdateUserGroupInf_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                foreach (DictionaryEntry dictionaryEntry in new Hashtable
                {
                    {
                        "附件最大尺寸",
                        this.maxattachsize.Text
                    },

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

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

                    {
                        "相册空间总尺寸",
                        this.maxspacephotosize.Text
                    }
                })
                {
                    if (!Utils.IsInt(dictionaryEntry.Value.ToString()))
                    {
                        base.RegisterStartupScript("", "<script>alert('输入错误," + dictionaryEntry.Key.ToString() + "只能是0或者正整数');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                        return;
                    }
                }
                this.userGroupInfo            = UserGroup.FindByID(DNTRequest.GetInt("groupid", -1));
                this.userGroupInfo.System     = 0;
                this.userGroupInfo.Type       = 0;
                this.userGroupInfo.Readaccess = Convert.ToInt32(this.readaccess.Text);
                int num = (this.radminid.SelectedValue == "0") ? -1 : Convert.ToInt32(this.radminid.SelectedValue);
                this.userGroupInfo.RadminID = num;
                if (num.ToString() != this.ViewState["radminid"].ToString())
                {
                    Users.UpdateUserAdminIdByGroupId(this.userGroupInfo.RadminID, this.userGroupInfo.ID);
                }
                this.userGroupInfo.GroupTitle         = this.groupTitle.Text;
                this.userGroupInfo.Stars              = Convert.ToInt32(this.stars.Text);
                this.userGroupInfo.Color              = this.color.Text;
                this.userGroupInfo.Groupavatar        = this.groupavatar.Text;
                this.userGroupInfo.MaxPrice           = Convert.ToInt32(this.maxprice.Text);
                this.userGroupInfo.MaxPmNum           = Convert.ToInt32(this.maxpmnum.Text);
                this.userGroupInfo.MaxSigSize         = Convert.ToInt32(this.maxsigsize.Text);
                this.userGroupInfo.MaxAttachSize      = Convert.ToInt32(this.maxattachsize.Text);
                this.userGroupInfo.MaxSizeperday      = Convert.ToInt32(this.maxsizeperday.Text);
                this.userGroupInfo.MaxSpaceattachSize = Convert.ToInt32(this.maxspaceattachsize.Text);
                this.userGroupInfo.MaxSpacephotoSize  = Convert.ToInt32(this.maxspacephotosize.Text);
                this.userGroupInfo.AttachExtensions   = this.attachextensions.GetSelectString(",");
                this.usergrouppowersetting.GetSetting(ref this.userGroupInfo);
                //if (AdminUserGroups.UpdateUserGroupInfo(this.userGroupInfo))
                userGroupInfo.Save();
                {
                    DNTCache.Current.RemoveObject(CacheKeys.FORUM_USER_GROUP_LIST);
                    UserGroup.FindAllWithCache();
                    AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除特殊用户组", "组ID:" + DNTRequest.GetInt("groupid", -1));
                    base.RegisterStartupScript("PAGE", "window.location.href='global_usergroupspecialgrid.aspx';");
                    return;
                }
                if (AdminUserGroups.opresult != "")
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                    return;
                }
                base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupspecialgrid.aspx';</script>");
            }
        }