protected void Page_Load(object sender, EventArgs e) { this.config = GeneralConfigInfo.Current; var online = Online.UpdateInfo(); //if (UserGroup.FindByID((int)online.GroupID).RadminID != 1) if (!online.Group.Is¹ÜÀíÔ±) { HttpContext.Current.Response.Redirect("../"); return; } int olid = online.ID; //OnlineUsers.DeleteRows(olid); var entity = Online.FindByID(olid); if (entity != null) { entity.Delete(); } ForumUtils.ClearUserCookie(); HttpCookie cookie = new HttpCookie("bbx_admin"); HttpContext.Current.Response.AppendCookie(cookie); FormsAuthentication.SignOut(); }
protected override void ShowPage() { int userid = this.userid; this.pagetitle = "用户退出"; this.username = "******"; this.userid = -1; base.AddScript("if (top.document.getElementById('leftmenu')){ top.frames['leftmenu'].location.reload(); }"); var reurl = Request["reurl"]; if (!DNTRequest.IsPost() || String.IsNullOrEmpty(reurl)) { var url = reurl; if (String.IsNullOrEmpty(reurl)) { url = Request.UrlReferrer + ""; if (string.IsNullOrEmpty(url) || url.IndexOf("login") > -1 || url.IndexOf("logout") > -1) { url = "index.aspx"; } } Utils.WriteCookie("reurl", (String.IsNullOrEmpty(reurl) || reurl.IndexOf("login.aspx") > -1) ? url : reurl); } if (DNTRequest.GetString("userkey") == this.userkey || this.IsApplicationLogout()) { base.AddMsgLine("已经清除了您的登录信息, 稍后您将以游客身份返回首页"); var entity = Online.FindByID(olid); if (entity != null) { entity.Delete(); } ForumUtils.ClearUserCookie(); Utils.WriteCookie(Utils.GetTemplateCookieName(), "", -999999); Response.AppendCookie(new HttpCookie("bbx_admin")); if (APIConfigInfo.Current.Enable) { base.AddMsgLine(Sync.GetLogoutScript(userid)); } if (!APIConfigInfo.Current.Enable || !Sync.NeedAsyncLogout()) { base.MsgForward("logout_succeed"); } } else { base.AddMsgLine("无法确定您的身份, 稍后返回首页"); } base.SetUrl(Utils.UrlDecode(ForumUtils.GetReUrl())); base.SetMetaRefresh(); base.SetShowBackLink(false); }
public static int UpdateUserNewPMCount(int uid, int olid) { //int newPMCount = BBX.Data.PrivateMessages.GetNewPMCount(uid); var newPMCount = ShortMessage.GetNewPMCount(uid); //OnlineUsers.UpdateNewPms(olid, newPMCount); var online = Online.FindByID(olid); if (online != null) { online.UpdateNewPms(newPMCount); } //return BBX.Data.Users.SetUserNewPMCount(uid, newPMCount); var user = User.FindByID(uid); if (user != null) { user.NewpmCount = newPMCount; user.Update(); } return(1); }
protected override void ShowPage() { pagetitle = "用户控制面板"; if (!base.IsLogin()) { return; } NoticeType noticetype = Notice.GetNoticetype(filter); reccount = Notice.GetNoticeCountByUid(userid, noticetype); base.BindItems(reccount, "usercpnotice.aspx?filter=" + filter); //noticeinfolist = Notices.GetNoticeinfoCollectionByUid(userid, noticetype, pageid, 16); noticeinfolist = Notice.FindAllByUidAndType(userid, noticetype, (pageid - 1) * 16, 16); newnoticecount = Notice.GetNewNoticeCountByUid(userid); Notice.UpdateNoticeNewByUid(userid, 0); //OnlineUsers.UpdateNewNotices(olid); var online = Online.FindByID(olid); if (online != null) { online.UpdateNewNotices(0); } }