1

使用 .NET MVC 4 我正在尝试保护 imagemanager 并在 ~/Scripts/tinymce/plugins/imagemanager/default.aspx 中得到:

“/”应用程序中的服务器错误。

致命:找不到身份验证器:SessionAuthenticator,说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。异常详细信息:Moxiecode.Manager.ManagerException:致命:找不到身份验证器:SessionAuthenticator,源错误:

  Line 25:         page += "?domain=" + domain;
  Line 26: 
===>**Line 27:     **if (man.IsAuthenticated)****
  Line 28:         Response.Redirect("pages/" + man.Config["general.theme"] + "/" + page,     true);
  Line 29:     else

我在 ~/Scripts/tinymce/plugins/imagemanager 中的 Web.config 是直接来自下载源的标准配置。

显示错误的完整文件是

<%@ Page Language="C#" ContentType="text/plain" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="Moxiecode.Manager" %>
<%@ Import Namespace="Moxiecode.Manager.Utils" %>
<%@ Import Namespace="Moxiecode.Manager.Authenticators" %>

<%
string type = Request["type"], page = Request["page"], domain = Request["domain"];
ManagerEngine man;

// Run install if it exists
if (Directory.Exists(Server.MapPath("install")))
    Response.Redirect("install/default.aspx", true);

if (type == null)
    Response.Redirect("examples.html", true);

// Setup file manager
man = new ManagerEngine(type, Path.GetDirectoryName(Request.PhysicalPath));

if (page == null)
    page = "index.html";

if (domain != null)
    page += "?domain=" + domain;

if (man.IsAuthenticated)
    Response.Redirect("pages/" + man.Config["general.theme"] + "/" + page, true);
else
    Response.Redirect(man.Config["authenticator.login_page"] + "?return_url=" + Server.UrlEncode("" + Request.Url), true);
%>
4

0 回答 0