Fixes installer upgrade

This commit is contained in:
Shannon
2014-02-20 13:09:54 +11:00
parent 40d1a09609
commit 545040fdf0
3 changed files with 31 additions and 2 deletions

View File

@@ -100,6 +100,29 @@ namespace Umbraco.Core
return true;
}
/// <summary>
/// Checks if it is a back office login or logout request
/// </summary>
/// <param name="url"></param>
/// <param name="applicationPath"></param>
/// <returns></returns>
internal static bool IsBackOfficeLoginRequest(this Uri url, string applicationPath)
{
applicationPath = applicationPath ?? string.Empty;
var fullUrlPath = url.AbsolutePath.TrimStart(new[] { '/' });
var appPath = applicationPath.TrimStart(new[] { '/' });
var urlPath = fullUrlPath.TrimStart(appPath).EnsureStartsWith('/');
if (urlPath.InvariantStartsWith(GlobalSettings.Path.EnsureStartsWith('/') + "/login.aspx")
|| urlPath.InvariantStartsWith(GlobalSettings.Path.EnsureStartsWith('/') + "/logout.aspx"))
{
return true;
}
return false;
}
/// <summary>
/// Checks if the current uri is an install request
/// </summary>