private void DeleteUserGroupInf_Click(object sender, EventArgs e)
        {
            #region  除用户组
            if (this.CheckCookie())
            {
                if (AdminUserGroups.DeleteUserGroupInfo(DNTRequest.GetInt("groupid", -1)))
                {
                    Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/UserGroupList");
                    UserGroups.GetUserGroupList();

                    AdminVistLogs.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';");
                }
                else
                {
                    if (AdminUserGroups.opresult != "")
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败,原因:" + AdminUserGroups.opresult + "');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                    }
                    else
                    {
                        base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergroupspecialgrid.aspx';</script>");
                    }
                }
            }
            #endregion
        }
예제 #2
0
        private void DeleteUserGroupInf_Click(object sender, EventArgs e)
        {
            #region  除相关组信息

            if (this.CheckCookie())
            {
                if (AdminUserGroups.DeleteUserGroupInfo(DNTRequest.GetInt("groupid", -1)))
                {
                    //删除举报组
                    GeneralConfigInfo configInfo = GeneralConfigs.GetConfig();
                    string            tempstr    = "";
                    foreach (string report in configInfo.Reportusergroup.Split(','))
                    {
                        if (report != userGroupInfo.Groupid.ToString())
                        {
                            if (tempstr == "")
                            {
                                tempstr = report;
                            }
                            else
                            {
                                tempstr += "," + report;
                            }
                        }
                    }
                    configInfo.Reportusergroup = tempstr;
                    tempstr = "";
                    foreach (string photomangegroup in configInfo.Photomangegroups.Split(','))
                    {
                        if (photomangegroup != userGroupInfo.Groupid.ToString())
                        {
                            if (tempstr == "")
                            {
                                tempstr = photomangegroup;
                            }
                            else
                            {
                                tempstr += "," + photomangegroup;
                            }
                        }
                    }
                    configInfo.Photomangegroups = tempstr;
                    GeneralConfigs.Serialiaze(configInfo, Server.MapPath("../../config/general.config"));
                    Discuz.Cache.DNTCache.GetCacheService().RemoveObject("/Forum/AdminGroupList");
                    Discuz.Forum.AdminGroups.GetAdminGroupList();
                    AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除管理组", "组ID:" + DNTRequest.GetInt("groupid", -1));
                    base.RegisterStartupScript("PAGE", "window.location.href='global_adminusergroupgrid.aspx';");
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_adminusergroupgrid.aspx';</script>");
                }
            }

            #endregion
        }
예제 #3
0
        private void DeleteUserGroupInf_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                if (AdminUserGroups.DeleteUserGroupInfo(DNTRequest.GetInt("groupid", -1)))
                {
                    var      config = GeneralConfigInfo.Current;
                    string   text   = "";
                    string[] array  = config.Reportusergroup.Split(',');
                    for (int i = 0; i < array.Length; i++)
                    {
                        string text2 = array[i];
                        if (text2 != this.userGroupInfo.ID.ToString())
                        {
                            if (text == "")
                            {
                                text = text2;
                            }
                            else
                            {
                                text = text + "," + text2;
                            }
                        }
                    }
                    config.Reportusergroup = text;
                    text = "";
                    string[] array2 = config.Photomangegroups.Split(',');
                    for (int j = 0; j < array2.Length; j++)
                    {
                        string text3 = array2[j];
                        if (text3 != this.userGroupInfo.ID.ToString())
                        {
                            if (text == "")
                            {
                                text = text3;
                            }
                            else
                            {
                                text = text + "," + text3;
                            }
                        }
                    }
                    config.Photomangegroups = text;
                    config.Save();

                    //config.Save();;
                    //DNTCache.Current.RemoveObject(CacheKeys.FORUM_ADMIN_GROUP_LIST);
                    //AdminGroups.GetAdminGroupList();
                    AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除管理组", "组ID:" + DNTRequest.GetInt("groupid", -1));
                    base.RegisterStartupScript("PAGE", "window.location.href='global_adminusergroupgrid.aspx';");
                    return;
                }
                base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_adminusergroupgrid.aspx';</script>");
            }
        }
예제 #4
0
 private void DeleteUserGroupInf_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         if (AdminUserGroups.DeleteUserGroupInfo(DNTRequest.GetInt("groupid", -1)))
         {
             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>");
     }
 }