From 07ddde9555b725126ca3d23c3c7332282b42303a Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Thu, 16 May 2024 13:58:52 -0700 Subject: [PATCH] Remove the ReturnUrl from the user's profile link (#16071) --- .../Controllers/AdminController.cs | 13 ++++--------- .../Views/UserMenuItems-Profile.cshtml | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AdminController.cs b/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AdminController.cs index ff6cb9297c1..7cf771b6af6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AdminController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AdminController.cs @@ -418,19 +418,14 @@ public async Task EditPost(string id, string returnUrl) await _notifier.SuccessAsync(H["User updated successfully."]); - if (editingOwnUser) + if (!string.IsNullOrEmpty(returnUrl)) { - if (!string.IsNullOrEmpty(returnUrl)) - { - return this.LocalRedirect(returnUrl, true); - } - - return RedirectToAction(nameof(Edit)); + return this.LocalRedirect(returnUrl, true); } - if (!string.IsNullOrEmpty(returnUrl)) + if (editingOwnUser) { - return this.LocalRedirect(returnUrl, true); + return RedirectToAction(nameof(Edit)); } return RedirectToAction(nameof(Index)); diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Views/UserMenuItems-Profile.cshtml b/src/OrchardCore.Modules/OrchardCore.Users/Views/UserMenuItems-Profile.cshtml index 8c0f85aa384..370accd50b2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/Views/UserMenuItems-Profile.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Users/Views/UserMenuItems-Profile.cshtml @@ -5,7 +5,7 @@ @if (await AuthorizationService.AuthorizeAsync(User, CommonPermissions.EditOwnUser)) {
  • - + @T["Profile"]
  • @@ -13,7 +13,7 @@ else if (await AuthorizationService.AuthorizeAsync(User, CommonPermissions.ViewUsers)) {
  • - + @T["Profile"]