private void DelUserInfo_Click(object sender, EventArgs e) { #region 除指定用户信息 if (this.CheckCookie()) { int uid = DNTRequest.GetInt("uid", -1); if (!AllowEditUserInfo(uid, true)) { return; } if (AllowDeleteUser(this.userid, uid)) { bool delpost = !(deltype.SelectedValue.IndexOf("1") >= 0); bool delpms = !(deltype.SelectedValue.IndexOf("2") >= 0); if (SpacePluginProvider.GetInstance() != null) { SpacePluginProvider.GetInstance().Delete(uid); } if (AlbumPluginProvider.GetInstance() != null) { AlbumPluginProvider.GetInstance().Delete(uid); } if (AdminUsers.DelUserAllInf(uid, delpost, delpms)) { //删除用户同步 Discuz.Forum.Sync.DeleteUsers(uid.ToString(), ""); //ManyouApplications.AddUserLog(uid, UserLogActionEnum.Delete); //删除该用户头像 Avatars.DeleteAvatar(uid.ToString()); AdminUsers.UpdateForumsFieldModerators(userName.Text); OnlineUsers.DeleteUserByUid(userInfo.Uid); //移除该用户的在线信息,使之退出 AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除用户", "用户名:" + userName.Text); base.RegisterStartupScript("PAGE", "window.location.href='global_usergrid.aspx?condition=" + DNTRequest.GetString("condition") + "';"); } else { base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergrid.aspx?condition=" + DNTRequest.GetString("condition") + "';</script>"); } } else { base.RegisterStartupScript("", "<script>alert('操作失败,你要删除的用户是创始人用户或是其它管理员,因此不能删除!');window.location.href='global_usergrid.aspx?condition=" + DNTRequest.GetString("condition") + "';</script>"); } } #endregion }
private string CombinationUser(string userName, string targetUserName, int targetUid) { string result = ""; if (userName != "" && targetUserName != userName) { int userId = Users.GetUserId(userName); if (userId > 0) { AdminUsers.CombinationUser(userId, targetUid); AdminUsers.UpdateForumsFieldModerators(userName); AdminVisitLog.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "合并用户", "把用户" + userName + " 合并到" + targetUserName); } else { result = "用户:" + userName + "不存在!,"; } } return(result); }
private string CombinationUser(string userName, string targetUserName, int targetUid) { int srcuid = 0; string result = ""; if ((userName != "") && (targetUserName != userName)) { srcuid = Users.GetUserId(userName); if (srcuid > 0) { AdminUsers.CombinationUser(srcuid, targetUid); AdminUsers.UpdateForumsFieldModerators(userName); AdminVistLogs.InsertLog(userid, username, usergroupid, grouptitle, ip, "合并用户", "把用户" + userName + " 合并到" + targetUserName); } else { result = "用户:" + userName + "不存在!,"; } } return(result); }
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>"); } } }
private void DelUserInfo_Click(object sender, EventArgs e) { #region 除指定用户信息 if (this.CheckCookie()) { int uid = DNTRequest.GetInt("uid", -1); if (!AllowEditUserInfo(uid, true)) { return; } //if (uid > 1) //判断是不是当前uid是不是系统初始化时生成的uid if (AllowDeleteUser(this.userid, uid)) { bool delpost = deltype.SelectedValue.IndexOf("1") >= 0 ? false : true; bool delpms = deltype.SelectedValue.IndexOf("2") >= 0 ? false : true; if (AdminUsers.DelUserAllInf(uid, delpost, delpms)) { AdminUsers.UpdateForumsFieldModerators(userName.Text); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "后台删除用户", "用户名:" + userName.Text); base.RegisterStartupScript("PAGE", "window.location.href='global_usergrid.aspx?condition=" + DNTRequest.GetString("condition") + "';"); } else { base.RegisterStartupScript("", "<script>alert('操作失败');window.location.href='global_usergrid.aspx?condition=" + DNTRequest.GetString("condition") + "';</script>"); } } else { base.RegisterStartupScript("", "<script>alert('操作失败,你要删除的用户是创始人用户或是其它管理员,因此不能删除!');window.location.href='global_usergrid.aspx?condition=" + DNTRequest.GetString("condition") + "';</script>"); } } #endregion }
private void CombinationUserInfo_Click(object sender, EventArgs e) { #region 合并用户 if (this.CheckCookie()) { int targetuid = AdminUsers.GetuidByusername(targetusername.Text); string result = null; if (targetuid > 0) { int srcuid = 0; if ((username1.Text != "") && (targetusername.Text.Trim() != username1.Text.Trim())) { srcuid = AdminUsers.GetuidByusername(username1.Text); if (srcuid > 0) { AdminUsers.CombinationUser(srcuid, targetuid); AdminUsers.UpdateForumsFieldModerators(username1.Text); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "合并用户", "把用户" + username1.Text + " 合并到" + targetusername.Text); } else { result += "用户:" + username1.Text + "不存在!,"; } } srcuid = 0; if ((username2.Text != "") && (targetusername.Text.Trim() != username2.Text.Trim())) { srcuid = AdminUsers.GetuidByusername(username2.Text); if (srcuid > 0) { AdminUsers.CombinationUser(srcuid, targetuid); AdminUsers.UpdateForumsFieldModerators(username2.Text); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "合并用户", "把用户" + username2.Text + " 合并到" + targetusername.Text); } else { result += "用户:" + username2.Text + "不存在!,"; } } srcuid = 0; if ((username3.Text != "") && (targetusername.Text.Trim() != username3.Text.Trim())) { srcuid = AdminUsers.GetuidByusername(username3.Text); if (srcuid > 0) { AdminUsers.CombinationUser(srcuid, targetuid); AdminUsers.UpdateForumsFieldModerators(username3.Text); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "合并用户", "把用户" + username3.Text + " 合并到" + targetusername.Text); } else { result += "用户:" + username3.Text + "不存在!,"; } } } else { result += "目标用户:" + targetusername.Text + "不存在!,"; } if (result == null) { base.RegisterStartupScript("PAGE", "window.location.href='global_usergrid.aspx';"); } else { result = result.Replace("'", "’"); base.RegisterStartupScript("", "<script>alert('" + result + "');</script>"); } } #endregion }