From e0bf6afc1ac2609aaafaf2c4ba4b8e19528cfea6 Mon Sep 17 00:00:00 2001
From: "Ismet D." <64033786+idumlupinar@users.noreply.github.com>
Date: Wed, 21 Oct 2026 13:41:00 -0700
Subject: [PATCH 1/5] Implement requested panel handling in PersonaBarContainer
Added requested panel handling to the PersonaBarContainer class.
---
.../Containers/PersonaBarContainer.cs | 52 ++++++++++++++++++-
1 file changed, 51 insertions(+), 1 deletion(-)
diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs
index 4e1f47e5551..9d92ae3555b 100644
--- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs
+++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace Dnn.PersonaBar.Library.Containers
@@ -32,6 +32,9 @@ namespace Dnn.PersonaBar.Library.Containers
public class PersonaBarContainer : IPersonaBarContainer
{
+ /// The query string key that names a Persona Bar item to open when the page loads.
+ private const string RequestedPanelQueryKey = "personabar";
+
private static IPersonaBarContainer instance;
private readonly IPersonaBarController personaBarController;
private readonly IHostSettings hostSettings;
@@ -104,6 +107,46 @@ public virtual void FilterMenu(PersonaBarMenu menu)
{
}
+ ///
+ /// Gets the identifier of the Persona Bar item requested in the query string (e.g. ?personabar=Dnn.Pages),
+ /// only if it is a panel in the current user's menu, so the URL can never open anything the user cannot already open.
+ ///
+ /// The current user's menu.
+ /// The matching menu item identifier, or .
+ private static string GetRequestedPanel(PersonaBarMenu menu)
+ {
+ var requested = HttpContextSource.Current?.Request.QueryString[RequestedPanelQueryKey];
+ if (string.IsNullOrWhiteSpace(requested))
+ {
+ return null;
+ }
+
+ return FindPanelIdentifier(menu.MenuItems, requested.Trim());
+ }
+
+ private static string FindPanelIdentifier(IEnumerable