private void RolecePage() { Master.Title = "查看详细权限"; int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误")); if (!new BCW.BLL.Role().Exists(id)) { Utils.Error("不存在的记录", ""); } BCW.Model.Role model = new BCW.BLL.Role().GetRole(id); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("" + model.UsName + "权限列表:"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("", Out.Hr())); int gNum = Utils.GetStringNum(model.Rolece, ";"); builder.Append(Out.Tab("<div>", "")); string sInclude = string.Empty; if (model.Include == 1) { sInclude = "(含下级版块)"; } if (model.ForumID == -1) { builder.Append("管辖:全站"); } else if (model.ForumID == 0) { builder.Append("管辖:全区版块"); } else { builder.Append("管辖:<a href=\"" + Utils.getUrl("forum.aspx?act=view&id=" + model.ForumID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + model.ForumName + "</a>" + sInclude + ""); } builder.Append("<br />拥有权限(" + (gNum + 1) + "/40)"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("" + BCW.User.Role.OutRoleString(model.Rolece).Replace(" ", "<br />") + ""); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getPage("moderator.aspx") + "\">返回上一级</a><br />"); builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>")); builder.Append(Out.Tab("</div>", "<br />")); }
private void RecomAdminSavePage(int uid) { if (!new BCW.BLL.Role().IsSumMode(uid)) { Utils.Error("你的权限不足", ""); } int forumid = int.Parse(Utils.GetRequest("forumid", "all", 2, @"^[0-9]\d*$", "论坛ID错误")); int bid = int.Parse(Utils.GetRequest("bid", "all", 2, @"^[0-9]\d*$", "帖子ID错误")); if (!new BCW.BLL.Forum().Exists2(forumid)) { Utils.Success("访问论坛", "该论坛不存在或已暂停使用", Utils.getUrl("forum.aspx"), "1"); } if (!new BCW.BLL.Text().Exists2(bid, forumid)) { Utils.Error("帖子不存在或已被删除", ""); } string Content = Utils.GetRequest("Content", "post", 3, @"^[\s\S]{1,50}$", "附言限50字内,可以留空"); string strWhere = "Status=0 and (OverTime>='" + DateTime.Now + "' OR OverTime='1990-1-1 00:00:00')"; string usname = new BCW.BLL.User().GetUsName(uid); if (Content != "") { Content = ",附言:" + Content + ""; } string strContent = "[url=/bbs/uinfo.aspx?uid=" + uid + "]" + usname + "[/url]向全体管理员/版主推荐帖子:[url=/bbs/topic.aspx?forumid=" + forumid + "&bid=" + bid + "]" + new BCW.BLL.Text().GetTitle(bid) + "[/url]" + Content + ""; DataSet ds = new BCW.BLL.Role().GetList("UsID,UsName", strWhere); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { int ihid = int.Parse(ds.Tables[0].Rows[i]["UsID"].ToString()); string mename = ds.Tables[0].Rows[i]["UsName"].ToString(); new BCW.BLL.Guest().Add(ihid, mename, strContent); } } Utils.Success("推荐给管理员/版主", "恭喜,推荐管理员/版主成功,正在返回..", Utils.getUrl("topic.aspx?forumid=" + forumid + "&bid=" + bid + ""), "2"); }
private void DelPage() { string info = Utils.GetRequest("info", "all", 1, "", ""); int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[0-9]\d*$", "ID错误")); if (info != "ok") { Master.Title = "撤除版主"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("确定撤除此版主吗"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?info=ok&act=del&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">确定撤除</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?act=edit&id=" + id + "") + "\">先留着吧..</a>"); builder.Append(Out.Tab("</div>", "<br />")); } else { if (!new BCW.BLL.Role().Exists(id)) { Utils.Error("不存在的记录", ""); } BCW.Model.Role model = new BCW.BLL.Role().GetRole(id); //撤除 new BCW.BLL.Role().Delete(id); //发送内线给版主 if (model.ForumID > 0) { new BCW.BLL.Guest().Add(model.UsID, model.UsName, "系统管理员撤除您的版主权限"); //任职记录 new BCW.BLL.Forumlog().Add(14, id, "[url=/bbs/uinfo.aspx?uid=" + model.UsID + "]" + model.UsName + "(" + model.UsID + ")[/url]离任时间:" + DT.FormatDate(DateTime.Now, 11) + ""); } else { new BCW.BLL.Guest().Add(model.UsID, model.UsName, "系统管理员撤除您的管理员权限"); } Utils.Success("撤除版主", "撤除版主成功..", Utils.getUrl("moderator.aspx"), "1"); } }
private void AdminPage() { Master.Title = "管理团队"; int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[1-5]$", "1")); builder.Append(Out.Tab("<div class=\"title\">", "")); if (ptype == 1) { builder.Append("系统管理员"); } else if (ptype == 2) { builder.Append("论坛总版"); } else if (ptype == 3) { builder.Append("论坛版主"); } else if (ptype == 4) { builder.Append("聊吧总管理"); } else if (ptype == 5) { builder.Append("闲聊总管理"); } builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = ""; string[] pageValUrl = { "act", "ptype" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 if (ptype == 1) { strWhere += "ForumID=-1 and "; } else if (ptype == 2) { strWhere += "ForumID=0 and "; } else if (ptype == 3) { strWhere += "ForumID>0 and "; } else if (ptype == 4) { strWhere += "Rolece collate Chinese_PRC_CS_AS_WS like '%E%' and "; } else if (ptype == 5) { strWhere += "Rolece collate Chinese_PRC_CS_AS_WS like '%N%' and "; } strWhere += "(OverTime>='" + DateTime.Now + "' OR OverTime='1990-1-1 00:00:00') and Status=0"; // 开始读取列表 IList <BCW.Model.Role> listRole = new BCW.BLL.Role().GetRoles(pageIndex, pageSize, strWhere, out recordCount); if (listRole.Count > 0) { int k = 1; foreach (BCW.Model.Role n in listRole) { if (k % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { if (k == 1) { builder.Append(Out.Tab("<div>", "")); } else { builder.Append(Out.Tab("<div>", "<br />")); } } builder.Append("" + ((pageIndex - 1) * pageSize + k) + "."); string sInclude = string.Empty; if (n.Include == 1) { sInclude = "(含下级版块)"; } builder.AppendFormat("<a href=\"" + Utils.getUrl("uinfo.aspx?uid={0}&backurl=" + Utils.PostPage(1) + "") + "\">{1}</a>/<a href=\"" + Utils.getUrl("usermanage.aspx?act=role&id=" + n.ID + "&hid={0}&backurl=" + Utils.PostPage(1) + "") + "\">{2}</a>", n.UsID, BCW.User.Users.SetUser(n.UsID, 3), n.RoleName); if (n.ForumID == 0) { builder.Append("/管辖:全区版块"); } else if (n.ForumID > 0) { builder.Append("/管辖:<a href=\"" + Utils.getUrl("forum.aspx?forumid=" + n.ForumID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + n.ForumName + "" + sInclude + "</a>"); } k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 1)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getPage("default.aspx") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("manager.aspx") + "\">管理</a>"); builder.Append(Out.Tab("</div>", "")); }
private void AdminTextPage() { Master.Title = "发帖回帖清单"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("各管理发回帖清单"); builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = 5; string strWhere = ""; string[] pageValUrl = { "act" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 strWhere += "(OverTime>='" + DateTime.Now + "' OR OverTime='1990-1-1 00:00:00') and Status=0"; // 开始读取列表 IList <BCW.Model.Role> listRole = new BCW.BLL.Role().GetRoles(pageIndex, pageSize, strWhere, out recordCount); if (listRole.Count > 0) { int k = 1; foreach (BCW.Model.Role n in listRole) { if (k % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { if (k == 1) { builder.Append(Out.Tab("<div>", "")); } else { builder.Append(Out.Tab("<div>", "<br />")); } } builder.Append("" + ((pageIndex - 1) * pageSize + k) + "."); builder.AppendFormat("<a href=\"" + Utils.getUrl("uinfo.aspx?uid={0}&backurl=" + Utils.PostPage(1) + "") + "\">{1}(" + n.UsID + ")</a>", n.UsID, BCW.User.Users.SetUser(n.UsID, 3)); builder.Append("<br />本月发帖:" + new BCW.BLL.Forumstat().GetMonthCount(n.UsID, 1) + ""); builder.Append("<br />本月回帖:" + new BCW.BLL.Forumstat().GetMonthCount(n.UsID, 2) + ""); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 1)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div class=\"title\">", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getPage("default.aspx") + "\">上级</a>-"); builder.Append("<a href=\"" + Utils.getUrl("manager.aspx") + "\">管理</a>"); builder.Append(Out.Tab("</div>", "")); }
private void PositionPage(string act) { Master.Title = "查看权限"; int hid = int.Parse(Utils.GetRequest("hid", "get", 2, @"^[0-9]\d*$", "会员ID错误")); if (!new BCW.BLL.User().Exists(hid)) { Utils.Error("不存在的会员ID", ""); } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("管理会员:<a href=\"" + Utils.getUrl("uinfo.aspx?uid=" + hid + "&backurl=" + Utils.PostPage(1) + "") + "\">" + new BCW.BLL.User().GetUsName(hid) + "(" + hid + ")</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("=当前权限=<br />"); int GroupId = new BCW.BLL.Group().GetID(hid); DataSet ds = new BCW.BLL.Role().GetList("ID,UsName,RoleName,ForumID,ForumName,Include", "UsID=" + hid + " and (OverTime>='" + DateTime.Now + "' OR OverTime='1990-1-1 00:00:00') and Status=0 ORDER BY FORUMID ASC"); if (ds != null && ds.Tables[0].Rows.Count > 0 || GroupId > 0) { if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { int id = int.Parse(ds.Tables[0].Rows[i]["ID"].ToString()); int Include = int.Parse(ds.Tables[0].Rows[i]["Include"].ToString()); int forumid = int.Parse(ds.Tables[0].Rows[i]["ForumID"].ToString()); string ForumName = ds.Tables[0].Rows[i]["ForumName"].ToString(); string UsName = ds.Tables[0].Rows[i]["UsName"].ToString(); string RoleName = ds.Tables[0].Rows[i]["RoleName"].ToString(); builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?act=edit&id=" + id + "&hid=" + hid + "&backurl=" + Utils.PostPage(1) + "") + "\">[管理]</a>"); if (forumid == -1) { builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?act=rolece&id=" + id + "&hid=" + hid + "&backurl=" + Utils.PostPage(1) + "") + "\">" + RoleName + "</a> 管辖全站<br />"); } else if (forumid == 0) { builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?act=rolece&id=" + id + "&hid=" + hid + "&backurl=" + Utils.PostPage(1) + "") + "\">" + RoleName + "</a> 管辖全区版块<br />"); } else { builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?act=rolece&id=" + id + "&hid=" + hid + "&backurl=" + Utils.PostPage(1) + "") + "\">" + RoleName + "</a> 管辖<a href=\"" + Utils.getPage("forum.aspx?id=" + forumid + "") + "\">" + ForumName + "</a><br />"); } } string Limit = new BCW.BLL.User().GetLimit(hid); if (!Limit.Contains("honor")) { builder.Append("<a href=\"" + Utils.getUrl("usermanage.aspx?act=honor&hid=" + hid + "&backurl=" + Utils.getPage(0) + "") + "\">[设为荣誉版主]</a>"); } else { builder.Append("<a href=\"" + Utils.getUrl("usermanage.aspx?act=honorno&hid=" + hid + "&backurl=" + Utils.getPage(0) + "") + "\">[撤销荣誉版主]</a>"); } } if (GroupId > 0) { builder.Append("<a href=\"" + Utils.getUrl("group.aspx?act=edit&id=" + GroupId + "") + "\">" + new BCW.BLL.Group().GetTitle(GroupId) + "</a> " + ub.GetSub("GroupzName", "/Controls/group.xml") + ""); } } else { builder.Append("普通会员"); } builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?act=add&uid=" + hid + "&backurl=" + Utils.getPage(0) + "") + "\">设为版主</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?act=add2&uid=" + hid + "&backurl=" + Utils.getPage(0) + "") + "\">设为管理员</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("uinfo.aspx?act=view&uid=" + hid + "&backurl=" + Utils.getPage(0) + "") + "\">返回上一级</a><br />"); builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>")); builder.Append(Out.Tab("</div>", "<br />")); }
private void EditSavePage() { string ac = Utils.ToSChinese(Utils.GetRequest("ac", "post", 1, @"", "")); int id = int.Parse(Utils.GetRequest("id", "post", 2, @"^[0-9]\d*$", "ID错误")); string GetRole = string.Empty; if (ac == "编辑管理员") { string Roleall = Utils.GetRequest("Roleall", "post", 3, @"^[\w((;|,)\w)?]+$", "选择全局权限错误"); Roleall = Roleall.Replace(",", ";"); string Role = Utils.GetRequest("Role", "post", 3, @"^[\w((;|,)\w)?]+$", "选择权限错误"); Role = Role.Replace(",", ";"); GetRole = Roleall + ";" + Role; if (Roleall == "") { GetRole = Utils.Mid(GetRole, 1, GetRole.Length); } } else { string Role = Utils.GetRequest("Role", "post", 2, @"^[\w((;|,)\w)?]+$", "选择权限错误"); Role = Role.Replace(",", ";"); GetRole = Role; } DateTime sDay = Utils.ParseTime(Utils.GetRequest("sDay", "post", 2, DT.RegexTime, "上任时间填写错误")); string rDay = Utils.GetRequest("rDay", "post", 2, "", ""); string rName = Utils.GetRequest("rName", "post", 2, @"^[A-Za-zA-Z\d0-9\u4E00-\u9FA5]{1,10}$", "职称限10字内,不能使用特别字符"); int Include = int.Parse(Utils.GetRequest("Include", "post", 1, @"^[0-1]$", "0")); int Status = int.Parse(Utils.GetRequest("Status", "post", 2, @"^[0-1]$", "权限状态选择错误")); if (rDay == "0") { rDay = "1990-1-1 00:00:00"; } else { if (!Utils.IsRegex(rDay, DT.RegexTime)) { Utils.Error("卸任时间填写错误", ""); } } BCW.Model.Role m = new BCW.BLL.Role().GetRole(id); if (m == null) { Utils.Error("不存在的记录", ""); } //取用户昵称 string UsName = new BCW.BLL.User().GetUsName(m.UsID); //取论坛名称 string ForumName = new BCW.BLL.Forum().GetTitle(m.ForumID); BCW.Model.Role model = new BCW.Model.Role(); model.ID = id; model.UsName = UsName; model.Rolece = GetRole; model.RoleName = rName; model.ForumName = ForumName; model.StartTime = sDay; model.OverTime = DateTime.Parse(rDay); model.Include = Include; model.Status = Status; new BCW.BLL.Role().Update(model); if (ac == "编辑管理员") { new BCW.BLL.Guest().Add(m.UsID, UsName, "系统管理员编辑您的管理员权限"); Utils.Success("编辑管理员", "恭喜,编辑管理员成功,正在返回..", Utils.getPage("moderator.aspx"), "1"); } else { new BCW.BLL.Guest().Add(m.UsID, UsName, "系统管理员编辑您在论坛“" + ForumName + "”的版主权限"); Utils.Success("编辑版主", "恭喜,编辑版主成功,正在返回..", Utils.getPage("moderator.aspx"), "1"); } }
private void ReloadPage() { Master.Title = "版主管理"; int ptype = int.Parse(Utils.GetRequest("ptype", "all", 1, @"^[1-4]$", "1")); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("版主管理"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); if (ptype == 1) { builder.Append("正在上任|"); } else { builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?ptype=1") + "\">上任</a>|"); } if (ptype == 2) { builder.Append("历任版主|"); } else { builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?ptype=2") + "\">历任</a>|"); } if (ptype == 3) { builder.Append("暂停版主"); } else { builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?ptype=3") + "\">暂停</a>"); } //if (ptype == 4) // builder.Append("荣誉版主"); //else // builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?ptype=4") + "\">荣誉</a>"); builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = 200; Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = ""; string[] pageValUrl = { "ptype" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } //查询条件 if (ptype == 1) { strWhere = "(OverTime>='" + DateTime.Now + "' OR OverTime='1990-1-1 00:00:00') and Status=0"; } else if (ptype == 2) { strWhere = "OverTime<'" + DateTime.Now + "' and OverTime<>'1990-1-1 00:00:00' and Status<>1"; } else if (ptype == 3) { strWhere = "Status=1"; } //else if (ptype == 4) // strWhere = "Status=2"; // 开始读取列表 IList <BCW.Model.Role> listRole = new BCW.BLL.Role().GetRoles(pageIndex, pageSize, strWhere, out recordCount); if (listRole.Count > 0) { int k = 1; foreach (BCW.Model.Role n in listRole) { if (k % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { if (k == 1) { builder.Append(Out.Tab("<div>", "")); } else { builder.Append(Out.Tab("<div>", "<br />")); } } builder.Append("" + ((pageIndex - 1) * pageSize + k) + "."); string sInclude = string.Empty; if (n.Include == 1) { sInclude = "(含下级版块)"; } builder.AppendFormat("<a href=\"" + Utils.getUrl("moderator.aspx?act=edit&id=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">{1}/{2}</a>", n.UsID, n.UsName, n.RoleName); if (n.ForumID == 0) { builder.Append("/管辖:全区版块"); } else if (n.ForumID > 0) { builder.Append("/管辖:<a href=\"" + Utils.getUrl("forum.aspx?act=view&id=" + n.ForumID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + n.ForumName + "" + sInclude + "</a>"); } if (ptype == 1) { int gNum = Utils.GetStringNum(n.Rolece, ";"); builder.Append("/<a href=\"" + Utils.getUrl("moderator.aspx?act=rolece&id=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + (gNum + 1) + "/40</a>"); builder.Append("上任:" + DT.DateDiff2(DateTime.Now, n.StartTime) + ""); //任职记录 if (n.ForumID > 0) { new BCW.BLL.Forumlog().Add(14, n.ForumID, "[url=/bbs/uinfo.aspx?uid=" + n.UsID + "]" + n.UsName + "(" + n.UsID + ")[/url]上任时间:" + DT.FormatDate(n.StartTime, 11) + ""); } } //else if (ptype == 2) //{ // if (n.Status == 2) // builder.Append("[已是荣誉版主]"); // else // builder.Append("[<a href=\"" + Utils.getUrl("moderator.aspx?act=honor&id=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">设为荣誉版主</a>]"); //} //else if (ptype == 4) //{ // builder.Append("[<a href=\"" + Utils.getUrl("moderator.aspx?act=delhonor&id=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">取消荣誉版主</a>]"); //} k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?act=add") + "\">添加版主</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?act=add2") + "\">添加管理员</a><br />"); builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>")); builder.Append(Out.Tab("</div>", "<br />")); }
private void EditPage() { Master.Title = "编辑版主"; int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误")); if (!new BCW.BLL.Role().Exists(id)) { Utils.Error("不存在的记录", ""); } BCW.Model.Role model = new BCW.BLL.Role().GetRole(id); builder.Append(Out.Tab("<div class=\"title\">", "")); if (model.ForumID == -1) { builder.Append("编辑管理员权限"); } else if (model.ForumID == 0) { builder.Append("编辑总版主权限"); } else { builder.Append("编辑版主权限"); } builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("用户:<a href=\"" + Utils.getUrl("uinfo.aspx?act=view&uid=" + model.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + model.UsName + "(ID" + model.UsID + ")</a><br />"); string sInclude = string.Empty; if (model.Include == 1) { sInclude = "(含下级版块)"; } if (model.ForumID == -1) { builder.Append("管辖:全站"); } else if (model.ForumID == 0) { builder.Append("管辖:全区版块"); } else { builder.Append("管辖:<a href=\"" + Utils.getUrl("forum.aspx?act=view&id=" + model.ForumID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + model.ForumName + "</a>" + sInclude + ""); } int gNum = Utils.GetStringNum(model.Rolece, ";"); builder.Append("<br />当前拥有权限(" + (gNum + 1) + "/40)"); builder.Append(Out.Tab("</div>", "")); string oTime = model.OverTime.ToString(); if (model.OverTime.ToString() == "1990-1-1 0:00:00") { oTime = "0"; } string sText = string.Empty; string sName = string.Empty; string sType = string.Empty; string sValu = string.Empty; string sEmpt = string.Empty; string strText = string.Empty; string strName = string.Empty; string strType = string.Empty; string strValu = string.Empty; string strEmpt = string.Empty; string strIdea = string.Empty; string strOthe = string.Empty; string RoleString = BCW.User.Role.GetRoleString(); if (model.ForumID > 0) { sText = "权限包括下级版:/,"; sName = "Include,"; sType = "select,"; sValu = "" + model.Include + "'"; sEmpt = "0|不含|1|包含,"; RoleString = RoleString.Replace("|z|设置版主", ""); } if (model.ForumID == -1) { strText = "选择全局权限,可多选/,选择总版权限,可不选或多选/,上任时间:/,卸任时间(填0则无限期):/,职称(如:正版|副版|见习版):/," + sText + "权限状态:/,,,"; strName = "Roleall,Role,sDay,rDay,rName," + sName + "Status,id,act,backurl"; strType = "multiple,multiple,date,text,text," + sType + "select,hidden,hidden,hidden"; strValu = "" + BCW.User.Limits.GetLimitValu(model.Rolece) + "'" + BCW.User.Role.GetRoleValu(model.Rolece) + "'" + model.StartTime + "'" + oTime + "'" + model.RoleName + "'" + sValu + "" + model.Status + "'" + id + "'editsave'" + Utils.getPage(0) + ""; strEmpt = "" + BCW.User.Limits.GetLimitString() + "," + BCW.User.Role.GetRoleString() + ",false,false,false," + sEmpt + "0|正常|1|暂停,false,false,false"; strIdea = "/"; strOthe = "编辑管理员|reset,moderator.aspx,post,1,red|blue"; } else { strText = "选择权限,可多选/,上任时间:/,卸任时间(填0则无限期):/,职称(如:正版|副版|见习版):/," + sText + "权限状态:/,,,"; strName = "Role,sDay,rDay,rName," + sName + "Status,id,act,backurl"; strType = "multiple,date,text,text," + sType + "select,hidden,hidden,hidden"; strValu = "" + model.Rolece + "'" + model.StartTime + "'" + oTime + "'" + model.RoleName + "'" + sValu + "" + model.Status + "'" + id + "'editsave'" + Utils.getPage(0) + ""; strEmpt = "" + RoleString + ",false,false,false," + sEmpt + "0|正常|1|暂停,false,false,false"; strIdea = "/"; strOthe = "编辑版主|reset,moderator.aspx,post,1,red|blue"; } builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div>", "<br />")); builder.Append("温馨提示:<br />"); builder.Append("锁定会员将使会员失去所有的权限.<br />"); builder.Append("总版权限将有所有论坛的管理区域.<br />"); builder.Append("设定版主功能需有该版块权限才有此权限"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("moderator.aspx?act=del&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">撤除此版主</a><br />"); builder.Append("<a href=\"" + Utils.getPage("moderator.aspx") + "\">返回上一级</a><br />"); builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("default.aspx") + "\">返回管理中心</a>")); builder.Append(Out.Tab("</div>", "<br />")); }