From: <ha...@us...> - 2009-03-13 04:04:09
|
Revision: 3408 http://subtext.svn.sourceforge.net/subtext/?rev=3408&view=rev Author: haacked Date: 2009-03-13 04:03:47 +0000 (Fri, 13 Mar 2009) Log Message: ----------- Fixed up some UI bugs in the forgot password dialog. Modified Paths: -------------- trunk/SubtextSolution/Subtext.Web/Skins/_System/ForgotPassword.Master.cs Modified: trunk/SubtextSolution/Subtext.Web/Skins/_System/ForgotPassword.Master.cs =================================================================== --- trunk/SubtextSolution/Subtext.Web/Skins/_System/ForgotPassword.Master.cs 2009-03-13 03:49:52 UTC (rev 3407) +++ trunk/SubtextSolution/Subtext.Web/Skins/_System/ForgotPassword.Master.cs 2009-03-13 04:03:47 UTC (rev 3408) @@ -10,6 +10,7 @@ { protected override void OnLoad(EventArgs e) { + defaultInstructions.Visible = true; if (Config.CurrentBlog == null) { ResetForm.Visible = defaultInstructions.Visible = false; FailureText.Text = "Sorry, but forgot password does not work for Host admins. Please read <a href=\"http://subtextproject.com/Home/FAQ/tabid/113/Default.aspx\" title=\"Subtext FAQ\">the FAQ</a> to reset your password."; @@ -18,7 +19,7 @@ } protected void OnForgotButtonClick(object sender, EventArgs args) { - Blog currentBlog = Config.CurrentBlog; + BlogInfo currentBlog = Config.CurrentBlog; if (currentBlog == null) { FailureText.Text = "Sorry, but forgot password does not work for Host admins. Please read <a href=\"http://subtextproject.com/Home/FAQ/tabid/113/Default.aspx\" title=\"Subtext FAQ\">the FAQ</a> to reset your password."; @@ -29,19 +30,25 @@ } } - private void ResetAdminPassword(Blog currentBlog) + private void ResetAdminPassword(BlogInfo currentBlog) { if (String.IsNullOrEmpty(currentBlog.Email) || currentBlog.Email != emailTextBox.Text || currentBlog.UserName != usernameTextBox.Text) { + Message.Visible = false; + FailureText.Visible = true; FailureText.Text = "Sorry, but the username and email provided did not match our records"; } else { + defaultInstructions.Visible = false; + Message.Visible = true; + FailureText.Visible = false; + string newPassword = SecurityHelper.ResetPassword(); EmailProvider.Instance().Send(currentBlog.Email, currentBlog.Email, "Your new password", "I've been told that you forgot your password. Here it is" + Environment.NewLine + "\t" + newPassword); + Message.Text = "Password was reset and sent to your email address."; - defaultInstructions.Visible = false; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |