protected override void ShowPage() { if (userid == -1) { AddErrLine("你尚未登录"); return; } user = Discuz.Forum.Users.GetUserInfo(userid); pagetitle = "短消息草稿箱"; if (DNTRequest.IsPost()) { string[] pmitemid = Utils.SplitString(DNTRequest.GetFormString("pmitemid"), ","); int retval = PrivateMessages.DeletePrivateMessage(userid, pmitemid); if (retval == -1) { AddErrLine("参数无效<br />"); return; } SetShowBackLink(false); AddMsgLine("删除完毕"); } else { BindItems(); } }
protected override void ShowPage() { pagetitle = "用户控制面板"; if (!IsLogin()) { return; } receivepmsetting = (int)user.Newsletter; newnoticecount = Notices.GetNewNoticeCountByUid(userid); if (DNTRequest.IsPost()) { //user.Pmsound = DNTRequest.GetInt("pmsound", 0); receivepmsetting = DNTRequest.GetInt("receivesetting", 1); //receivepmsetting = 1; //foreach (string rpms in DNTRequest.GetString("receivesetting").Split(',')) //{ // if (!Utils.StrIsNullOrEmpty(rpms)) // receivepmsetting = receivepmsetting | int.Parse(rpms); //} user.Newsletter = (ReceivePMSettingType)receivepmsetting; Users.UpdateUserPMSetting(user); //ForumUtils.WriteCookie("pmsound", user.Pmsound.ToString()); SetUrl("usercppmset.aspx"); SetMetaRefresh(); SetShowBackLink(true); AddMsgLine("短消息设置已成功更新"); } }
protected override void ShowPage() { this.pagetitle = "黑名单"; if (!base.IsLogin()) { return; } if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { base.AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } if (DNTRequest.GetFormString("Ignorepm") != this.user.Ignorepm) { this.user.Ignorepm = Utils.CutString(DNTRequest.GetFormString("Ignorepm"), 0, 999); //Users.UpdateUserPMSetting(this.user); (user as IEntity).Save(); } base.SetUrl("usercpignorelist.aspx"); base.SetMetaRefresh(); base.SetShowBackLink(true); base.AddMsgLine("操作完毕"); } this.newnoticecount = Notice.GetNewNoticeCountByUid(this.userid); }
protected override void ShowPage() { this.pagetitle = "用户控制面板"; if (!base.IsLogin()) { return; } this.receivepmsetting = user.NewsLetter; if (DNTRequest.IsPost()) { //Users.UpdateUserPreference(this.userid, "", 0, 0, DNTRequest.GetInt("templateid", 0)); user.Avatar = ""; user.Avatarwidth = 0; user.Avatarheight = 0; user.TemplateID = Request["templateid"].ToInt(); (user as IEntity).Save(); this.UpdateUserForumSetting(); Online.UpdateInvisible(this.olid, this.user.Invisible); this.WriteCookie(); this.receivepmsetting = DNTRequest.GetInt("receivesetting", 1); //this.user.NewsLetter = (ReceivePMSettingType)this.receivepmsetting; this.user.NewsLetter = receivepmsetting; //Users.UpdateUserPMSetting(this.user); (user as IEntity).Save(); base.SetUrl("usercppreference.aspx"); base.SetMetaRefresh(); base.SetShowBackLink(true); base.AddMsgLine("修改个性设置完毕"); } }
protected override void ShowPage() { pagetitle = "短消息草稿箱"; if (!IsLogin()) { return; } if (DNTRequest.IsPost()) { if (PrivateMessages.DeletePrivateMessage(userid, Utils.SplitString(DNTRequest.GetFormString("pmitemid"), ",")) == -1) { AddErrLine("参数无效<br />"); return; } SetMetaRefresh(); SetShowBackLink(true); AddMsgLine("删除完毕"); } else { BindPrivateMessage(2); } newnoticecount = Notices.GetNewNoticeCountByUid(userid); }
protected override void ShowPage() { pagetitle = "短消息发件箱"; if (!IsLogin()) { return; } if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } if (PrivateMessages.DeletePrivateMessage(userid, Utils.SplitString(DNTRequest.GetFormString("pmitemid"), ",")) == -1) { AddErrLine("参数无效<br />"); return; } SetShowBackLink(false); AddMsgLine("删除完毕"); } else { BindPrivateMessage(1); } newnoticecount = Notices.GetNewNoticeCountByUid(userid); }
protected override void ShowPage() { this.pagetitle = "短消息发件箱"; if (!base.IsLogin()) { return; } if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { base.AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } if (ShortMessage.DeletePrivateMessage(this.userid, DNTRequest.GetFormString("pmitemid")) <= 0) { base.AddErrLine("参数无效<br />"); return; } base.SetShowBackLink(false); base.AddMsgLine("删除完毕"); } else { base.BindPrivateMessage(1); } this.newnoticecount = Notice.GetNewNoticeCountByUid(this.userid); }
protected override void ShowPage() { pagetitle = "用户控制面板"; if (userid == -1) { AddErrLine("你尚未登录"); return; } user = Discuz.Forum.Users.GetUserInfo(userid); if (DNTRequest.IsPost()) { string oldpassword = DNTRequest.GetString("oldpassword"); string newpassword = DNTRequest.GetString("newpassword"); string newpassword2 = DNTRequest.GetString("newpassword2"); if (Discuz.Forum.Users.CheckPassword(userid, oldpassword, true) == -1) { AddErrLine("你的原密码错误"); } if (newpassword != newpassword2) { AddErrLine("新密码两次输入不一致"); } if (newpassword.Equals("")) { newpassword = oldpassword; } if (newpassword.Length < 6) { AddErrLine("密码不得少于6个字符"); } if (IsErr()) { return; } else { //判断是否需要修改安全提问 Discuz.Forum.Users.UpdateUserPassword(userid, newpassword); if (DNTRequest.GetString("changesecques") != "") { Discuz.Forum.Users.UpdateUserSecques(userid, DNTRequest.GetInt("question", 0), DNTRequest.GetString("answer")); } ForumUtils.WriteCookie("password", ForumUtils.SetCookiePassword(Utils.MD5(newpassword), config.Passwordkey)); OnlineUsers.UpdatePassword(olid, Utils.MD5(newpassword)); SetUrl("usercpnewpassword.aspx"); SetMetaRefresh(); SetShowBackLink(true); AddMsgLine("修改密码完毕, 同时已经更新了您的登录信息"); } } }
protected override void ShowPage() { this.pagetitle = "密码找回"; this.username = DNTRequest.GetString("username"); base.SetBackLink("/"); var userInfo = Users.GetUserInfo(this.uid); if (userInfo == null) { base.AddErrLine("用户名不存在,你无法重设密码"); return; } if (!userInfo.Field.Authstr.Equals(this.Authstr) || userInfo.Field.AuthTime.ToDateTime() < DateTime.Now.AddDays(-3.0)) { this.ReSendMail(userInfo.ID, userInfo.Name, userInfo.Email.Trim()); base.SetUrl("/"); base.SetMetaRefresh(5); base.SetShowBackLink(false); base.AddErrLine("验证码已失效,新的验证码已经通过 Email 发送到您的信箱中,<BR />请在 3 天之内到论坛修改您的密码."); return; } if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { base.AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } base.SetBackLink("setnewpassword.aspx?uid=" + this.uid + "&id=" + this.Authstr); if (String.IsNullOrEmpty(DNTRequest.GetString("newpassword"))) { base.AddErrLine("新密码不能为空"); } if (!DNTRequest.GetString("newpassword").Equals(DNTRequest.GetString("confirmpassword"))) { base.AddErrLine("两次密码输入不一致"); } if (this.Authstr.IsNullOrEmpty() || !userInfo.Field.Authstr.Equals(this.Authstr)) { base.AddErrLine("您所提供的验证码与注册信息不符."); } if (base.IsErr()) { return; } if (Utils.IsSafeSqlString(DNTRequest.GetString("newpassword")) && Users.UpdateUserPassword(this.uid, DNTRequest.GetString("newpassword"), true)) { Users.UpdateAuthStr(this.uid, "", 0); base.SetUrl("login.aspx"); base.SetMetaRefresh(5); base.SetShowBackLink(false); base.MsgForward("setnewpassword_succeed"); base.AddMsgLine("你的密码已被重新设置,请用新密码登录."); return; } base.AddErrLine("用户名,Email 地址或安全提问不匹配,请返回修改."); } }
protected override void ShowPage() { pagetitle = "撰写短消息"; if (!IsLogin()) { return; } if (!CheckPermission()) { return; } if (DNTRequest.IsPost() && !ForumUtils.IsCrossSitePost()) { if (!CheckPermissionAfterPost()) { return; } SendPM(); if (IsErr()) { return; } } ShortUserInfo shortUserInfo = Users.GetShortUserInfo(msgtoid); string msttoName = (shortUserInfo != null) ? shortUserInfo.Username : ""; msgto = msgtoid > 0 ? msttoName : msgto; string action = DNTRequest.GetQueryString("action").ToLower(); if (action.CompareTo("re") == 0 || action.CompareTo("fw") == 0) //回复或者转发 { if (DNTRequest.GetQueryInt("pmid", -1) != -1) { PrivateMessageInfo pm = PrivateMessages.GetPrivateMessageInfo(DNTRequest.GetQueryInt("pmid", -1)); if (pm != null && (pm.Msgtoid == userid || pm.Msgfromid == userid)) { msgto = action.CompareTo("re") == 0 ? Utils.HtmlEncode(pm.Msgfrom) : ""; subject = Utils.HtmlEncode(action) + ":" + pm.Subject; message = Utils.HtmlEncode("> ") + pm.Message.Replace("\n", "\n> ") + "\r\n\r\n"; } } } if (DNTRequest.GetString("operation") == "pmfriend") { CreatePmFriendMessage(); } newnoticecount = Notices.GetNewNoticeCountByUid(userid); }
public NotifyPage() { if (EPayments.CheckPayment(DNTRequest.GetString("notify_id")))//验证请求是否来自支付宝,或者是伪造的 { //获取需要的信息 int orderStatus = EPayments.ConvertAlipayTradeStatus(DNTRequest.GetString("trade_status")); string orderCode = DNTRequest.GetString("out_trade_no", true); string tradeNo = DNTRequest.GetString("trade_no", true); if (string.IsNullOrEmpty(orderCode) || string.IsNullOrEmpty(tradeNo) || orderStatus <= 0) { return; } CreditOrderInfo orderInfo = CreditOrders.GetCreditOrderInfoByOrderCode(orderCode); //如果订单状态为未成功交易 if (orderInfo != null && orderInfo.OrderStatus < 2) { float[] extcredits = new float[8]; extcredits[orderInfo.Credit - 1] = orderInfo.Amount; if (UserCredits.UpdateUserExtCredits(orderInfo.Uid, extcredits, true) != 1) { orderStatus = 0; } CreditsLogs.AddCreditsLog(orderInfo.Uid, orderInfo.Uid, orderInfo.Credit, orderInfo.Credit, 0, orderInfo.Amount, Utils.GetDateTime(), 3);//添加积分兑换转账和充值记录 NoticeInfo notice = new NoticeInfo(); notice.Postdatetime = Utils.GetDateTime(); notice.Type = NoticeType.GoodsTradeNotice; notice.Poster = "系统"; notice.Posterid = 0; notice.Uid = orderInfo.Uid; notice.Note = string.Format("您购买的积分 {0} 已经成功充值,请<a href=\"usercpcreaditstransferlog.aspx\">查收</a>!(支付宝订单号:{1})", ForumUtils.ConvertCreditAndAmountToWord(orderInfo.Credit, orderInfo.Amount), tradeNo); Notices.CreateNoticeInfo(notice); CreditOrders.UpdateCreditOrderInfo(orderInfo.OrderId, tradeNo, orderStatus, Utils.GetDateTime());//修改积分订单记录状态 } //判断当前请求是支付宝GET式(直接跳转)或者是服务器POST式(需返回success使得支付宝停止继续发送通知) if (DNTRequest.IsPost()) { HttpContext.Current.Response.Write("success"); } else { HttpContext.Current.Response.Redirect("../usercpcreaditstransferlog.aspx?paysuccess=true"); } } else { HttpContext.Current.Response.Write("fail"); } }
protected override void ShowPage() { pagetitle = "密码找回"; findusername = DNTRequest.GetString("findusername"); string errorMessage = ""; if (!string.IsNullOrEmpty(findusername) && !Users.IsAvailableType(findusername, out errorMessage)) { //base.SetBackLink("getpassword.aspx"); AddErrLine(errorMessage); return; } //如果提交... if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } base.SetBackLink("getpassword.aspx?findusername="******"\"", "").Replace("\'", "").Replace("<", "").Replace(">", "")); if (Users.GetUserId(findusername) == 0) { AddErrLine("用户不存在"); return; } if (Utils.StrIsNullOrEmpty(DNTRequest.GetString("email"))) { AddErrLine("电子邮件不能为空"); return; } if (IsErr()) { return; } if (Users.CheckEmailAndSecques(findusername, DNTRequest.GetString("email"), DNTRequest.GetInt("question", 0), DNTRequest.GetString("answer"), GetForumPath())) { SetUrl(forumpath); SetMetaRefresh(5); SetShowBackLink(false); MsgForward("getpassword_succeed"); AddMsgLine("取回密码的方法已经通过 Email 发送到您的信箱中,<br />请在 3 天之内到论坛修改您的密码."); } else { AddErrLine("用户名,Email 地址或安全提问不匹配,请返回修改."); } } }
protected override void ShowPage() { int logoutUid = userid; pagetitle = "用户退出"; username = "******"; userid = -1; base.AddScript("if (top.document.getElementById('leftmenu')){ top.frames['leftmenu'].location.reload(); }"); if (!DNTRequest.IsPost() || reurl != "") { string r = (!Utils.StrIsNullOrEmpty(reurl)) ? reurl : ""; if (reurl == "") { r = (DNTRequest.GetUrlReferrer() == "" || DNTRequest.GetUrlReferrer().IndexOf("login") > -1 || DNTRequest.GetUrlReferrer().IndexOf("logout") > -1) ? "index.aspx" : DNTRequest.GetUrlReferrer(); } Utils.WriteCookie("reurl", (reurl == "" || reurl.IndexOf("login.aspx") > -1) ? r : reurl); } if (DNTRequest.GetString("userkey") == userkey || IsApplicationLogout()) { AddMsgLine("已经清除了您的登录信息, 稍后您将以游客身份返回首页"); OnlineUsers.DeleteRows(olid); ForumUtils.ClearUserCookie(); Utils.WriteCookie(Utils.GetTemplateCookieName(), "", -999999); System.Web.HttpContext.Current.Response.AppendCookie(new System.Web.HttpCookie("dntadmin")); //同步登录到第三方应用 if (APIConfigs.GetConfig().Enable) { AddMsgLine(Sync.GetLogoutScript(logoutUid)); } if (!APIConfigs.GetConfig().Enable || !Sync.NeedAsyncLogout()) { MsgForward("logout_succeed"); } } else { AddMsgLine("无法确定您的身份, 稍后返回首页"); } SetUrl(Utils.UrlDecode(ForumUtils.GetReUrl())); SetMetaRefresh(); SetShowBackLink(false); }
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); }
protected override void ShowPage() { pagetitle = "用户控制面板"; if (!IsLogin()) { return; } switch (typeid) { case 1: type = FavoriteType.Album; break; case 2: type = FavoriteType.SpacePost; break; case 3: type = FavoriteType.Goods; break; default: type = FavoriteType.ForumTopic; break; } if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } string titemid = DNTRequest.GetFormString("titemid"); if (Utils.StrIsNullOrEmpty(titemid) || !Utils.IsNumericList(titemid)) { AddErrLine("您未选中任何数据信息,当前操作失败!"); return; } if (Favorites.DeleteFavorites(userid, Utils.SplitString(titemid, ","), type) == -1) { AddErrLine("参数无效"); return; } SetShowBackLink(false); SetUrl("usercpsubscribe.aspx"); SetMetaRefresh(); AddMsgLine("删除完毕"); return; } else { favoriteCount = Favorites.GetFavoritesCount(userid, type); BindItems(favoriteCount, string.Format("usercpsubscribe.aspx?typeid={0}", typeid)); } }
public NotifyPage() { if (!EPayments.CheckPayment(DNTRequest.GetString("notify_id"))) { HttpContext.Current.Response.Write("fail"); return; } int status = EPayments.ConvertAlipayTradeStatus(DNTRequest.GetString("trade_status")); string outTradeNo = DNTRequest.GetString("out_trade_no", true); string tradeNo = DNTRequest.GetString("trade_no", true); if (string.IsNullOrEmpty(outTradeNo) || string.IsNullOrEmpty(tradeNo) || status <= 0) { return; } //var ci = CreditOrders.GetCreditOrderInfoByOrderCode(outTradeNo); var ci = Order.FindByCode(outTradeNo); if (ci != null && ci.Status < 2) { float[] array = new float[8]; array[ci.Credit - 1] = (float)ci.Amount; if (CreditsFacade.UpdateUserExtCredits(ci.Uid, array, true) != 1) { status = 0; } //CreditsLogs.AddCreditsLog(ci.Uid, ci.Uid, ci.Credit, ci.Credit, 0f, (float)ci.Amount, Utils.GetDateTime(), 3); CreditsLog.Add(ci.Uid, ci.Uid, ci.Credit, ci.Credit, 0, ci.Amount, 3); var notice = new Notice { PostDateTime = DateTime.Now, Type = (Int32)NoticeType.GoodsTradeNotice, Poster = "系统", PosterID = 0, Uid = ci.Uid, Note = string.Format("您购买的积分 {0} 已经成功充值,请<a href=\"usercpcreaditstransferlog.aspx\">查收</a>!(支付宝订单号:{1})", ForumUtils.ConvertCreditAndAmountToWord(ci.Credit, ci.Amount), tradeNo) }; notice.Insert(); //CreditOrders.UpdateCreditOrderInfo(ci.OrderId, tradeNo, num, Utils.GetDateTime()); ci.TradeNo = tradeNo; ci.Status = status; ci.ConfirmedTime = DateTime.Now; ci.Update(); } if (DNTRequest.IsPost()) { HttpContext.Current.Response.Write("success"); return; } HttpContext.Current.Response.Redirect("../usercpcreaditstransferlog.aspx?paysuccess=true"); }
protected override void ShowPage() { pagetitle = "密码找回"; username = Utils.RemoveHtml(DNTRequest.GetString("username")); string section = DNTRequest.GetString("diseaseSection"); if (!string.IsNullOrEmpty(section) && username != "admin") { username = section + "_" + username; } //如果提交... if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } base.SetBackLink("getpassword.aspx?username="******"用户不存在"); return; } if (Utils.StrIsNullOrEmpty(DNTRequest.GetString("email"))) { AddErrLine("电子邮件不能为空"); return; } if (IsErr()) { return; } if (Users.CheckEmailAndSecques(username, DNTRequest.GetString("email"), DNTRequest.GetInt("question", 0), DNTRequest.GetString("answer"), GetForumPath())) { SetUrl(forumpath); SetMetaRefresh(5); SetShowBackLink(false); MsgForward("getpassword_succeed"); AddMsgLine("取回密码的方法已经通过 Email 发送到您的信箱中,<br />请在 3 天之内到论坛修改您的密码."); } else { AddErrLine("用户名,Email 地址或安全提问不匹配,请返回修改."); } } }
protected override void ShowPage() { pagetitle = "短消息收件箱"; if (userid == -1) { AddErrLine("你尚未登录"); return; } user = Discuz.Forum.Users.GetUserInfo(userid); if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } if (Utils.StrIsNullOrEmpty(DNTRequest.GetFormString("pmitemid"))) { AddErrLine("您未选中任何短消息,当前操作失败!"); return; } if (!Utils.IsNumericList(DNTRequest.GetFormString("pmitemid"))) { AddErrLine("参数信息错误!"); return; } string[] pmitemid = Utils.SplitString(DNTRequest.GetFormString("pmitemid"), ","); int retval = PrivateMessages.DeletePrivateMessage(userid, pmitemid); if (retval == -1) { AddErrLine("参数无效"); return; } SetUrl("usercpinbox.aspx"); SetMetaRefresh(); SetShowBackLink(true); AddMsgLine("删除完毕"); } else { BindItems(); } }
protected override void ShowPage() { pagetitle = "短消息收件箱"; if (!IsLogin()) { return; } if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } if (Utils.StrIsNullOrEmpty(DNTRequest.GetFormString("pmitemid"))) { AddErrLine("您未选中任何短消息,当前操作失败!"); return; } if (!Utils.IsNumericList(DNTRequest.GetFormString("pmitemid"))) { AddErrLine("参数信息错误!"); return; } string[] pmitemid = Utils.SplitString(DNTRequest.GetFormString("pmitemid"), ","); if (!Utils.IsNumericArray(pmitemid) || PrivateMessages.DeletePrivateMessage(userid, pmitemid) == -1) { AddErrLine("参数无效"); return; } Users.UpdateUserNewPMCount(userid, olid); SetUrl("usercpinbox.aspx"); SetMetaRefresh(); SetShowBackLink(true); AddMsgLine("删除完毕"); } else { BindPrivateMessage(0); } newnoticecount = Notices.GetNewNoticeCountByUid(userid); }
protected override void ShowPage() { this.pagetitle = "用户控制面板"; if (!base.IsLogin()) { return; } switch (this.typeid) { case 3: this.type = FavoriteType.Goods; break; default: this.type = FavoriteType.ForumTopic; break; } if (!DNTRequest.IsPost()) { this.favoriteCount = Favorite.SearchCount(this.userid, null, this.type); base.BindItems(this.favoriteCount, string.Format("usercpsubscribe.aspx?typeid={0}", this.typeid)); return; } if (ForumUtils.IsCrossSitePost()) { base.AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } string formString = DNTRequest.GetFormString("titemid"); if (formString.IsNullOrEmpty() || !Utils.IsNumericList(formString)) { base.AddErrLine("您未选中任何数据信息,当前操作失败!"); return; } //if (Favorites.DeleteFavorites(this.userid, Utils.SplitString(formString, ","), this.type) == -1) var list = Favorite.Search(userid, formString.SplitAsInt(","), type); if (list.Delete() == 0) { base.AddErrLine("参数无效"); return; } base.SetShowBackLink(false); base.SetUrl("usercpsubscribe.aspx"); base.SetMetaRefresh(); base.AddMsgLine("删除完毕"); }
private void SetReUrl() { if (!DNTRequest.IsPost() || !String.IsNullOrEmpty(referer)) { var url = Request.UrlReferrer + ""; if (String.IsNullOrEmpty(referer)) { if (String.IsNullOrEmpty(url) || url.IndexOf("login") > -1 || url.IndexOf("logout") > -1) { url = "index.aspx"; } } var reurl = Request["reurl"]; Utils.WriteCookie("reurl", (String.IsNullOrEmpty(reurl) || reurl.IndexOf("login.aspx") > -1) ? url : reurl); } }
private StringBuilder IsValidGetPostInfo(PostInfo info) { StringBuilder xmlnode = new StringBuilder(); xmlnode.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); if (!DNTRequest.IsPost() || ForumUtils.IsCrossSitePost()) { xmlnode.Append("<error>您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。</error>"); return(xmlnode); } if (info == null) { xmlnode.Append("<error>读取帖子失败</error>"); return(xmlnode); } return(xmlnode); }
protected override void ShowPage() { this.pagetitle = "撰写短消息"; if (!base.IsLogin()) { return; } if (!this.CheckPermission()) { return; } if (DNTRequest.IsPost() && !ForumUtils.IsCrossSitePost()) { if (!this.CheckPermissionAfterPost()) { return; } this.SendPM(); if (base.IsErr()) { return; } } var shortUserInfo = BBX.Entity.User.FindByID(this.msgtoid); string text = (shortUserInfo != null) ? shortUserInfo.Name : ""; this.msgto = ((this.msgtoid > 0) ? text : this.msgto); string text2 = DNTRequest.GetQueryString("action").ToLower(); if ((text2.CompareTo("re") == 0 || text2.CompareTo("fw") == 0) && DNTRequest.GetQueryInt("pmid", -1) != -1) { var msg = ShortMessage.FindByID(DNTRequest.GetQueryInt("pmid", -1)); if (msg != null && (msg.MsgtoID == userid || msg.MsgfromID == userid)) { this.msgto = ((text2.CompareTo("re") == 0) ? Utils.HtmlEncode(msg.Msgfrom) : ""); this.subject = Utils.HtmlEncode(text2) + ":" + msg.Subject; this.message = Utils.HtmlEncode("> ") + msg.Message.Replace("\n", "\n> ") + "\r\n\r\n"; } } if (DNTRequest.GetString("operation") == "pmfriend") { this.CreatePmFriendMessage(); } this.newnoticecount = Notice.GetNewNoticeCountByUid(this.userid); }
protected override void ShowPage() { this.pagetitle = "短消息收件箱"; if (!base.IsLogin()) { return; } if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { base.AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } if (Utils.StrIsNullOrEmpty(DNTRequest.GetFormString("pmitemid"))) { base.AddErrLine("您未选中任何短消息,当前操作失败!"); return; } if (!Utils.IsNumericList(DNTRequest.GetFormString("pmitemid"))) { base.AddErrLine("参数信息错误!"); return; } var ids = DNTRequest.GetFormString("pmitemid"); if (!String.IsNullOrEmpty(ids) || ShortMessage.DeletePrivateMessage(this.userid, ids) <= 0) { base.AddErrLine("参数无效"); return; } Users.UpdateUserNewPMCount(this.userid, this.olid); base.SetUrl("usercpinbox.aspx"); base.SetMetaRefresh(); base.SetShowBackLink(true); base.AddMsgLine("删除完毕"); } else { base.BindPrivateMessage(0); } this.newnoticecount = Notice.GetNewNoticeCountByUid(this.userid); }
/// <summary> /// 获取图片标签 /// </summary> private void GetPhotoTags() { if (!DNTRequest.IsPost() || ForumUtils.IsCrossSitePost()) { Response.Write("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } if (DNTRequest.GetInt("photoid", 0) <= 0) { return; } string filename = Utils.GetMapPath(string.Format("{0}cache/photo/{1}/{2}_tags.txt", BaseConfigs.GetForumPath, DNTRequest.GetInt("photoid", 0) / 1000 + 1, DNTRequest.GetInt("photoid", 0))); if (!File.Exists(filename)) { AlbumPluginProvider.GetInstance().WritePhotoTagsCacheFile(DNTRequest.GetInt("photoid", 0)); } WriteFile(filename); }
protected override void ShowPage() { pagetitle = "用户控制面板"; if (userid == -1) { AddErrLine("你尚未登录"); return; } user = Discuz.Forum.Users.GetUserInfo(userid); receivepmsetting = (int)user.Newsletter; if (DNTRequest.IsPost()) { user.Pmsound = DNTRequest.GetInt("pmsound", 0); receivepmsetting = 1; foreach (string rpms in DNTRequest.GetString("receivesetting").Split(',')) { if (rpms != string.Empty) { int tmp = int.Parse(rpms); receivepmsetting = receivepmsetting | tmp; } } user.Newsletter = (ReceivePMSettingType)receivepmsetting; Discuz.Forum.Users.UpdateUserPMSetting(user); ForumUtils.WriteCookie("pmsound", user.Pmsound.ToString()); SetUrl("usercppmset.aspx"); SetMetaRefresh(); SetShowBackLink(true); AddMsgLine("短消息设置已成功更新"); } }
protected override void ShowPage() { pagetitle = "短消息发件箱"; if (userid == -1) { AddErrLine("你尚未登录"); return; } user = Discuz.Forum.Users.GetUserInfo(userid); if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } string[] pmitemid = Utils.SplitString(DNTRequest.GetFormString("pmitemid"), ","); int retval = PrivateMessages.DeletePrivateMessage(userid, pmitemid); if (retval == -1) { AddErrLine("参数无效<br />"); return; } SetShowBackLink(false); AddMsgLine("删除完毕"); } else { BindItems(); } }
protected override void ShowPage() { this.pagetitle = "短消息草稿箱"; if (!base.IsLogin()) { return; } if (DNTRequest.IsPost()) { if (ShortMessage.DeletePrivateMessage(this.userid, DNTRequest.GetFormString("pmitemid")) <= 0) { base.AddErrLine("参数无效<br />"); return; } base.SetMetaRefresh(); base.SetShowBackLink(true); base.AddMsgLine("删除完毕"); } else { base.BindPrivateMessage(2); } this.newnoticecount = Notice.GetNewNoticeCountByUid(this.userid); }
/// <summary> /// 设置reurl /// </summary> private void SetReUrl() { //未提交或跨页提交时 if (!DNTRequest.IsPost() || referer != "") { string r = ""; if (referer != "") { r = DNTRequest.GetUrlReferrer(); } else { if ((DNTRequest.GetUrlReferrer() == "") || (DNTRequest.GetUrlReferrer().IndexOf("login") > -1) || DNTRequest.GetUrlReferrer().IndexOf("logout") > -1) { r = "index.aspx"; } else { r = DNTRequest.GetUrlReferrer(); } } Utils.WriteCookie("reurl", (DNTRequest.GetQueryString("reurl") == "" || DNTRequest.GetQueryString("reurl").IndexOf("login.aspx") > -1) ? r : DNTRequest.GetQueryString("reurl")); } }
protected override void ShowPage() { pagetitle = "用户控制面板"; if (userid == -1) { AddErrLine("你尚未登录"); return; } user = Users.GetUserInfo(userid); if (config.Enablespace != 1) { AddErrLine("个人空间功能已被关闭"); return; } if (user.Spaceid <= 0) { AddErrLine("您尚未开通个人空间"); return; } enabletag = config.Enabletag == 1; categoryslist = Space.Data.DbProvider.GetInstance().GetSpaceCategoryListByUserId(userid); spaceconfig = Spaces.GetSpaceConfigByUserId(userid); if (DNTRequest.IsPost()) { if (ForumUtils.IsCrossSitePost()) { AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。"); return; } if (!Utils.IsNumeric(DNTRequest.GetString("poststatus")) || !Utils.IsNumeric(DNTRequest.GetString("commentstatus"))) { AddErrLine("请您确保 发布类型,评论类型,数据项有效!"); return; } if (DNTRequest.GetString("title") == "") { AddErrLine("请您输入文章标题"); return; } if (DNTRequest.GetString("title").Length > 150) { AddErrLine("请将文章标题保持在150字以内"); return; } if (blogcontent == "") { AddErrLine("请您输入文章内容"); return; } SpacePostInfo spacepostsinfo = new SpacePostInfo(); spacepostsinfo.Title = Utils.HtmlEncode(ForumUtils.BanWordFilter(DNTRequest.GetString("title"))); spacepostsinfo.Content = Utils.HtmlEncode(ForumUtils.BanWordFilter(blogcontent)); spacepostsinfo.Category = DNTRequest.GetString("category"); spacepostsinfo.PostStatus = DNTRequest.GetFormInt("poststatus", 0); spacepostsinfo.CommentStatus = DNTRequest.GetFormInt("commentstatus", 0); spacepostsinfo.Postdatetime = DateTime.Now; spacepostsinfo.Author = username; spacepostsinfo.Uid = userid; spacepostsinfo.PostUpDateTime = DateTime.Now; spacepostsinfo.Commentcount = 0; int postid = Space.Data.DbProvider.GetInstance().AddSpacePost(spacepostsinfo); //启用了标签功能 if (enabletag) { string tags = DNTRequest.GetString("tags").Trim(); string[] tagsArray = null; if (!Utils.StrIsNullOrEmpty(tags)) { tagsArray = Utils.SplitString(tags, " ", true, 10); if (tagsArray != null && tagsArray.Length > 0) { Space.Data.DbProvider.GetInstance().CreateSpacePostTags(string.Join(" ", tagsArray), postid, userid, Utils.GetDateTime()); SpaceTags.WriteSpacePostTagsCacheFile(postid); } } } DNTCache.GetCacheService().RemoveObject("/Space/RecentUpdateSpaceAggregationList"); SetUrl("usercpspacemanageblog.aspx"); SetMetaRefresh(); SetShowBackLink(true); AddMsgLine("文章增加成功"); } }