From: <m_h...@us...> - 2006-07-28 23:08:41
|
Revision: 237 Author: m_hildebrand Date: 2006-07-28 16:08:31 -0700 (Fri, 28 Jul 2006) ViewCVS: http://svn.sourceforge.net/tcdb/?rev=237&view=rev Log Message: ----------- Theme changes Removed rights from administration tree Modified Paths: -------------- Website/App_Code/Common.cs Website/App_Code/SiteMaster.cs Website/App_Code/Users.cs Website/App_Themes/Python/python.css Website/Includes/AdministrationTree.ascx.cs Website/Includes/UserSettings.ascx Website/Includes/UserSettings.ascx.cs Modified: Website/App_Code/Common.cs =================================================================== --- Website/App_Code/Common.cs 2006-07-28 23:04:20 UTC (rev 236) +++ Website/App_Code/Common.cs 2006-07-28 23:08:31 UTC (rev 237) @@ -1201,6 +1201,7 @@ public static int NOTREGISTERED = -1; public static int NEWUSER = -1; + // Defaults in the database public static int ANONYMOUSUSERID = 1; public static int PRODUCT_SITEID = 1; Modified: Website/App_Code/SiteMaster.cs =================================================================== --- Website/App_Code/SiteMaster.cs 2006-07-28 23:04:20 UTC (rev 236) +++ Website/App_Code/SiteMaster.cs 2006-07-28 23:08:31 UTC (rev 237) @@ -7,6 +7,7 @@ using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; +using System.Web.Configuration; using TCDB.Users; using TCDB.Common; using log4net; @@ -30,7 +31,12 @@ //TimeSpan d = DateTime.Now - m_startTime; //d.Milliseconds; - } + }/* + else + { + PagesSection ps = (PagesSection)WebConfigurationManager.OpenWebConfiguration("").GetSection("system.web/pages"); + ps.ValidateRequest = false; + }*/ } public DateTime LoadStartTime() @@ -41,6 +47,7 @@ } return DateTime.Now; + } public User LoadSessionUser() Modified: Website/App_Code/Users.cs =================================================================== --- Website/App_Code/Users.cs 2006-07-28 23:04:20 UTC (rev 236) +++ Website/App_Code/Users.cs 2006-07-28 23:08:31 UTC (rev 237) @@ -386,6 +386,11 @@ return p_username.Trim(); } + public bool HasRight(string right) + { + return HasRight(right, Constants.PRODUCT_SITEID); + } + public bool HasRight(string right, int productID) { if (p_rights.ContainsKey(productID)) Modified: Website/App_Themes/Python/python.css =================================================================== --- Website/App_Themes/Python/python.css 2006-07-28 23:04:20 UTC (rev 236) +++ Website/App_Themes/Python/python.css 2006-07-28 23:08:31 UTC (rev 237) @@ -311,6 +311,29 @@ } /*********** END Form Content ***********/ +/********** BEGIN User Settings **************/ +#fullname input +{ + width: 75px; +} + +#fullname input + input +{ + width: 100px; +} + +* html #fullname input +{ + width: 100px; +} + +#email input +{ + width: 200px; +} + +/********** END User Settings *************/ + /********** BEGIN Box Content **********/ /* Snazzy borders by Stu Nicholls (http://www.cssplay.co.uk/boxes/snazzy.html) */ .xsnazzy Modified: Website/Includes/AdministrationTree.ascx.cs =================================================================== --- Website/Includes/AdministrationTree.ascx.cs 2006-07-28 23:04:20 UTC (rev 236) +++ Website/Includes/AdministrationTree.ascx.cs 2006-07-28 23:08:31 UTC (rev 237) @@ -47,7 +47,7 @@ // Add Admin Settings TreeNode newNode = new TreeNode(); - newNode.Text = "<font color=green>Site Settings</font>"; + newNode.Text = "Site Settings"; newNode.Value = "admin"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -87,7 +87,7 @@ // Users newNode = new TreeNode(); - newNode.Text = "<font color=black>Users</font>"; + newNode.Text = "Users"; newNode.Value = "users"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -97,7 +97,7 @@ // Roles newNode = new TreeNode(); - newNode.Text = "<font color=black>User Roles</font>"; + newNode.Text = "User Roles"; newNode.Value = "roles"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -106,18 +106,18 @@ newNode.Expand(); // Rights - newNode = new TreeNode(); - newNode.Text = "<font color=black>User Rights</font>"; + /*newNode = new TreeNode(); + newNode.Text = "User Rights"; newNode.Value = "rights"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; parent.ChildNodes.Add(newNode); if (nodes.Contains(newNode.ValuePath)) - newNode.Expand(); + newNode.Expand();*/ // Operating Systems newNode = new TreeNode(); - newNode.Text = "<font color=black>Operating Systems</font>"; + newNode.Text = "Operating Systems"; newNode.Value = "os"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -127,7 +127,7 @@ // Architectures newNode = new TreeNode(); - newNode.Text = "<font color=black>Architectures</font>"; + newNode.Text = "Architectures"; newNode.Value = "arch"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -204,7 +204,7 @@ // Versions newNode = new TreeNode(); - newNode.Text = "<font color=black>Releases</font>"; + newNode.Text = "Releases"; newNode.Value = "release"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -214,7 +214,7 @@ // Tags newNode = new TreeNode(); - newNode.Text = "<font color=black>Tags</font>"; + newNode.Text = "Tags"; newNode.Value = "tag"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -224,7 +224,7 @@ // Status Labels newNode = new TreeNode(); - newNode.Text = "<font color=black>Status Levels</font>"; + newNode.Text = "Status Levels"; newNode.Value = "status"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -234,7 +234,7 @@ // Labs newNode = new TreeNode(); - newNode.Text = "<font color=black>Labs</font>"; + newNode.Text = "Labs"; newNode.Value = "lab"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -244,7 +244,7 @@ // Roles newNode = new TreeNode(); - newNode.Text = "<font color=black>Roles</font>"; + newNode.Text = "Roles"; newNode.Value = "role"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -255,7 +255,7 @@ // Users newNode = new TreeNode(); - newNode.Text = "<font color=black>Users</font>"; + newNode.Text = "Users"; newNode.Value = "user"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -270,7 +270,7 @@ // Action Item newNode = new TreeNode(); - newNode.Text = "<font color=black>Action Item</font>"; + newNode.Text = "Action Item"; newNode.Value = "ActionItem"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -280,7 +280,7 @@ // WorkOrder newNode = new TreeNode(); - newNode.Text = "<font color=black>Work Order</font>"; + newNode.Text = "Work Order"; newNode.Value = "WorkOrder"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -290,7 +290,7 @@ // Objective newNode = new TreeNode(); - newNode.Text = "<font color=black>Objective</font>"; + newNode.Text = "Objective"; newNode.Value = "objective"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -300,7 +300,7 @@ // TestCase newNode = new TreeNode(); - newNode.Text = "<font color=black>Testcase</font>"; + newNode.Text = "Testcase"; newNode.Value = "testcase"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -353,7 +353,7 @@ { // Create the new node. TreeNode newNode = new TreeNode(); - newNode.Text = "<font color=blue>" + row.roleName + "</font>"; + newNode.Text = row.roleName; newNode.Value = row.roleID.ToString(); // Set the PopulateOnDemand property to true so that the child nodes can be @@ -379,7 +379,7 @@ { // Create the new node. TreeNode newNode = new TreeNode(); - newNode.Text = "<font color=blue>" + row.fullName + "</font>"; + newNode.Text = row.fullName; newNode.Value = row.userID.ToString(); ; // Set the PopulateOnDemand property to true so that the child nodes can be @@ -403,7 +403,7 @@ foreach (tcdbDataSet.db_usersRow row in uTable) { TreeNode child = new TreeNode(); - child.Text = "<FontInfo color=black>" + row.fullName + "</font>"; + child.Text = row.fullName; child.Value = row.userID.ToString(); child.NavigateUrl = "~/UserSettings.aspx?" + Constants.CODE_USER + "=" + child.Value; @@ -452,13 +452,14 @@ foreach (tcdbDataSet.db_roleRow row in rTable) { TreeNode child = new TreeNode(); - child.Text = "<FontInfo color=black>" + row.roleName + "</font>"; + child.Text = row.roleName; child.Value = row.roleID.ToString(); child.NavigateUrl = "~/Role.aspx?" + Constants.CODE_ROLE + "=" + child.Value; parent.ChildNodes.Add(child); } } + /* protected void BuildAllRightsList(TreeNode parent) { tcdbDataSetTableAdapters.db_rightsTableAdapter rAdapter = new tcdbDataSetTableAdapters.db_rightsTableAdapter(); @@ -467,13 +468,14 @@ foreach (tcdbDataSet.db_rightsRow row in rTable) { TreeNode child = new TreeNode(); - child.Text = "<FontInfo color=black>" + row.rightsName + "</font>"; + child.Text = row.rightsName; child.Value = row.rightsID.ToString(); child.NavigateUrl = "~/Right.aspx?" + Constants.CODE_RIGHT + "=" + child.Value; parent.ChildNodes.Add(child); } } + */ protected void BuildVersionCategories(TreeNode parent) { ArrayList nodes = (ArrayList)Session["AdminNodes"]; @@ -481,7 +483,7 @@ // Test Pass newNode = new TreeNode(); - newNode.Text = "<font color=black>Test Passes</font>"; + newNode.Text = "Test Passes"; newNode.Value = "testpass"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -491,7 +493,7 @@ // Builds newNode = new TreeNode(); - newNode.Text = "<font color=black>Builds</font>"; + newNode.Text = "Builds"; newNode.Value = "build"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -501,7 +503,7 @@ // Systems newNode = new TreeNode(); - newNode.Text = "<font color=black>Supported Systems</font>"; + newNode.Text = "Supported Systems"; newNode.Value = "system"; newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; @@ -575,6 +577,7 @@ } */ } + /* protected void BuildRightsList(TreeNode parent) { ArrayList nodes = (ArrayList)Session["AdminNodes"]; @@ -586,7 +589,7 @@ { // Create the new node. TreeNode newNode = new TreeNode(); - newNode.Text = "<font color=green>Right: </font><font color=blue>" + row.rightName + "</font>"; + newNode.Text = "Right: " + row.rightName; newNode.Value = row.rightsID.ToString(); // Set the PopulateOnDemand property to true so that the child nodes can be @@ -602,6 +605,7 @@ newNode.Expand(); } } + */ protected void BuildBuildList(TreeNode parent) { ArrayList nodes = (ArrayList)Session["AdminNodes"]; @@ -813,8 +817,8 @@ BuildAllArchList(e.Node); else if (e.Node.Value == "roles") BuildAllRolesList(e.Node); - else if (e.Node.Value == "rights") - BuildAllRolesList(e.Node); + /*else if (e.Node.Value == "rights") + BuildAllRightsList(e.Node);*/ break; case 3: if (e.Node.NavigateUrl.Contains("Version")) @@ -823,8 +827,8 @@ BuildStatusList(e.Node); else if (e.Node.NavigateUrl.Contains("Lab")) BuildComputerList(e.Node); - else if (e.Node.NavigateUrl.Contains("Role")) - BuildRightsList(e.Node); + /*else if (e.Node.NavigateUrl.Contains("Role")) + BuildRightsList(e.Node);*/ break; case 4: if (e.Node.Value == "build") Modified: Website/Includes/UserSettings.ascx =================================================================== --- Website/Includes/UserSettings.ascx 2006-07-28 23:04:20 UTC (rev 236) +++ Website/Includes/UserSettings.ascx 2006-07-28 23:08:31 UTC (rev 237) @@ -113,19 +113,19 @@ <div class="xboxcontent"> <div class="ct"> <div class="left"> - <div class="item"> + <div class="item" id="username"> <label> User:</label> <asp:TextBox ID="usernameBox" runat="server" Text='<%# Bind("username") %>'></asp:TextBox> </div> - <div class="item"> + <div class="item" id="fullname"> <label> Name: </label> <asp:TextBox ID="firstNameBox" runat="server" Text='<%# Bind("firstName") %>'></asp:TextBox> <asp:TextBox ID="lastNameBox" runat="server" Text='<%# Bind("lastName") %>'></asp:TextBox> </div> - <div class="item"> + <div class="item" id="email"> <label> Email:</label> <asp:TextBox ID="emailBox" runat="server" Text='<%# Bind("email") %>'></asp:TextBox> @@ -144,18 +144,18 @@ </div> <div class="ct"> <div class="left"> - <div class="item"> + <div class="item" id="office"> <label> Office #:</label> <asp:TextBox ID="officePhoneBox" runat="server" Text='<%# Bind("officePhone") %>'></asp:TextBox> </div> - <div class="item"> + <div class="item" id="home"> <label> Home #:</label> <asp:TextBox ID="homePhoneBox" runat="server" Text='<%# Bind("homePhone") %>'> </asp:TextBox> </div> - <div class="item"> + <div class="item" id="cell"> <label> Cell #:</label> <asp:TextBox ID="cellPhoneBox" runat="server" Text='<%# Bind("cellPhone") %>'> Modified: Website/Includes/UserSettings.ascx.cs =================================================================== --- Website/Includes/UserSettings.ascx.cs 2006-07-28 23:04:20 UTC (rev 236) +++ Website/Includes/UserSettings.ascx.cs 2006-07-28 23:08:31 UTC (rev 237) @@ -249,29 +249,38 @@ { TreeView roleTree = (TreeView)sender; - // Initialize Product Roles - if (Session["ProductRoles"] == null) - Session.Add("ProductRoles", new Dictionary<String, ArrayList>()); - Dictionary<String, ArrayList> ProductRoles = (Dictionary<String, ArrayList>)Session["ProductRoles"]; - ProductRoles.Clear(); + // Only display the rights tree if the user has permissions to access this + if (m_user.HasRight(Constants.RIGHTS_ASSIGNPERMISSION) || m_user.HasRight(Constants.RIGHTS_SITEADMIN)) + { + roleTree.Visible = true; + // Initialize Product Roles + if (Session["ProductRoles"] == null) + Session.Add("ProductRoles", new Dictionary<String, ArrayList>()); + Dictionary<String, ArrayList> ProductRoles = (Dictionary<String, ArrayList>)Session["ProductRoles"]; + ProductRoles.Clear(); - // Get products - tcdbDataSetTableAdapters.db_productsTableAdapter pAdapter = new tcdbDataSetTableAdapters.db_productsTableAdapter(); - tcdbDataSet.db_productsDataTable pTable = pAdapter.GetData(null, null); + // Get products + tcdbDataSetTableAdapters.db_productsTableAdapter pAdapter = new tcdbDataSetTableAdapters.db_productsTableAdapter(); + tcdbDataSet.db_productsDataTable pTable = pAdapter.GetData(null, null); - foreach (tcdbDataSet.db_productsRow pRow in pTable) - { - // Get Roles - tcdbDataSetTableAdapters.db_roleUserProductTableAdapter rupAdapter = new tcdbDataSetTableAdapters.db_roleUserProductTableAdapter(); - tcdbDataSet.db_roleUserProductDataTable rupTable = rupAdapter.GetData(userID, pRow.productID, true); - ArrayList roles = new ArrayList(); + foreach (tcdbDataSet.db_productsRow pRow in pTable) + { + // Get Roles + tcdbDataSetTableAdapters.db_roleUserProductTableAdapter rupAdapter = new tcdbDataSetTableAdapters.db_roleUserProductTableAdapter(); + tcdbDataSet.db_roleUserProductDataTable rupTable = rupAdapter.GetData(userID, pRow.productID, true); + ArrayList roles = new ArrayList(); - foreach (tcdbDataSet.db_roleUserProductRow rupRow in rupTable) - roles.Add(rupRow.roleID.ToString()); + foreach (tcdbDataSet.db_roleUserProductRow rupRow in rupTable) + roles.Add(rupRow.roleID.ToString()); - if (roles.Count > 0) - ProductRoles[pRow.productID.ToString()] = roles; + if (roles.Count > 0) + ProductRoles[pRow.productID.ToString()] = roles; + } } + else + { + roleTree.Visible = false; + } } protected void BuildProductList(TreeNode parent) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |