나는 페이스 북에서 온 방문자인지 여부와 해당 방문자가 해당 페이스 북 페이지의 관리자인지 여부를 감지하는 매크로를 가지고 있습니다.Internet Explorer를 사용하는 경우에만 Umbraco에서 로그인으로 리디렉션
관리자가 발견되면 방문자를 사전 정의 된 관리자 (Umbraco 백엔드 사용자)로 로그인하고 실시간 편집 모드로 리디렉션하기 위해 아래 코드를 실행합니다. 이것은 Chrome에서 완벽하게 작동하지만 Internet Explorer에서는 작동하지 않습니다. 인터넷 익스플로러에서 방문자는 로그인하지 않은 상태에서 Umbraco 로그인 페이지로 최상위 레벨 (iframe 외부)로 리디렉션됩니다. 그 이유는 무엇입니까?
var id = umbraco.BusinessLogic.User.getUserId("exampleadminuser"); // LoginName of an administrator
var u = umbraco.BusinessLogic.User.GetUser(id);
umbraco.BasePages.BasePage.doLogin(u);
// Check if the user should be redirected to live editing
if (u.DefaultToLiveEditing)
{
int startNode = u.StartNodeId;
// If the startnode is -1 (access to all content), we'll redirect to the top root node
if (startNode == -1)
{
if (umbraco.cms.businesslogic.web.Document.GetRootDocuments().Length > 0)
{
startNode = umbraco.cms.businesslogic.web.Document.GetRootDocuments()[0].Id;
}
else
{
throw new Exception("There's currently no content to edit. Please contact your system administrator");
}
}
string redir = String.Format("{0}/canvas.aspx?redir=/{1}.aspx", GlobalSettings.Path, startNode);
Response.Redirect(redir, true);
}
내가 그 일을 끝내 었으며 올바른 답변으로 표시되었습니다. – Sindre