Exemple #1
0
        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);
        }
Exemple #2
0
        protected override void ShowPage()
        {
            pagetitle = "用户控制面板";

            if (!IsLogin())
            {
                return;
            }

            if (filter == "spacecomment" && config.Enablespace == 0)
            {
                AddErrLine("系统未开启" + config.Spacename + "服务, 当前页面暂时无法访问!");
                return;
            }
            if (filter == "albumcomment" && config.Enablealbum == 0)
            {
                AddErrLine("系统未开启" + config.Albumname + "服务, 当前页面暂时无法访问!");
                return;
            }
            if ((filter == "goodstrade" || filter == "goodsleaveword") && config.Enablemall == 0)
            {
                AddErrLine("系统未开启交易服务, 当前页面暂时无法访问!");
                return;
            }

            NoticeType noticetype = Notices.GetNoticetype(filter);

            reccount = Notices.GetNoticeCountByUid(userid, noticetype);

            BindItems(reccount, "usercpnotice.aspx?filter=" + filter);
            noticeinfolist = Notices.GetNoticeinfoCollectionByUid(userid, noticetype, pageid, 16);
            newnoticecount = Notices.GetNewNoticeCountByUid(userid);
            Notices.UpdateNoticeNewByUid(userid, 0);
            OnlineUsers.UpdateNewNotices(olid);
        }
Exemple #3
0
        protected override void ShowPage()
        {
            pagetitle = "黑名单";

            if (!IsLogin())
            {
                return;
            }

            if (DNTRequest.IsPost())
            {
                if (ForumUtils.IsCrossSitePost())
                {
                    AddErrLine("您的请求来路不正确,无法提交。如果您安装了某种默认屏蔽来路信息的个人防火墙软件(如 Norton Internet Security),请设置其不要禁止来路信息后再试。");
                    return;
                }
                //当修改忽略列表信息
                if (DNTRequest.GetFormString("Ignorepm") != user.Ignorepm)
                {
                    user.Ignorepm = Utils.CutString(DNTRequest.GetFormString("Ignorepm"), 0, 999);
                    Users.UpdateUserPMSetting(user);
                }

                SetUrl("usercpignorelist.aspx");
                SetMetaRefresh();
                SetShowBackLink(true);
                AddMsgLine("操作完毕");
            }

            newnoticecount = Notices.GetNewNoticeCountByUid(userid);
        }
        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);
        }
Exemple #5
0
        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("短消息设置已成功更新");
            }
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        protected override void ShowPage()
        {
            pagetitle = "公共消息";

            if (!IsLogin())
            {
                return;
            }

            BindItems(announcepmcount);
            announcepmlist = PrivateMessages.GetAnnouncePrivateMessageCollection(16, pageid);
            newnoticecount = Notices.GetNewNoticeCountByUid(userid);
        }
Exemple #8
0
        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);
        }
Exemple #9
0
        protected override void ShowPage()
        {
            pagetitle = "用户控制面板";

            if (!IsLogin())
            {
                return;
            }

            score1 = ((decimal)user.Extcredits1).ToString();
            score2 = ((decimal)user.Extcredits2).ToString();
            score3 = ((decimal)user.Extcredits3).ToString();
            score4 = ((decimal)user.Extcredits4).ToString();
            score5 = ((decimal)user.Extcredits5).ToString();
            score6 = ((decimal)user.Extcredits6).ToString();
            score7 = ((decimal)user.Extcredits7).ToString();
            score8 = ((decimal)user.Extcredits8).ToString();

            if (!IsErr() && useradminid > 0)
            {
                admingroupinfo = AdminGroups.GetAdminGroupInfo(usergroupid);
            }

            StringBuilder sbAttachmentTypeSelect = new StringBuilder();

            if (!Utils.StrIsNullOrEmpty(usergroupinfo.Attachextensions))
            {
                sbAttachmentTypeSelect.AppendFormat("[id] in ({0})", usergroupinfo.Attachextensions);
            }

            usergroupattachtype = Attachments.GetAttachmentTypeString(sbAttachmentTypeSelect.ToString());
            newnoticecount      = Notices.GetNewNoticeCountByUid(userid);

            //if (user.Avatar.Trim().ToLower().StartsWith("http://"))
            //{
            //    avatarurl = user.Avatar;
            //    avatartype = 2;
            //    avatarwidth = user.Avatarwidth;
            //    avatarheight = user.Avatarheight;
            //}
            //else if (user.Avatar.ToLower().Trim().StartsWith(@"avatars\common\"))
            //    avatartype = 0;
        }
Exemple #10
0
        protected override void ShowPage()
        {
            if (!IsLogin())
            {
                return;
            }

            pagetitle = "查看短消息";

            if (pmid <= 0)
            {
                AddErrLine("参数无效");
                return;
            }

            if (!CreditsFacade.IsEnoughCreditsPM(userid))
            {
                canreplypm = false;
            }

            PrivateMessageInfo messageinfo = PrivateMessages.GetPrivateMessageInfo(pmid);

            if (messageinfo == null)
            {
                AddErrLine("无效的短消息ID");
                return;
            }

            if (messageinfo.Msgfrom == "系统" && messageinfo.Msgfromid == 0)
            {
                messageinfo.Message = Utils.HtmlDecode(messageinfo.Message);
            }

            if (messageinfo != null && (messageinfo.Msgtoid == userid || messageinfo.Msgfromid == userid))
            {
                //判断当前用户是否有权阅读此消息
                if (DNTRequest.GetQueryString("action").CompareTo("delete") == 0)
                {
                    ispost = true;
                    if (PrivateMessages.DeletePrivateMessage(userid, pmid) < 1)
                    {
                        AddErrLine("消息未找到,可能已被删除");
                        return;
                    }
                    else
                    {
                        AddMsgLine("指定消息成功删除,现在将转入消息列表");
                        SetUrl("usercpinbox.aspx");
                        SetMetaRefresh();
                        return;
                    }
                }

                if (DNTRequest.GetQueryString("action").CompareTo("noread") == 0)
                {
                    PrivateMessages.SetPrivateMessageState(pmid, 1); //将短消息的状态置 1 表示未读
                    ispost = true;
                    if (messageinfo.New != 1 && messageinfo.Folder == 0)
                    {
                        Users.UpdateUserNewPMCount(userid, olid); //将用户的未读短信息数据加 1
                        AddMsgLine("指定消息已被置成未读状态,现在将转入消息列表");
                        SetUrl("usercpinbox.aspx");
                        SetMetaRefresh();
                    }
                }
                else
                {
                    PrivateMessages.SetPrivateMessageState(pmid, 0); //将短消息的状态置 0 表示已读
                    if (messageinfo.New == 1 && messageinfo.Folder == 0)
                    {
                        Users.UpdateUserNewPMCount(userid, olid); //将用户的未读短信息数据减 1
                    }
                }

                msgto        = (messageinfo.Folder == 0) ? messageinfo.Msgfrom : messageinfo.Msgto;
                msgfrom      = messageinfo.Msgfrom;
                subject      = messageinfo.Subject;
                message      = UBB.ParseUrl(Utils.StrFormat(messageinfo.Message));
                postdatetime = messageinfo.Postdatetime;
                resubject    = "re:" + messageinfo.Subject;
                remessage    = Utils.HtmlEncode("> ") + messageinfo.Message.Replace("\n", "\n> ") + "\r\n\r\n";
                return;
            }
            AddErrLine("对不起, 短消息不存在或已被删除.");

            newnoticecount = Notices.GetNewNoticeCountByUid(userid);
        }