Gets the IsConfigured check checking the migration data, updates the install controller to ensure there's no infinite redirects and to use the IsUpgrading flag. Now to add entries to the table when the migrations have executed.
This commit is contained in:
@@ -37,30 +37,23 @@ namespace Umbraco.Web.Install.Controllers
|
||||
[HttpGet]
|
||||
public ActionResult Index()
|
||||
{
|
||||
//if this is not an upgrade we will log in with the default user.
|
||||
// It's not considered an upgrade if the ConfigurationStatus is missing or empty or if the db is not configured.
|
||||
if (string.IsNullOrWhiteSpace(GlobalSettings.ConfigurationStatus) == false
|
||||
&& ApplicationContext.Current.DatabaseContext.IsDatabaseConfigured)
|
||||
if (ApplicationContext.Current.IsConfigured)
|
||||
{
|
||||
Version current;
|
||||
if (Version.TryParse(GlobalSettings.ConfigurationStatus, out current))
|
||||
{
|
||||
//check if we are on the current version, and not let the installer execute
|
||||
if (current == UmbracoVersion.Current)
|
||||
{
|
||||
return Redirect(SystemDirectories.Umbraco.EnsureEndsWith('/'));
|
||||
}
|
||||
}
|
||||
return Redirect(SystemDirectories.Umbraco.EnsureEndsWith('/'));
|
||||
}
|
||||
|
||||
if (ApplicationContext.Current.IsUpgrading)
|
||||
{
|
||||
var result = _umbracoContext.Security.ValidateCurrentUser(false);
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case ValidateRequestAttempt.FailedNoPrivileges:
|
||||
case ValidateRequestAttempt.FailedNoContextId:
|
||||
return Redirect(SystemDirectories.Umbraco + "/AuthorizeUpgrade?redir=" + Server.UrlEncode(Request.RawUrl));
|
||||
case ValidateRequestAttempt.FailedNoContextId:
|
||||
return Redirect(SystemDirectories.Umbraco + "/AuthorizeUpgrade?redir=" + Server.UrlEncode(Request.RawUrl));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//gen the install base url
|
||||
ViewBag.InstallApiBaseUrl = Url.GetUmbracoApiService("GetSetup", "InstallApi", "UmbracoInstall").TrimEnd("GetSetup");
|
||||
|
||||
Reference in New Issue
Block a user