YAFLogo

geeman
  • geeman
  • 57.8% (Neutral)
  • YAF Forumling Topic Starter
17 years ago
I think I figured out why the configPassword was being saved multiple times if the wizard is run more than once.

The following code is from YetAnotherForum.NET/install/default.cs

try

{

Configuration config = WebConfigurationManager.OpenWebConfiguration( "~/" );

AppSettingsSection appSettings = config.GetSection( "appSettings" ) as AppSettingsSection;

if ( appSettings.Settings ["configPassword"] == null )

appSettings.Settings.Remove( "configPassword" );

appSettings.Settings.Add( "configPassword", System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile( TextBox1.Text, "md5" ) );

config.Save( ConfigurationSaveMode.Modified );

e.Cancel = false;

}

catch

{

throw new Exception( "Unable to save the configPassword. Please verify that the ASPNET user has write access permissions to the app.config file." );

}

The condition of line 6 above should be:

if ( appSettings.Settings ["configPassword"] != null )

Sponsor