Working on #U4-1358 - moving Base page classes to their correct location/assembly. Migrated all installation webforms files and associated helper files to

their correct locations/namespaces/assemblies and obsoleted all of the old ones and ensure the old webforms files don't exist where the obsoleted ones were.
Fixes a security issue with the installer ajax service (used to be p.aspx, now is InstallerRestService.aspx)
This commit is contained in:
Shannon Deminick
2013-02-03 05:06:11 +06:00
parent 0d34b203d5
commit 1be3af1e31
109 changed files with 3886 additions and 1655 deletions

View File

@@ -0,0 +1,73 @@
using System.Web.Script.Serialization;
using System.Web.UI;
namespace Umbraco.Web.Install
{
internal static class InstallHelper
{
private static readonly InstallerStepCollection Steps = new InstallerStepCollection
{
new Steps.Welcome(),
new Steps.License(),
new Steps.FilePermissions(),
new Steps.Database(),
new Steps.DefaultUser(),
new Steps.Skinning(),
new Steps.WebPi(),
new Steps.TheEnd()
};
internal static InstallerStepCollection InstallerSteps
{
get { return Steps; }
}
public static void RedirectToNextStep(Page page, string currentStep)
{
var s = InstallerSteps.GotoNextStep(currentStep);
page.Response.Redirect("?installStep=" + s.Alias);
}
public static void RedirectToLastStep(Page page)
{
var s = InstallerSteps.Get("theend");
page.Response.Redirect("?installStep=" + s.Alias);
}
private static int _percentage = -1;
public static int Percentage
{
get { return _percentage; }
set { _percentage = value; }
}
public static string Description { get; set; }
public static string Error { get; set; }
public static void ClearProgress()
{
Percentage = -1;
Description = string.Empty;
Error = string.Empty;
}
public static void SetProgress(int percent, string description, string error)
{
if (percent > 0)
Percentage = percent;
Description = description;
Error = error;
}
public static string GetProgress()
{
var pr = new ProgressResult(Percentage, Description, Error);
var js = new JavaScriptSerializer();
return js.Serialize(pr);
}
}
}