Generate session logic moved to correct place.

This commit is contained in:
feodor_fitsner 2012-09-13 19:23:21 -07:00
parent a3e5be7fe3
commit f42298e7fe
5 changed files with 52 additions and 47 deletions

View file

@ -260,9 +260,6 @@ namespace WebsitePanel.Setup
break;
case ActionTypes.ConfigureSecureSessionModuleInWebConfig:
ConfigureSecureSessionModuleInWebConfig();
break;
case ActionTypes.UpdatePortalSessionValidationKey:
UpdatePortalSessionValidationKey();
break;
}
}
@ -2657,44 +2654,6 @@ namespace WebsitePanel.Setup
}
}
private void UpdatePortalSessionValidationKey()
{
try
{
string installFolder = Wizard.SetupVariables.InstallationFolder;
string path = Path.Combine(installFolder, "web.config");
if (!File.Exists(path))
{
Log.WriteInfo(string.Format("File {0} not found", path));
return;
}
Log.WriteStart("Updating configuration file (session validation key)");
XmlDocument doc = new XmlDocument();
doc.Load(path);
XmlElement sessionKey = doc.SelectSingleNode("configuration/appSettings/add[@key='SessionValidationKey']") as XmlElement;
if (sessionKey == null)
{
Log.WriteInfo("SessionValidationKey setting not found");
return;
}
sessionKey.SetAttribute("value", StringUtils.GenerateRandomString(16));
doc.Save(path);
Log.WriteEnd("Updated configuration file");
InstallLog.AppendLine("- Updated session validation key in the configuration file");
}
catch (Exception ex)
{
if (Utils.IsThreadAbortException(ex))
return;
Log.WriteError("Configuration file update error", ex);
throw;
}
}
private void SetServiceSettings()
{
try