private void AdminEditCheck(int generalId) { string str = "CanNotEdit"; if (PEContext.Current.Admin.Identity.IsAuthenticated) { int nodeId = ContentManage.GetCommonModelInfoById(generalId).NodeId; bool flag = false; if (PEContext.Current.Admin.IsSuperAdmin) { flag = true; } else { bool flag2 = false; bool flag3 = false; bool flag4 = false; flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, nodeId); flag3 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeId); flag4 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeId); if ((flag2 || flag4) || flag3) { flag = true; } } if (flag) { str = "OK"; } } this.XmlResponseWriter.WriteElementString("status", str); }
protected void Page_Load(object sender, EventArgs e) { this.m_Administrator = PEContext.Current.Admin.IsSuperAdmin; this.m_NodeId = BasePage.RequestInt32("NodeID"); bool flag = false; if (!this.m_Administrator) { if (this.m_NodeId > 0) { string findStr = this.m_NodeId.ToString(); NodeInfo cacheNodeById = Nodes.GetCacheNodeById(this.m_NodeId); if (cacheNodeById.IsNull) { AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!"); } if (cacheNodeById.ParentId > 0) { findStr = findStr + "," + cacheNodeById.ParentPath; } flag = StringHelper.FoundCharInArr(RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage), findStr); } else { flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1); } if (!flag) { AdminPage.WriteErrMsg("您没有此栏目的管理权限!"); } } foreach (StatusInfo info2 in Status.GetStatusList()) { if (!this.m_StatusDictionary.ContainsKey(info2.StatusCode)) { this.m_StatusDictionary.Add(info2.StatusCode, info2.StatusName); } } if (!base.IsPostBack) { Nodes.GetNodeWorkFlowId(this.m_NodeId); this.DropRescentQuery.SelectedValue = BasePage.RequestStringToLower("ListType"); this.HdnListType.Value = BasePage.RequestStringToLower("ListType"); this.HdnStatus.Value = BasePage.RequestStringToLower("status", "102"); if (this.m_NodeId > 0) { this.SmpNavigator.CurrentNode = "<a href=\"ContentManage.aspx\">栏目信息管理</a>"; this.SmpNavigator.AdditionalNode = Nodes.ShowNodeNavigation(this.m_NodeId); if (!string.IsNullOrEmpty(this.SmpNavigator.AdditionalNode)) { this.SmpNavigator.AdditionalNode = this.SmpNavigator.AdditionalNode.Replace("根节点 >>", ""); } } } }
protected void Page_Load(object sender, EventArgs e) { if (PEContext.Current.Admin.IsSuperAdmin) { this.m_Administrator = true; } this.nodeId = BasePage.RequestInt32("NodeID"); if (!base.IsPostBack) { NodeInfo cacheNodeById = new NodeInfo(true); if (this.nodeId > 0) { this.SmpNavigator.AdditionalNode = Nodes.ShowNodeNavigation(this.nodeId, "ContentRecycle.aspx"); cacheNodeById = Nodes.GetCacheNodeById(this.nodeId); this.BtnClear.Text = "清空" + cacheNodeById.NodeName + "下的信息"; this.BtnRecycle.Text = "还原" + cacheNodeById.NodeName + "下的信息"; } this.DropRescentQuery.SelectedValue = BasePage.RequestStringToLower("ListType"); this.HdnListType.Value = BasePage.RequestStringToLower("ListType"); if (!this.m_Administrator) { this.m_arrContentNodeIdManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage); bool flag = false; if (this.nodeId > 0) { string findStr = this.nodeId.ToString(); if (cacheNodeById.IsNull) { AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!"); } if (cacheNodeById.ParentId > 0) { findStr = findStr + "," + cacheNodeById.ParentPath; } if (StringHelper.FoundCharInArr(this.m_arrContentNodeIdManage, findStr)) { flag = true; } } else { flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1); } if (!flag) { this.EBtnDelete.Enabled = false; this.EBtnRestore.Enabled = false; this.BtnClear.Enabled = false; this.BtnRecycle.Enabled = false; } } } }
private void CheckPermissions(NodeInfo nodeInfo) { string checkStr = ""; string roleNodeId = ""; string str3 = ""; string str4 = ""; string str5 = ""; if (!this.Administrator) { this.m_IsNodeShow = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, nodeInfo.NodeId); this.m_IsNodeInput = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeInfo.NodeId); this.m_IsNodeManage = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeInfo.NodeId); this.m_IsCurrentNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, nodeInfo.NodeId); checkStr = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentPreview); roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentInput); str3 = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentCheck); str4 = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage); str5 = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.CurrentNodesManage); string findStr = nodeInfo.NodeId.ToString(); if ((nodeInfo.ArrChildId.IndexOf(",", StringComparison.Ordinal) > 0) && !this.m_IsNodeShow) { if (!string.IsNullOrEmpty(nodeInfo.ArrChildId)) { findStr = nodeInfo.ArrChildId; } if ((StringHelper.FoundCharInArr(checkStr, findStr) || StringHelper.FoundCharInArr(roleNodeId, findStr)) || (StringHelper.FoundCharInArr(str3, findStr) || StringHelper.FoundCharInArr(str4, findStr))) { this.m_IsShow = true; } } if (nodeInfo.ParentId > 0) { findStr = nodeInfo.ParentPath + "," + nodeInfo.NodeId.ToString(); if (!this.m_IsNodeShow) { this.m_IsNodeShow = StringHelper.FoundCharInArr(checkStr, findStr); } if (!this.m_IsNodeInput) { this.m_IsNodeInput = StringHelper.FoundCharInArr(roleNodeId, findStr); } if (!this.m_IsNodeManage) { this.m_IsNodeManage = StringHelper.FoundCharInArr(str4, findStr); } if (!this.m_IsCurrentNodesManage) { this.m_IsCurrentNodesManage = StringHelper.FoundCharInArr(str5, findStr); } } } }
protected void Page_Load(object sender, EventArgs e) { if (PEContext.Current.Admin.IsSuperAdmin) { this.m_Administrator = true; } else { this.m_arrContentNodeIdManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage); } if (!base.IsPostBack) { int nodeId = BasePage.RequestInt32("NodeID"); if (nodeId > 0) { this.SmpNavigator.AdditionalNode = Nodes.ShowNodeNavigation(nodeId, "ContentHtml.aspx"); } if (!this.m_Administrator) { bool flag = false; if (nodeId > 0) { string findStr = nodeId.ToString(); NodeInfo cacheNodeById = Nodes.GetCacheNodeById(nodeId); if (cacheNodeById.IsNull) { AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!"); } if (cacheNodeById.ParentId > 0) { findStr = findStr + "," + cacheNodeById.ParentPath; } if (StringHelper.FoundCharInArr(this.m_arrContentNodeIdManage, findStr)) { flag = true; } } else { flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1); } if (!flag) { this.BtnCreateAll.Enabled = false; this.BtnCreate.Enabled = false; this.BtnDelete.Enabled = false; } } } }
protected void Page_Load(object sender, EventArgs e) { int generalId = BasePage.RequestInt32("itemid"); if (PEContext.Current.Admin.Identity.IsAuthenticated) { CommonModelInfo commonModelInfoById = ContentManage.GetCommonModelInfoById(generalId); int nodeId = commonModelInfoById.NodeId; bool flag = false; if (PEContext.Current.Admin.IsSuperAdmin) { flag = true; } else { bool flag2 = false; bool flag3 = false; bool flag4 = false; flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, nodeId); flag3 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeId); flag4 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, -1) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeId); if ((flag2 || flag4) || flag3) { flag = true; } } if (flag) { string manageDir = SiteConfig.SiteOption.ManageDir; ModelInfo modelInfoById = ModelManager.GetModelInfoById(commonModelInfoById.ModelId); if (modelInfoById.IsEshop) { this.Session["IndexRightUrl"] = string.Concat(new object[] { base.BasePath, manageDir, "/shop/", modelInfoById.AddInfoFilePath, "?Action=Modify&NodeID=", commonModelInfoById.NodeId.ToString(), "&GeneralID=", generalId, "&ModelID=", commonModelInfoById.ModelId.ToString(), "&LinkType=", commonModelInfoById.LinkType }); } else { this.Session["IndexRightUrl"] = string.Concat(new object[] { base.BasePath, manageDir, "/Contents/", modelInfoById.AddInfoFilePath, "?Action=Modify&NodeID=", commonModelInfoById.NodeId.ToString(), "&GeneralID=", generalId, "&ModelID=", commonModelInfoById.ModelId.ToString(), "&LinkType=", commonModelInfoById.LinkType }); } BasePage.ResponseRedirect("~/" + manageDir + "/Index.aspx"); } else { BasePage.ResponseRedirect("~/Item/" + generalId + ".aspx"); } } else { BasePage.ResponseRedirect("~/Item/" + generalId + ".aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (PEContext.Current.Admin.IsSuperAdmin) { this.m_Administrator = true; } if (!this.m_Administrator) { this.m_NodeCommentReply = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeCommentReply); this.m_NodeCommentCheck = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeCommentCheck); this.m_NodeCommentManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeCommentManage); bool flag = false; int nodeId = BasePage.RequestInt32("NodeID"); if (nodeId > 0) { string findStr = nodeId.ToString(); NodeInfo cacheNodeById = Nodes.GetCacheNodeById(nodeId); if (cacheNodeById.IsNull) { AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!"); } if (cacheNodeById.ParentId > 0) { findStr = findStr + "," + cacheNodeById.ParentPath; } if (StringHelper.FoundCharInArr(this.m_NodeCommentManage, findStr)) { flag = true; } } else { flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeCommentManage, -1); } if (!flag) { this.BtnSubmit1.Enabled = false; this.BtnSubmit2.Enabled = false; this.BtnSubmit3.Enabled = false; } } if (!base.IsPostBack) { this.InitComment(); } }
protected override void OnInit(EventArgs e) { if (this.IsChecked) { base.Disabled = true; if (PEContext.Current.Admin.IsSuperAdmin) { base.Disabled = false; } else { string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, this.OperateCode); if (this.m_NodeId > 0) { bool flag = false; string findStr = ""; NodeInfo cacheNodeById = Nodes.GetCacheNodeById(this.m_NodeId); if (!cacheNodeById.IsNull) { findStr = findStr + this.m_NodeId; if (cacheNodeById.ParentId > 0) { findStr = findStr + "," + cacheNodeById.ParentPath; } flag = StringHelper.FoundCharInArr(roleNodeId, findStr); } if (flag) { base.Disabled = false; } } else if (RolePermissions.AccessCheckNodePermission(this.OperateCode, -1)) { base.Disabled = false; } } } this.Visible = true; base.OnInit(e); }
public static bool CheckRoleNodePurview(int nodeId, OperateCode operateCode) { bool flag = true; if (PEContext.Current.Admin.IsSuperAdmin || RolePermissions.AccessCheckNodePermission(operateCode, -1)) { return(flag); } if (nodeId > 0) { NodeInfo cacheNodeById = GetCacheNodeById(nodeId); flag = RolePermissions.AccessCheckNodePermission(operateCode, cacheNodeById.NodeId); if (!flag && (cacheNodeById.ParentId > 0)) { string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, operateCode); string findStr = cacheNodeById.ParentPath + "," + cacheNodeById.NodeId.ToString(); flag = StringHelper.FoundCharInArr(roleNodeId, findStr); } return(flag); } return(false); }
private void RegisterRightMenuJs() { StringBuilder builder = new StringBuilder(); builder.Append("<script language=\"JavaScript\" type=\"text/javascript\">\n"); builder.Append("<!--\n"); builder.Append("function rightMenu(nodeId,arrModelId,arrModelName,event,extra,nodeType,arrPurview) {\n"); builder.Append(" var toolMenu = new WebFXMenu;\n"); builder.Append(" toolMenu.width = 100;\n"); builder.Append(" var isMenu = false;\n"); builder.Append(" if(nodeId == 'root')\n"); builder.Append(" {\n"); if (RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, -1) || PEContext.Current.Admin.IsSuperAdmin) { builder.Append(" toolMenu.add(new WebFXMenuItem('添加栏目节点','javascript:going(\"addNode\",\"\",\"' + nodeId + '\")','添加栏目节点'));\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('添加单页节点','javascript:going(\"single\",\"\",\"' + nodeId + '\")','添加单页节点'));\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('添加外部链接','javascript:going(\"link\",\"\",\"' + nodeId + '\")','添加外部链接'));\n"); builder.Append(" isMenu = true;\n"); } builder.Append(" } \n"); builder.Append(" else \n"); builder.Append(" {\n"); builder.Append(" var currentNodesManage = arrPurview.indexOf(\"1\");\n"); builder.Append(" var childNodesManage = arrPurview.indexOf(\"2\");\n"); builder.Append(" switch(nodeType) {\n"); builder.Append(" case \"Container\": \n"); builder.Append(" if (currentNodesManage >= 0)\n"); builder.Append(" {\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('修改设置','javascript:going(\"setNode\",\"\",\"' + nodeId + '\")','修改设置'));\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('复制节点','javascript:going(\"copyNode\",\"\",\"' + nodeId + '\")','复制节点'));\n"); builder.Append(" }\n"); builder.Append(" if (childNodesManage >= 0)\n"); builder.Append(" {\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('添加子节点','javascript:going(\"addChildNode\",\"\",\"' + nodeId + '\")','添加子节点'));\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('添加单页节点','javascript:going(\"single\",\"\",\"' + nodeId + '\")','添加单页节点'));\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('添加外部链接','javascript:going(\"link\",\"\",\"' + nodeId + '\")','添加外部链接'));\n"); builder.Append(" if(arrModelName == 'child')\n"); builder.Append(" {\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('复位子节点','javascript:going(\"resetChildNode\",\"\",\"' + nodeId + '\")','复位子节点 '));\n"); builder.Append(" } \n"); builder.Append(" isMenu = true;\n"); builder.Append(" }\n"); builder.Append(" if (currentNodesManage >= 0)\n"); builder.Append(" {\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('移动节点','javascript:going(\"move\",\"\",\"' + nodeId + '\")','移动节点'));\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('清空节点','javascript:going(\"clear\",\"\",\"' + nodeId + '\")','清空节点'));\n"); builder.Append(" if(nodeId!=-2){toolMenu.add(new WebFXMenuItem('删除节点','javascript:going(\"delete\",\"\",\"' + nodeId + '\")','删除节点'));}\n"); builder.Append(" isMenu = true;\n"); builder.Append(" }\n"); builder.Append(" break;\n"); builder.Append(" case \"Link\": \n"); builder.Append(" case \"Single\": \n"); builder.Append(" if (currentNodesManage >= 0)\n"); builder.Append(" {\n"); builder.Append(" isMenu = true;\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('修改设置','javascript:going(\"setNode\",\"\",\"' + nodeId + '\")','修改设置'));\n"); builder.Append(" if(nodeId!=-2)"); builder.Append(" { toolMenu.add(new WebFXMenuItem('复制节点','javascript:going(\"copyNode\",\"\",\"' + nodeId + '\")','复制节点'));\n"); builder.Append(" toolMenu.add(new WebFXMenuItem('删除节点','javascript:going(\"delete\",\"\",\"' + nodeId + '\")','删除节点'));}\n"); builder.Append(" }\n"); builder.Append(" break;\n"); builder.Append(" }\n"); builder.Append(" }\n"); builder.Append(" if (isMenu == true) {\n"); builder.Append(" document.getElementById(\"menudata\").innerHTML = toolMenu;\n"); builder.Append(" var yScrolltop;\n"); builder.Append(" var xScrollleft;\n"); builder.Append(" if (self.pageYOffset || self.pageXOffset) {\n"); builder.Append(" yScrolltop = self.pageYOffset;\n"); builder.Append(" xScrollleft = self.pageXOffset;\n"); builder.Append(" } else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft ){// Explorer 6 Strict \n"); builder.Append(" yScrolltop = document.documentElement.scrollTop;\n"); builder.Append(" xScrollleft = document.documentElement.scrollLeft;\n"); builder.Append(" } else if (document.body) {// all other Explorers\n"); builder.Append(" yScrolltop = document.body.scrollTop;\n"); builder.Append(" xScrollleft = document.body.scrollLeft;\n"); builder.Append(" }\n"); builder.Append(" toolMenu.left = event.clientX + xScrollleft;\n"); builder.Append(" toolMenu.top = event.clientY + document.body.scrollTop + yScrolltop;\n"); builder.Append(" toolMenu.show();\n"); builder.Append(" }\n"); builder.Append("}\n"); builder.Append("function going(type,modelId,nodeId)\n"); builder.Append("{\n"); builder.Append(" if(type==\"addcontent\")\n"); builder.Append(" {\n"); builder.Append(" var url = \"Content.aspx?Action=add&NodeId=\" + nodeId + \"&ModelID=\" + modelId;\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append(" if(type==\"setNode\")\n"); builder.Append(" {\n"); builder.Append(" var url = \"Category.aspx?Action=Modify&NodeID=\" + nodeId;\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append(" if(type==\"copyNode\")\n"); builder.Append(" {\n"); builder.Append(" var url = \"Category.aspx?Action=Copy&NodeID=\" + nodeId;\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append(" if(type==\"addChildNode\")\n"); builder.Append(" {\n"); builder.Append(" var url = \"Category.aspx?Action=Add&NodeID=\" + nodeId + \"&ParentID=\" + nodeId;\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append(" if(type==\"addNode\")\n"); builder.Append(" {\n"); builder.Append(" var url = \"Category.aspx\";\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append(" if(type==\"move\")\n"); builder.Append(" {\n"); builder.Append(" var url = \"CategoryMove.aspx?NodeID=\" + nodeId;\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append(" if(type==\"clear\")\n"); builder.Append(" {\n"); builder.Append(" var isConfirm = confirm('清空节点将把节点(包括子节点)的所有文章放入回收站中!确定要清空此节点吗?');\n"); builder.Append(" if(isConfirm)\n"); builder.Append(" {\n"); builder.Append(" var url = \"CategoryManage.aspx?Action=clear&NodeId=\" + nodeId;\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append(" }\n"); builder.Append(" if(type==\"resetChildNode\")\n"); builder.Append(" {\n"); builder.Append(" var isConfirm = confirm('“复位子节点”将把此节点的所有子节点都复位成二级子节点!请慎重操作!确定要复位子节点吗');\n"); builder.Append(" if(isConfirm)\n"); builder.Append(" {\n"); builder.Append(" var url = \"CategoryManage.aspx?Action=ResetChildNodes&NodeID=\" + nodeId;\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append(" }\n"); builder.Append(" if(type==\"delete\")\n"); builder.Append(" {\n"); builder.Append(" var isConfirm = confirm('删除节点将删除该节点所有相关数据,确定要删除此节点吗?');\n"); builder.Append(" if(isConfirm)\n"); builder.Append(" {\n"); builder.Append(" var url = \"" + AdminPage.AppendSecurityCode("CategoryManage.aspx?Action=Delete") + "&NodeID=\" + nodeId;\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append(" }\n"); builder.Append(" if(type==\"link\")\n"); builder.Append(" {\n"); builder.Append(" var url = \"OutLink.aspx?NodeId=\" + nodeId\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append(" if(type==\"single\")\n"); builder.Append(" {\n"); builder.Append(" var url = \"Single.aspx?NodeId=\" + nodeId\n"); builder.Append(" JumpToMainRight(url);\n"); builder.Append(" }\n"); builder.Append("}\n"); builder.Append("//-->\n"); builder.Append("</script>\n"); this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "EasyOne.Controls.XLoadTree.Resources.rightMenujs", builder.ToString()); }
private static void CheckPurview(NodeInfo nodeInfo, ref bool isShow, ref bool isCurrentNodesManage, ref bool isChildNodesManage, ref string arrCurrentNodesManage) { if (!Administrator) { isCurrentNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, -1); if (!isCurrentNodesManage) { isCurrentNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, nodeInfo.NodeId); } isChildNodesManage = !RolePermissions.AccessCheckNodePermission(OperateCode.ChildNodesManage, -1); if (!isChildNodesManage) { isChildNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.ChildNodesManage, nodeInfo.NodeId); } switch (nodeInfo.NodeType) { case NodeType.Container: { string findStr = nodeInfo.NodeId.ToString(); if ((nodeInfo.ArrChildId.IndexOf(",", StringComparison.Ordinal) > 0) && !isCurrentNodesManage) { if (!string.IsNullOrEmpty(nodeInfo.ArrChildId)) { findStr = nodeInfo.ArrChildId; } arrCurrentNodesManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.CurrentNodesManage); if (StringHelper.FoundCharInArr(arrCurrentNodesManage, findStr)) { isShow = true; } } if (nodeInfo.ParentId > 0) { foreach (string str2 in nodeInfo.ParentPath.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)) { if (str2 != "0") { if (!isCurrentNodesManage) { isCurrentNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, DataConverter.CLng(str2)); } if (!isChildNodesManage) { isChildNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.ChildNodesManage, DataConverter.CLng(str2)); } if (isCurrentNodesManage && isChildNodesManage) { return; } } } return; } return; } case NodeType.Special: return; case NodeType.Single: case NodeType.Link: if (!isCurrentNodesManage) { isShow = false; isCurrentNodesManage = false; } return; } } }
private void AddXTreeItem(XTreeCollection xTreeList, NodeInfo nodeInfo) { bool flag = false; bool flag2 = false; if (nodeInfo.NodeType == NodeType.Container) { flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeCommentManage, nodeInfo.NodeId); if (!Administrator && (nodeInfo.ArrChildId.IndexOf(",", StringComparison.Ordinal) > 0)) { foreach (NodeInfo info in Nodes.GetNodesListInArrChildId(nodeInfo.ArrChildId)) { if (RolePermissions.AccessCheckNodePermission(OperateCode.NodeCommentManage, info.NodeId)) { flag = true; break; } } } } if (flag2 || flag) { XTreeItem item = new XTreeItem(); item.NodeId = nodeInfo.NodeId.ToString(); item.Text = nodeInfo.NodeName; item.ArrModelId = ""; item.ArrModelName = ""; item.Target = "main_right"; item.Expand = "0"; item.Action = string.Concat(new object[] { "CommentManage.aspx?NodeID=", nodeInfo.NodeId, "&NodeName=", base.Server.UrlEncode(nodeInfo.NodeName) }); string str = ""; string str2 = ""; if (!flag2) { str = "Forbid"; str2 = "0"; } else { switch (nodeInfo.PurviewType) { case 0: str = "Container"; break; case 1: str = "HalfOpen"; break; case 2: str = "Purview"; break; default: str = "Container"; break; } str2 = "2"; } item.Icon = str; item.AnchorType = str2; if (nodeInfo.Child > 0) { item.XmlSrc = "CommentTreeXml.aspx?NodeID=" + nodeInfo.NodeId; } xTreeList.Add(item); } }
protected void Page_Load(object sender, EventArgs e) { this.m_Administrator = PEContext.Current.Admin.IsSuperAdmin; this.m_NodeId = BasePage.RequestInt32("NodeID"); foreach (StatusInfo info in Status.GetStatusList()) { if (!this.m_StatusDictionary.ContainsKey(info.StatusCode)) { this.m_StatusDictionary.Add(info.StatusCode, info.StatusName); } } if (!base.IsPostBack) { int nodeWorkFlowId = Nodes.GetNodeWorkFlowId(this.m_NodeId); if (this.m_Administrator) { this.EBtnPass.Text = "终审通过"; } else { string[] strArray = PEContext.Current.Admin.Roles.Split(new char[] { ',' }); FlowProcessInfo info2 = new FlowProcessInfo(true); foreach (string str in strArray) { FlowProcessInfo flowProcessByRoles = FlowProcess.GetFlowProcessByRoles(nodeWorkFlowId, DataConverter.CLng(str)); if (flowProcessByRoles.PassActionStatus > info2.PassActionStatus) { info2 = flowProcessByRoles; } bool isNull = info2.IsNull; } if (info2.IsNull) { this.EBtnPass.Visible = false; this.EBtnCancelPass.Visible = false; } else { this.EBtnPass.Text = info2.PassActionName; } } this.DropRescentQuery.SelectedValue = BasePage.RequestStringToLower("ListType"); this.HdnListType.Value = BasePage.RequestStringToLower("ListType"); this.RadlContent.SelectedValue = BasePage.RequestStringToLower("status", "100"); this.HdnStatus.Value = BasePage.RequestStringToLower("status", "100"); if (this.m_NodeId > 0) { this.SmpNavigator.CurrentNode = "<a href=\"ContentManage.aspx\">栏目信息管理</a>"; this.SmpNavigator.AdditionalNode = Nodes.ShowNodeNavigation(this.m_NodeId); if (!string.IsNullOrEmpty(this.SmpNavigator.AdditionalNode)) { this.SmpNavigator.AdditionalNode = this.SmpNavigator.AdditionalNode.Replace("根节点 >>", ""); } IList <FieldInfo> nodeFieldList = ModelManager.GetNodeFieldList(this.m_NodeId); if (nodeFieldList != null) { foreach (FieldInfo info4 in nodeFieldList) { if (info4.EnableShowOnSearchForm && (info4.FieldName != "Title")) { this.DrpSearchType.Items.Add(new ListItem(info4.FieldAlias, info4.FieldName)); } } } } } if (!this.m_Administrator) { this.m_arrNodeIdShow = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentPreview); this.m_arrNodeIdCheck = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentCheck); this.m_arrNodeIdManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage); if (this.m_NodeId > 0) { string findStr = this.m_NodeId.ToString(); NodeInfo cacheNodeById = Nodes.GetCacheNodeById(this.m_NodeId); if (cacheNodeById.IsNull) { AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!"); } if (cacheNodeById.ParentId > 0) { findStr = findStr + "," + cacheNodeById.ParentPath; } this.m_isCheck = StringHelper.FoundCharInArr(this.m_arrNodeIdCheck, findStr); this.m_isManage = StringHelper.FoundCharInArr(this.m_arrNodeIdManage, findStr); } else { this.m_isCheck = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, -1); this.m_isManage = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1); } if (!this.m_isManage) { this.EBtnBatchDelete.Enabled = false; this.EBtnBatchSet.Enabled = false; this.BatchSpecialSet.Enabled = false; this.BatchNodeSet.Enabled = false; this.EBtnBatchMove.Enabled = false; this.BtnArchiving.Enabled = false; } if (!this.m_isCheck) { this.EBtnPass.Enabled = false; this.EBtnCancelPass.Enabled = false; } } else { this.LblContentAdvancedSearch.Visible = true; } }
private static void AddXTreeItem(XTreeCollection xTreeList, NodeInfo nodeInfo) { s_IsShow = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, nodeInfo.NodeId); s_IsInput = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeInfo.NodeId); s_IsManage = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeInfo.NodeId); string str = ""; if (!s_IsAdministrator) { if (nodeInfo.ArrChildId.IndexOf(",", StringComparison.Ordinal) > 0) { foreach (NodeInfo info in Nodes.GetNodesListInArrChildId(nodeInfo.ArrChildId)) { s_IsChildNodePurview = (RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, info.NodeId) || RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, info.NodeId)) || RolePermissions.AccessCheckNodePermission(OperateCode.ContentManage, info.NodeId); if (s_IsChildNodePurview) { break; } } } else { s_EnableAddWhenHasChild = true; } } if (ModelManager.GetNodesModelTemplateRelationShip(nodeInfo.NodeId, DataConverter.CLng(HttpContext.Current.Request["ModelId"])).IsNull) { s_IsInput = false; s_IsManage = false; } if ((s_IsShow || s_IsInput) || (s_IsManage || s_IsChildNodePurview)) { XTreeItem item = new XTreeItem(); item.Text = nodeInfo.NodeName; item.ArrModelId = "0"; item.ArrModelName = ""; item.NodeId = nodeInfo.NodeId.ToString(); item.Target = ""; item.Expand = "0"; if (nodeInfo.Child > 0) { item.XmlSrc = string.Concat(new object[] { "ContentSelectTreeXml.aspx?NodeID=", nodeInfo.NodeId, "&ModelId=", HttpContext.Current.Request["ModelId"] }); } if (!s_IsInput && !s_IsManage) { str = "Forbid"; item.AnchorType = "0"; } else { switch (nodeInfo.PurviewType) { case 0: str = "Container"; break; case 1: str = "HalfOpen"; break; case 2: str = "Purview"; break; default: str = "Container"; break; } item.AnchorType = "2"; if (!s_EnableAddWhenHasChild) { str = "Forbid"; item.AnchorType = "0"; } } item.Icon = str; xTreeList.Add(item); } }
private void InitSubMenuLi(StringBuilder sb, string channelMenuId) { string xpath = this.xmlPath + "/channelMenu[@id='" + channelMenuId + "']"; XmlNode node = this.xmlDoc.SelectSingleNode(xpath); if ((node != null) && node.HasChildNodes) { foreach (XmlNode node2 in node) { string str5; string attributeValue = this.GetAttributeValue(node2, "id"); if (!this.CheckIsShowSubMenuLi(node2)) { continue; } if (node2.Name == "mainMenu") { string str6; bool hasChildNodes = node2.HasChildNodes; if ((((str6 = this.GetAttributeValue(node2, "id")) != null) && (str6 == "NodesManage")) && !PEContext.Current.Admin.IsSuperAdmin) { hasChildNodes = RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, -1); } if (hasChildNodes) { sb.Append("<li onmouseover=\"show('" + attributeValue + "');hideOthers('" + attributeValue + "');\" onmouseout=\"hide('" + attributeValue + "')\">\n"); } else { sb.Append("<li onmouseover=\"hideOthers('" + attributeValue + "');\">\n"); } } else { sb.Append("<li>\n"); } string str3 = this.GetAttributeValue(node2, "leftUrl"); string str4 = this.GetAttributeValue(node2, "rightUrl"); if (this.GetAttributeValue(node2.ParentNode, "id") != "MenuMyDeskTop") { if (string.IsNullOrEmpty(str3) || string.IsNullOrEmpty(str4)) { sb.Append("<a href=\"#\">\n"); } else { sb.Append("<a href=\"#\" onclick=\"ShowMain('" + str3 + "','" + str4 + "')\">\n"); } sb.Append(this.GetAttributeValue(node2, "title")); sb.Append("</a>\n"); } else { string name = node2.Name; if (name == null) { goto Label_025C; } if (!(name == "SignOut")) { if (name == "Welcome") { goto Label_0235; } goto Label_025C; } sb.Append("<a id=\"LinkButton1\" href=\"Logout.aspx\">" + node2.InnerText + "</a>"); } goto Label_02AD; Label_0235: str5 = string.Format(node2.InnerText, PEContext.Current.Admin.AdminName); sb.Append(str5); goto Label_02AD; Label_025C :; sb.Append("<a href=\"#\" onclick=\"ShowMain('" + str3 + "','" + str4 + "')\">\n"); sb.Append(attributeValue); sb.Append("</a>\n"); Label_02AD: this.InitDivMenu(sb, attributeValue, xpath + "/mainMenu[@id='" + attributeValue + "']"); sb.Append("</li>\n"); } } }
private void InitPage() { this.m_GeneralId = BasePage.RequestInt32("GeneralID"); if (base.Request.UrlReferrer != null) { this.ViewState["UrlReferrer"] = base.Request.UrlReferrer.ToString(); } this.contentDataTable = ContentManage.GetContentDataById(this.m_GeneralId); if ((this.contentDataTable == null) || (this.contentDataTable.Rows.Count == 0)) { AdminPage.WriteErrMsg("<li>指定项目不存在!</li>"); } this.InitContent(); int nodeId = DataConverter.CLng(this.contentDataTable.Rows[0]["NodeId"]); if (!PEContext.Current.Admin.IsSuperAdmin) { bool flag = false; string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage); if (nodeId > 0) { string findStr = nodeId.ToString(); NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(nodeId); if (cacheNodeById.IsNull) { AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!"); } if (!RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, cacheNodeById.NodeId)) { AdminPage.WriteErrMsg("您没有查看该信息的权限!"); } if (cacheNodeById.ParentId > 0) { findStr = findStr + "," + cacheNodeById.ParentPath; } flag = StringHelper.FoundCharInArr(roleNodeId, findStr); } else { flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1); } if (!flag) { this.EBtnModify.Enabled = false; this.EBtnDelete.Enabled = false; } } CommonModelInfo prevInfo = ContentManage.GetPrevInfo(nodeId, this.m_GeneralId); if (!prevInfo.IsNull) { this.LnkGetPrevInfo.Text = prevInfo.Title; this.LnkGetPrevInfo.NavigateUrl = ModelManager.GetModelInfoById(prevInfo.ModelId).PreviewInfoFilePath + "?GeneralID=" + prevInfo.GeneralId.ToString(); } else { this.LnkGetPrevInfo.Text = "没有了"; } CommonModelInfo nextInfo = ContentManage.GetNextInfo(nodeId, this.m_GeneralId); if (!nextInfo.IsNull) { this.LnkGetNextInfo.Text = nextInfo.Title; this.LnkGetNextInfo.NavigateUrl = ModelManager.GetModelInfoById(prevInfo.ModelId).PreviewInfoFilePath + "?GeneralID=" + nextInfo.GeneralId.ToString(); } else { this.LnkGetNextInfo.Text = "没有了"; } this.SmpNavigator.AdditionalNode = EasyOne.Contents.Nodes.ShowNodeNavigation(nodeId); if (!string.IsNullOrEmpty(this.SmpNavigator.AdditionalNode)) { this.SmpNavigator.AdditionalNode = this.SmpNavigator.AdditionalNode.Replace("根节点 >>", ""); } if (!this.Page.IsPostBack) { int nodeWorkFlowId = EasyOne.Contents.Nodes.GetNodeWorkFlowId(nodeId); string roles = PEContext.Current.Admin.Roles; FlowProcessInfo flowProcessByRoles = FlowProcess.GetFlowProcessByRoles(nodeWorkFlowId, roles); int passActionStatus = 0; if (PEContext.Current.Admin.IsSuperAdmin || (nodeWorkFlowId == -1)) { passActionStatus = 0x63; } else if (!flowProcessByRoles.IsNull) { passActionStatus = flowProcessByRoles.PassActionStatus; } else { this.EBtnCheck.Visible = false; } if ((passActionStatus > 0) && (passActionStatus > DataConverter.CLng(this.contentDataTable.Rows[0]["Status"]))) { this.EBtnCheck.CommandArgument = passActionStatus.ToString(); this.EBtnCheck.Text = "审核通过"; } else { this.EBtnCheck.CommandArgument = "0"; this.EBtnCheck.Text = "取消审核"; } } }
protected void Page_Load(object sender, EventArgs e) { this.m_GeneralId = BasePage.RequestInt32("GeneralID"); this.InitPage(); this.InitComment(); int nodeId = DataConverter.CLng(this.contentDataTable.Rows[0]["NodeId"]); if (!PEContext.Current.Admin.IsSuperAdmin) { bool flag = false; string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage); if (nodeId > 0) { string findStr = nodeId.ToString(); NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(nodeId); if (cacheNodeById.IsNull) { AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!"); } if (!RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, cacheNodeById.NodeId)) { AdminPage.WriteErrMsg("您没有查看该信息的权限!"); } if (cacheNodeById.ParentId > 0) { findStr = findStr + "," + cacheNodeById.ParentPath; } flag = StringHelper.FoundCharInArr(roleNodeId, findStr); } else { flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1); } if (!flag) { this.EBtnModify.Enabled = false; this.EBtnDelete.Enabled = false; } } CommonModelInfo prevInfo = ContentManage.GetPrevInfo(nodeId, this.m_GeneralId); if (!prevInfo.IsNull) { this.LnkGetPrevInfo.Text = prevInfo.Title; this.LnkGetPrevInfo.NavigateUrl = ModelManager.GetModelInfoById(prevInfo.ModelId).PreviewInfoFilePath + "?GeneralID=" + prevInfo.GeneralId.ToString(); } else { this.LnkGetPrevInfo.Text = "没有了"; } CommonModelInfo nextInfo = ContentManage.GetNextInfo(nodeId, this.m_GeneralId); if (!nextInfo.IsNull) { this.LnkGetNextInfo.Text = nextInfo.Title; this.LnkGetNextInfo.NavigateUrl = ModelManager.GetModelInfoById(prevInfo.ModelId).PreviewInfoFilePath + "?GeneralID=" + nextInfo.GeneralId.ToString(); } else { this.LnkGetNextInfo.Text = "没有了"; } }
protected void Page_Load(object sender, EventArgs e) { string basePath = ""; basePath = base.BasePath; basePath = this.Page.Request.Url.Scheme + "://" + this.Page.Request.Url.Authority + basePath; this.Adrp.DropArrowImageUrl = basePath + "Admin/Images/sitelist.gif"; int nodeId = BaseUserControl.RequestInt32("NodeID"); bool isSuperAdmin = PEContext.Current.Admin.IsSuperAdmin; bool flag2 = false; bool flag3 = false; if (!isSuperAdmin) { string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentInput); string checkStr = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage); if (nodeId > 0) { string findStr = nodeId.ToString(); NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(nodeId); if (cacheNodeById.IsNull) { BaseUserControl.WriteErrMsg("当前栏目不存在,可能被删除了请返回!"); } if (cacheNodeById.ParentId > 0) { findStr = findStr + "," + cacheNodeById.ParentPath; } flag3 = StringHelper.FoundCharInArr(checkStr, findStr); flag2 = StringHelper.FoundCharInArr(roleNodeId, findStr); } else { flag3 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1); flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, -1); } if (!flag2) { this.LblAddProduct.Enabled = false; this.ELnkProductImport.Enabled = false; } if (!flag3) { this.ELnkContentList.Enabled = false; this.ELnkProductRecycle.Enabled = false; this.ELnkProductStockManage.Enabled = false; this.ELnkProductBatchModify.Enabled = false; this.ELnkProductHtml.Enabled = false; } } if ((nodeId > 0) && ((flag2 || flag3) || isSuperAdmin)) { DataTable shopModelListByNodeId = ModelManager.GetShopModelListByNodeId(nodeId, true); if (shopModelListByNodeId.Rows.Count <= 1) { this.LblAddProduct.Visible = false; } else { this.RptModelList.DataSource = shopModelListByNodeId; this.RptModelList.DataBind(); } if (shopModelListByNodeId.Rows.Count == 1) { this.HlkModel.Visible = true; string str5 = ""; str5 = string.Concat(new object[] { "~/Admin/Shop/", shopModelListByNodeId.Rows[0]["AddInfoFilePath"].ToString(), "?Action=add&modelId=", shopModelListByNodeId.Rows[0]["ModelId"].ToString(), "&NodeID=", BaseUserControl.RequestInt32("NodeID") }); this.HlkModel.NavigateUrl = str5; this.HlkModel.Text = "添加" + shopModelListByNodeId.Rows[0]["ItemName"].ToString(); } if (!this.LblAddProduct.Visible && !this.HlkModel.Visible) { this.LitSeparator.Visible = false; } } else { this.LblAddProduct.Visible = false; this.HlkModel.Visible = false; this.LitSeparator.Visible = false; } }