diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-10 15:41:35 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-10-10 15:41:35 -0700 |
commit | e2970ffe81f75f6a4b4c0206b847ab5da82a8b17 (patch) | |
tree | 53bc142d5f2c0cdbb8ed6acb1a96e6ec988adc6b /projecttemplates/WebFormsRelyingParty | |
parent | 456e6b4c650d5f23b414c9f5f9588d6be1a218cd (diff) | |
download | DotNetOpenAuth-e2970ffe81f75f6a4b4c0206b847ab5da82a8b17.zip DotNetOpenAuth-e2970ffe81f75f6a4b4c0206b847ab5da82a8b17.tar.gz DotNetOpenAuth-e2970ffe81f75f6a4b4c0206b847ab5da82a8b17.tar.bz2 |
Fixed project template setup page to not try to create db twice in some circumstances.
Diffstat (limited to 'projecttemplates/WebFormsRelyingParty')
-rw-r--r-- | projecttemplates/WebFormsRelyingParty/Setup.aspx.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs b/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs index 71e64ce..c99dce6 100644 --- a/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs +++ b/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs @@ -13,6 +13,8 @@ using Microsoft.SqlServer.Management.Smo; public partial class Setup : System.Web.UI.Page { + private bool databaseCreated; + protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { openidLogin.Focus(); @@ -24,9 +26,14 @@ e.Cancel = true; if (e.IsDirectedIdentity) { noOPIdentifierLabel.Visible = true; - } else { + } else if (!databaseCreated) { this.CreateDatabase(e.ClaimedIdentifier, openidLogin.Text); this.MultiView1.ActiveViewIndex = 1; + + // indicate we have already created the database so that if the + // identifier the user gave has multiple service endpoints, + // we won't try to recreate the database as the next one is considered. + databaseCreated = true; } } |