Пример #1
0
 private void DeleteUser_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         string text = Request["uid"].Trim(',');
         if (text != "")
         {
             bool     delposts = this.deltype.SelectedValue.IndexOf("1") < 0;
             bool     delpms   = this.deltype.SelectedValue.IndexOf("2") < 0;
             string[] array    = text.Split(',');
             for (int i = 0; i < array.Length; i++)
             {
                 string text2 = array[i];
                 if (text2 != "" && this.CheckSponser(Utility.ToInt(text2, 0)) && Utility.ToInt(text2, 0) > 1)
                 {
                     int  userid = Utility.ToInt(text2, 0);
                     User user   = XUser.FindByID(userid);
                     if (user.Delete(delposts, delpms))
                     {
                         Sync.DeleteUsers(text2, "");
                         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除用户", "用户名:批量用户删除");
                         base.RegisterStartupScript("PAGE", "window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';");
                     }
                 }
             }
             return;
         }
         base.RegisterStartupScript("", "<script>alert('请选择相应的用户!');window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';</script>");
     }
 }
Пример #2
0
        private void DelUserInfo_Click(object sender, EventArgs e)
        {
            if (base.CheckCookie())
            {
                int uid = DNTRequest.GetInt("uid", -1);
                if (this.AllowDeleteUser(this.userid, uid))
                {
                    bool delposts = this.deltype.SelectedValue.IndexOf("1") < 0;
                    bool delpms   = this.deltype.SelectedValue.IndexOf("2") < 0;

                    User user = XUser.FindByID(uid);
                    if (user.Delete(delposts, delpms))
                    {
                        Sync.DeleteUsers(uid.ToString(), "");
                        Avatars.DeleteAvatar(uid.ToString());
                        XForum.UpdateForumsFieldModerators(this.userName.Text);
                        Online.DeleteUserByUid(this.userInfo.ID);
                        AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除用户", "用户名:" + this.userName.Text);
                        base.RegisterStartupScript("PAGE", "window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';");
                        return;
                    }
                    base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';</script>");
                    return;
                }
                else
                {
                    base.RegisterStartupScript("", "<script>alert('操作失败,你要删除的用户是创始人用户或是其它管理员,因此不能删除!');window.location.href='usergrid.aspx?condition=" + Request["condition"] + "';</script>");
                }
            }
        }
Пример #3
0
 private void DelUserInfo_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         int @int = DNTRequest.GetInt("uid", -1);
         if (!this.AllowEditUserInfo(@int, true))
         {
             return;
         }
         if (this.AllowDeleteUser(this.userid, @int))
         {
             bool delposts = this.deltype.SelectedValue.IndexOf("1") < 0;
             bool delpms   = this.deltype.SelectedValue.IndexOf("2") < 0;
             if (SpacePluginProvider.GetInstance() != null)
             {
                 SpacePluginProvider.GetInstance().Delete(@int);
             }
             if (AlbumPluginProvider.GetInstance() != null)
             {
                 AlbumPluginProvider.GetInstance().Delete(@int);
             }
             if (AdminUsers.DelUserAllInf(@int, delposts, delpms))
             {
                 Sync.DeleteUsers(@int.ToString(), "");
                 Avatars.DeleteAvatar(@int.ToString());
                 AdminUsers.UpdateForumsFieldModerators(this.userName.Text);
                 OnlineUsers.DeleteUserByUid(this.userInfo.ID);
                 AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除用户", "用户名:" + this.userName.Text);
                 base.RegisterStartupScript("PAGE", "window.location.href='global_usergrid.aspx?condition=" + Request["condition"] + "';");
                 return;
             }
             base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergrid.aspx?condition=" + Request["condition"] + "';</script>");
             return;
         }
         else
         {
             base.RegisterStartupScript("", "<script>alert('操作失败,你要删除的用户是创始人用户或是其它管理员,因此不能删除!');window.location.href='global_usergrid.aspx?condition=" + Request["condition"] + "';</script>");
         }
     }
 }
Пример #4
0
 private void DeleteUser_Click(object sender, EventArgs e)
 {
     if (base.CheckCookie())
     {
         string text = Request["uid"].Trim(',');
         if (text != "")
         {
             bool     delposts = this.deltype.SelectedValue.IndexOf("1") < 0;
             bool     delpms   = this.deltype.SelectedValue.IndexOf("2") < 0;
             string[] array    = text.Split(',');
             for (int i = 0; i < array.Length; i++)
             {
                 string text2 = array[i];
                 if (text2 != "" && this.CheckSponser(Convert.ToInt32(text2)) && Convert.ToInt32(text2) > 1)
                 {
                     int userid = Convert.ToInt32(text2);
                     if (AlbumPluginProvider.GetInstance() != null)
                     {
                         AlbumPluginProvider.GetInstance().Delete(userid);
                     }
                     if (SpacePluginProvider.GetInstance() != null)
                     {
                         SpacePluginProvider.GetInstance().Delete(userid);
                     }
                     if (AdminUsers.DelUserAllInf(userid, delposts, delpms))
                     {
                         Sync.DeleteUsers(text2, "");
                         AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除用户", "用户名:批量用户删除");
                         base.RegisterStartupScript("PAGE", "window.location.href='global_usergrid.aspx?condition=" + Request["condition"] + "';");
                     }
                 }
             }
             return;
         }
         base.RegisterStartupScript("", "<script>alert('请选择相应的用户!');window.location.href='global_usergrid.aspx?condition=" + Request["condition"] + "';</script>");
     }
 }