From: <ro...@us...> - 2006-07-28 21:06:39
|
Revision: 233 Author: rouquin Date: 2006-07-28 14:06:32 -0700 (Fri, 28 Jul 2006) ViewCVS: http://svn.sourceforge.net/tcdb/?rev=233&view=rev Log Message: ----------- Added more site settings to admin tree such as all users. We might be able to incorporate this info into the TCDB product. Hmm, have to think about that. Modified Paths: -------------- Website/Includes/AdministrationTree.ascx.cs Website/Includes/UserSettings.ascx Website/Includes/UserSettings.ascx.cs Modified: Website/Includes/AdministrationTree.ascx.cs =================================================================== --- Website/Includes/AdministrationTree.ascx.cs 2006-07-28 17:14:52 UTC (rev 232) +++ Website/Includes/AdministrationTree.ascx.cs 2006-07-28 21:06:32 UTC (rev 233) @@ -53,7 +53,8 @@ newNode.SelectAction = TreeNodeSelectAction.Expand; newNode.NavigateUrl = "~/AdminConfig.aspx"; parent.ChildNodes.Add(newNode); - newNode.Expand(); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); if (productTable.Count > 0) { @@ -79,6 +80,61 @@ } } } + protected void BuildAdminList(TreeNode parent) + { + ArrayList nodes = (ArrayList)Session["AdminNodes"]; + TreeNode newNode; + + // Users + newNode = new TreeNode(); + newNode.Text = "<font color=black>Users</font>"; + newNode.Value = "users"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); + + // Roles + newNode = new TreeNode(); + newNode.Text = "<font color=black>User Roles</font>"; + newNode.Value = "roles"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); + + // Rights + newNode = new TreeNode(); + newNode.Text = "<font color=black>User Rights</font>"; + newNode.Value = "rights"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); + + // Operating Systems + newNode = new TreeNode(); + newNode.Text = "<font color=black>Operating Systems</font>"; + newNode.Value = "os"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); + + // Architectures + newNode = new TreeNode(); + newNode.Text = "<font color=black>Architectures</font>"; + newNode.Value = "arch"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); + } protected void BuildReleaseList(TreeNode parent) { ArrayList nodes = (ArrayList)Session["AdminNodes"]; @@ -143,72 +199,69 @@ } protected void BuildCategoryList(TreeNode parent) { - if (parent.NavigateUrl.Contains("Product")) - { - ArrayList nodes = (ArrayList)Session["AdminNodes"]; - TreeNode newNode; + ArrayList nodes = (ArrayList)Session["AdminNodes"]; + TreeNode newNode; - // Versions - newNode = new TreeNode(); - newNode.Text = "<font color=black>Releases</font>"; - newNode.Value = "release"; - newNode.PopulateOnDemand = true; - newNode.SelectAction = TreeNodeSelectAction.Expand; - parent.ChildNodes.Add(newNode); - if (nodes.Contains(newNode.ValuePath)) - newNode.Expand(); + // Versions + newNode = new TreeNode(); + newNode.Text = "<font color=black>Releases</font>"; + newNode.Value = "release"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); - // Tags - newNode = new TreeNode(); - newNode.Text = "<font color=black>Tags</font>"; - newNode.Value = "tag"; - newNode.PopulateOnDemand = true; - newNode.SelectAction = TreeNodeSelectAction.Expand; - parent.ChildNodes.Add(newNode); - if (nodes.Contains(newNode.ValuePath)) - newNode.Expand(); + // Tags + newNode = new TreeNode(); + newNode.Text = "<font color=black>Tags</font>"; + newNode.Value = "tag"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); - // Status Labels - newNode = new TreeNode(); - newNode.Text = "<font color=black>Status Levels</font>"; - newNode.Value = "status"; - newNode.PopulateOnDemand = true; - newNode.SelectAction = TreeNodeSelectAction.Expand; - parent.ChildNodes.Add(newNode); - if (nodes.Contains(newNode.ValuePath)) - newNode.Expand(); + // Status Labels + newNode = new TreeNode(); + newNode.Text = "<font color=black>Status Levels</font>"; + newNode.Value = "status"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); - // Labs - newNode = new TreeNode(); - newNode.Text = "<font color=black>Labs</font>"; - newNode.Value = "lab"; - newNode.PopulateOnDemand = true; - newNode.SelectAction = TreeNodeSelectAction.Expand; - parent.ChildNodes.Add(newNode); - if (nodes.Contains(newNode.ValuePath)) - newNode.Expand(); + // Labs + newNode = new TreeNode(); + newNode.Text = "<font color=black>Labs</font>"; + newNode.Value = "lab"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); - // Roles - newNode = new TreeNode(); - newNode.Text = "<font color=black>Roles</font>"; - newNode.Value = "role"; - newNode.PopulateOnDemand = true; - newNode.SelectAction = TreeNodeSelectAction.Expand; - newNode.NavigateUrl = "~/AdminRole.aspx?"+Constants.CODE_PRODUCT+"=" + parent.Value; - parent.ChildNodes.Add(newNode); - if (nodes.Contains(newNode.ValuePath)) - newNode.Expand(); + // Roles + newNode = new TreeNode(); + newNode.Text = "<font color=black>Roles</font>"; + newNode.Value = "role"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + newNode.NavigateUrl = "~/AdminRole.aspx?" + Constants.CODE_PRODUCT + "=" + parent.Value; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); - // Users - newNode = new TreeNode(); - newNode.Text = "<font color=black>Users</font>"; - newNode.Value = "user"; - newNode.PopulateOnDemand = true; - newNode.SelectAction = TreeNodeSelectAction.Expand; - parent.ChildNodes.Add(newNode); - if (nodes.Contains(newNode.ValuePath)) - newNode.Expand(); - } + // Users + newNode = new TreeNode(); + newNode.Text = "<font color=black>Users</font>"; + newNode.Value = "user"; + newNode.PopulateOnDemand = true; + newNode.SelectAction = TreeNodeSelectAction.Expand; + parent.ChildNodes.Add(newNode); + if (nodes.Contains(newNode.ValuePath)) + newNode.Expand(); } protected void BuildStatusGroupList(TreeNode parent) { @@ -342,6 +395,85 @@ newNode.Expand(); } } + protected void BuildAllUserList(TreeNode parent) + { + tcdbDataSetTableAdapters.db_usersTableAdapter uAdapter = new tcdbDataSetTableAdapters.db_usersTableAdapter(); + tcdbDataSet.db_usersDataTable uTable = uAdapter.GetData(null, null); + + foreach (tcdbDataSet.db_usersRow row in uTable) + { + TreeNode child = new TreeNode(); + child.Text = "<FontInfo color=black>" + row.fullName + "</font>"; + child.Value = row.userID.ToString(); + child.NavigateUrl = "~/UserSettings.aspx?" + Constants.CODE_USER + "=" + child.Value; + + parent.ChildNodes.Add(child); + } + } + protected void BuildAllOSList(TreeNode parent) + { + /* + tcdbDataSetTableAdapters.db_usersTableAdapter uAdapter = new tcdbDataSetTableAdapters.db_usersTableAdapter(); + tcdbDataSet.db_usersDataTable uTable = uAdapter.GetData(null, null); + + foreach (tcdbDataSet.db_usersRow row in uTable) + { + TreeNode child = new TreeNode(); + child.Text = "<FontInfo color=black>" + row.fullName + "</font>"; + child.Value = row.userID.ToString(); + child.NavigateUrl = "~/UserSettings.aspx?" + Constants.CODE_USER + "=" + child.Value; + + parent.ChildNodes.Add(child); + } + * */ + } + protected void BuildAllArchList(TreeNode parent) + { + /* + tcdbDataSetTableAdapters.db_usersTableAdapter uAdapter = new tcdbDataSetTableAdapters.db_usersTableAdapter(); + tcdbDataSet.db_usersDataTable uTable = uAdapter.GetData(null, null); + + foreach (tcdbDataSet.db_usersRow row in uTable) + { + TreeNode child = new TreeNode(); + child.Text = "<FontInfo color=black>" + row.fullName + "</font>"; + child.Value = row.userID.ToString(); + child.NavigateUrl = "~/UserSettings.aspx?" + Constants.CODE_USER + "=" + child.Value; + + parent.ChildNodes.Add(child); + } + */ + } + protected void BuildAllRolesList(TreeNode parent) + { + tcdbDataSetTableAdapters.db_roleTableAdapter rAdapter = new tcdbDataSetTableAdapters.db_roleTableAdapter(); + tcdbDataSet.db_roleDataTable rTable = rAdapter.GetData(null, null, true); + + foreach (tcdbDataSet.db_roleRow row in rTable) + { + TreeNode child = new TreeNode(); + child.Text = "<FontInfo color=black>" + row.roleName + "</font>"; + 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(); + tcdbDataSet.db_rightsDataTable rTable = rAdapter.GetData(null, null, true); + + foreach (tcdbDataSet.db_rightsRow row in rTable) + { + TreeNode child = new TreeNode(); + child.Text = "<FontInfo color=black>" + row.rightsName + "</font>"; + 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"]; @@ -655,7 +787,10 @@ BuildProductList(e.Node); break; case 1: - BuildCategoryList(e.Node); + if (e.Node.Value == "admin") + BuildAdminList(e.Node); + else + BuildCategoryList(e.Node); break; case 2: if (e.Node.Value == "release") @@ -670,6 +805,16 @@ BuildRoleList(e.Node); else if (e.Node.Value == "user") BuildUserList(e.Node); + else if (e.Node.Value == "users") + BuildAllUserList(e.Node); + else if (e.Node.Value == "os") + BuildAllOSList(e.Node); + else if (e.Node.Value == "arch") + BuildAllArchList(e.Node); + else if (e.Node.Value == "roles") + BuildAllRolesList(e.Node); + else if (e.Node.Value == "rights") + BuildAllRolesList(e.Node); break; case 3: if (e.Node.NavigateUrl.Contains("Version")) Modified: Website/Includes/UserSettings.ascx =================================================================== --- Website/Includes/UserSettings.ascx 2006-07-28 17:14:52 UTC (rev 232) +++ Website/Includes/UserSettings.ascx 2006-07-28 21:06:32 UTC (rev 233) @@ -1,5 +1,6 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserSettings.ascx.cs" Inherits="UserSettings" %> +<%@ Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="cc1" %> <%@ Register Assembly="eWorld.UI, Version=2.0.0.2148, Culture=neutral, PublicKeyToken=24d65337282035f2" Namespace="eWorld.UI" TagPrefix="ew" %> <div id="UserSettings"> Modified: Website/Includes/UserSettings.ascx.cs =================================================================== --- Website/Includes/UserSettings.ascx.cs 2006-07-28 17:14:52 UTC (rev 232) +++ Website/Includes/UserSettings.ascx.cs 2006-07-28 21:06:32 UTC (rev 233) @@ -121,8 +121,11 @@ // TODO: If m_user.PASSWORD is "" or null, we must prompt for a password somehow // or the AD authentication will fail String username = ((TextBox)FormView1.FindControl("usernameBox")).Text; - User curUser = AD_Authentication.AD_GetUserInfo(m_user.USERNAME, m_user.PASSWORD, username); - + String password = null; + if (m_user.PASSWORD != "") + password = m_user.PASSWORD; + User curUser = AD_Authentication.AD_GetUserInfo(m_user.USERNAME, password, username); + if (curUser.ID != -1) { TextBox tbx_firstName = (TextBox)FormView1.FindControl("firstNameBox"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |