Fixed more problems with impersonation

This commit is contained in:
Rick Falkvinge
2017-01-21 11:22:59 +01:00
parent 85e5fb79b0
commit e687887031
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -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; } }
+1 -1
View File
@@ -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