Merge remote-tracking branch 'origin/netcore/dev' into netcore/task/6973-migrating-authenticationcontroller-merge
# Conflicts: # src/Umbraco.Examine.Lucene/UmbracoContentIndex.cs # src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs # src/Umbraco.Tests/Services/MemberServiceTests.cs # src/Umbraco.Web.BackOffice/Controllers/PreviewController.cs # src/Umbraco.Web.BackOffice/Services/IconService.cs # src/Umbraco.Web.UI.NetCore/umbraco/UmbracoBackOffice/Preview.cshtml # src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml # src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml # src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml # src/Umbraco.Web.UI/config/umbracoSettings.config
This commit is contained in:
@@ -110,18 +110,23 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
[UmbracoAuthorize]
|
||||
public ActionResult Frame(int id, string culture)
|
||||
{
|
||||
var user = _backofficeSecurityAccessor.BackOfficeSecurity.CurrentUser;
|
||||
|
||||
var previewToken = _publishedSnapshotService.EnterPreview(user, id);
|
||||
|
||||
_cookieManager.SetCookieValue(Constants.Web.PreviewCookieName, previewToken);
|
||||
EnterPreview(id);
|
||||
|
||||
// use a numeric url because content may not be in cache and so .Url would fail
|
||||
var query = culture.IsNullOrWhiteSpace() ? string.Empty : $"?culture={culture}";
|
||||
|
||||
return RedirectPermanent($"../../{id}.aspx{query}");
|
||||
}
|
||||
public ActionResult EnterPreview(int id)
|
||||
{
|
||||
var user = _backofficeSecurityAccessor.BackOfficeSecurity.CurrentUser;
|
||||
|
||||
var previewToken = _publishedSnapshotService.EnterPreview(user, id);
|
||||
|
||||
_cookieManager.SetCookieValue(Constants.Web.PreviewCookieName, previewToken);
|
||||
|
||||
return null;
|
||||
}
|
||||
public ActionResult End(string redir = null)
|
||||
{
|
||||
var previewToken = _cookieManager.GetPreviewCookieValue();
|
||||
@@ -130,6 +135,9 @@ namespace Umbraco.Web.BackOffice.Controllers
|
||||
|
||||
_cookieManager.ExpireCookie(Constants.Web.PreviewCookieName);
|
||||
|
||||
// Expire Client-side cookie that determines whether the user has accepted to be in Preview Mode when visiting the website.
|
||||
_cookieManager.ExpireCookie(Constants.Web.AcceptPreviewCookieName);
|
||||
|
||||
if (Uri.IsWellFormedUriString(redir, UriKind.Relative)
|
||||
&& redir.StartsWith("//") == false
|
||||
&& Uri.TryCreate(redir, UriKind.Relative, out var url))
|
||||
|
||||
Reference in New Issue
Block a user