From: <ro...@us...> - 2006-07-26 14:32:45
|
Revision: 222 Author: rouquin Date: 2006-07-26 07:32:35 -0700 (Wed, 26 Jul 2006) ViewCVS: http://svn.sourceforge.net/tcdb/?rev=222&view=rev Log Message: ----------- The user settings page wasn't updating so I tweaked it an it works now. I was also have some serious session timeout issues on IE. I added a little more session processing to help though I'm not sure if that was the issue. It seems that the SQL based session is more reliable but not as flexible (only handles serializable objects). Modified Paths: -------------- Website/App_Code/GlobalClass.cs Website/App_Code/SiteMaster.cs Website/Includes/UserSettings.ascx Website/Includes/UserSettings.ascx.cs Website/web.config Modified: Website/App_Code/GlobalClass.cs =================================================================== --- Website/App_Code/GlobalClass.cs 2006-07-25 22:01:30 UTC (rev 221) +++ Website/App_Code/GlobalClass.cs 2006-07-26 14:32:35 UTC (rev 222) @@ -71,6 +71,14 @@ // everything } + void Session_Start(object sender, EventArgs e) + { + if (User.Identity.IsAuthenticated) + { + Session["m_user"] = UserDB.GetUserInfo(User.Identity.Name); + } + } + void Application_PreRequestHandlerExecute(object sender, EventArgs e) { Modified: Website/App_Code/SiteMaster.cs =================================================================== --- Website/App_Code/SiteMaster.cs 2006-07-25 22:01:30 UTC (rev 221) +++ Website/App_Code/SiteMaster.cs 2006-07-26 14:32:35 UTC (rev 222) @@ -23,11 +23,14 @@ protected override void OnInit(EventArgs e) { - m_user = LoadSessionUser(); - m_startTime = LoadStartTime(); + if (Page.User.Identity.IsAuthenticated) + { + m_user = LoadSessionUser(); + m_startTime = LoadStartTime(); - //TimeSpan d = DateTime.Now - m_startTime; - //d.Milliseconds; + //TimeSpan d = DateTime.Now - m_startTime; + //d.Milliseconds; + } } public DateTime LoadStartTime() @@ -42,12 +45,11 @@ public User LoadSessionUser() { - if (m_user != null) + if (m_user != null && m_user.ISAUTHENTICATED) { return m_user; } - int id = 0; m_logg.Debug("Entering the SiteUserControl LoadUser"); try Modified: Website/Includes/UserSettings.ascx =================================================================== --- Website/Includes/UserSettings.ascx 2006-07-25 22:01:30 UTC (rev 221) +++ Website/Includes/UserSettings.ascx 2006-07-26 14:32:35 UTC (rev 222) @@ -3,7 +3,7 @@ <div id="UserSettings"> <asp:FormView ID="FormView1" runat="server" DataSourceID="UserDataSource" DataKeyNames="userID" OnItemDeleted="FormView1_ItemDeleted" OnItemCommand="FormView1_ItemCommand" OnItemInserted="FormView1_ItemInserted" - OnItemUpdated="FormView1_ItemUpdated"> + OnItemUpdated="FormView1_ItemUpdated" OnDataBound="FormView1_DataBound"> <HeaderTemplate> <div class="ch"> <h2> @@ -22,7 +22,7 @@ <div class="item"> <label> User:</label> - <asp:Label ID="usernameLabel" runat="server" Text='<%# Bind("username") %>'></asp:Label> + <asp:Label ID="usernameLabel" runat="server" Text='<%# Eval("username") %>'></asp:Label> </div> <div class="item"> <label> @@ -33,7 +33,7 @@ <div class="item"> <label> Email:</label> - <asp:Label ID="emailLabel" runat="server" Text='<%# Bind("email") %>'></asp:Label> + <asp:Label ID="emailLabel" runat="server" Text='<%# Eval("email") %>'></asp:Label> </div> </div> <div class="end"> @@ -46,17 +46,17 @@ <div class="item"> <label> Office #:</label> - <asp:Label ID="officeHome" runat="server" Text='<%# Bind("officePhone") %>'></asp:Label> + <asp:Label ID="officeHome" runat="server" Text='<%# Eval("officePhone") %>'></asp:Label> </div> <div class="item"> <label> Home #:</label> - <asp:Label ID="homePhoneLabel" runat="server" Text='<%# Bind("homePhone") %>'></asp:Label> + <asp:Label ID="homePhoneLabel" runat="server" Text='<%# Eval("homePhone") %>'></asp:Label> </div> <div class="item"> <label> Cell #:</label> - <asp:Label ID="cellPhoneLabel" runat="server" Text='<%# Bind("cellPhone") %>'></asp:Label> + <asp:Label ID="cellPhoneLabel" runat="server" Text='<%# Eval("cellPhone") %>'></asp:Label> </div> </div> <div class="end"> @@ -74,7 +74,7 @@ <div class="item"> <label> Automation:</label> - <asp:CheckBox ID="automationCheckBox" runat="server" Checked='<%# Bind("automation") %>' + <asp:CheckBox ID="automationCheckBox" runat="server" Checked='<%# Eval("automation") %>' Enabled="false" /> </div> </div> @@ -113,17 +113,14 @@ <div class="item"> <label> User:</label> - <asp:Label ID="usernameLbl" runat="server" Text='<%# Bind("username") %>'></asp:Label> + <asp:TextBox ID="usernameBox" runat="server" Text='<%# Bind("username") %>'></asp:TextBox> </div> <div class="item"> <label> Name: </label> - <asp:TextBox ID="firstNameBox" runat="server" Text='<%# Eval("firstName") %>'></asp:TextBox> - <asp:TextBox ID="lastNameBox" runat="server" Text='<%# Eval("lastName") %>'></asp:TextBox> - <!-- - <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("firstName") %>'></asp:Label> - <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("lastName") %>'></asp: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"> <label> Modified: Website/Includes/UserSettings.ascx.cs =================================================================== --- Website/Includes/UserSettings.ascx.cs 2006-07-25 22:01:30 UTC (rev 221) +++ Website/Includes/UserSettings.ascx.cs 2006-07-26 14:32:35 UTC (rev 222) @@ -116,12 +116,7 @@ protected void SyncWithAD(object sender, CommandEventArgs e) { - String username = ""; - if (FormView1.CurrentMode == FormViewMode.Edit) - username = ((Label) FormView1.FindControl("usernameLbl")).Text; - else - username = ((TextBox)FormView1.FindControl("usernameBox")).Text; - + String username = ((TextBox)FormView1.FindControl("usernameBox")).Text; User curUser = AD_Authentication.AD_GetUserInfo(m_user.USERNAME, m_user.PASSWORD, username); if (curUser.ID != -1) @@ -149,4 +144,15 @@ else Response.Redirect("UserConfig.aspx?" + Constants.CODE_USER + "=" + userID); } + protected void FormView1_DataBound(object sender, EventArgs e) + { + if (FormView1.CurrentMode == FormViewMode.Edit) + { + if (mode == "read") + { + TextBox username = (TextBox)FormView1.FindControl("usernameBox"); + username.Enabled = false; + } + } + } } Modified: Website/web.config =================================================================== --- Website/web.config 2006-07-25 22:01:30 UTC (rev 221) +++ Website/web.config 2006-07-26 14:32:35 UTC (rev 222) @@ -132,7 +132,8 @@ providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> - <sessionState mode="InProc" cookieless="false" timeout="1440"/> + <sessionState mode="InProc" cookieless="false" timeout="20"/> + <pages styleSheetTheme="Python"> <!-- TODO: Make sure the theme is being pulled dynamically --> <controls> @@ -198,7 +199,9 @@ <authentication mode="Windows"/> --> - <authentication mode="Forms" /> + <authentication mode="Forms" > + <forms timeout="50000000"/> + </authentication> <!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |