public RedirectToRouteResult Emulate(string loginId /* Login ID*/)
{
if (User.IsInRole("EmulationUser"))
{
if (!string.IsNullOrEmpty(loginId))
{
Message = "Emulating " + loginId;
FormsAuthentication.RedirectFromLoginPage(loginId, false);
}
else
{
Message = "Login ID not provided. Use /Emulate/login";
}
}
else
{
Message = "You do not have permission to perform this action";
}
return RedirectToAction("Index", "Home");
}