diff --git a/Logic/Security/Authority.cs b/Logic/Security/Authority.cs index 08f7f43e..76db54f0 100644 --- a/Logic/Security/Authority.cs +++ b/Logic/Security/Authority.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Data; using System.IO; using System.Linq; using System.Reflection.Emit; @@ -87,7 +88,11 @@ namespace Swarmops.Logic.Security get { return Organization.FromIdentity (_data.OrganizationId); } } - public Impersonation Impersonation { get; set; } + public Impersonation Impersonation + { + get { return _data.ActiveImpersonation; } + set { _data.ActiveImpersonation = value; } + } public bool ImpersonationActive { get { return Impersonation != null && Impersonation.ImpersonatedByPersonId != 0; } } diff --git a/Site/Automation/SwarmFunctions.aspx.cs b/Site/Automation/SwarmFunctions.aspx.cs index cc37b888..2f418bf5 100644 --- a/Site/Automation/SwarmFunctions.aspx.cs +++ b/Site/Automation/SwarmFunctions.aspx.cs @@ -601,7 +601,7 @@ namespace Swarmops.Frontend.Automation Authority authority = Authority.FromLogin(impersonator, authData.CurrentOrganization); FormsAuthentication.SetAuthCookie(authority.ToEncryptedXml(), false); - HttpContext.Current.Response.AppendCookie(new HttpCookie("DashboardMessage", String.Format(Resources.Pages.Admin.CommenceImpersonation_Ended, utcNow))); + HttpContext.Current.Response.AppendCookie(new HttpCookie("DashboardMessage", CommonV5.JavascriptEscape(String.Format(Resources.Pages.Admin.CommenceImpersonation_Ended, utcNow)))); // returning Success will force a reload, resetting dashboard to original user