📄 authenticationcheckfilter.cs
字号:
using System;
using System.Security.Principal;
using System.Threading;
using Castle.MonoRail.Framework;
using log4net;
namespace NetBpm.Web.Presentation.Filters
{
public class AuthenticationCheckFilter : IFilter
{
private IFilter _userAddFilter=new UserAddFilter();
private static readonly ILog log = LogManager.GetLogger(typeof (AuthenticationCheckFilter));
public AuthenticationCheckFilter()
{
}
public bool Perform(ExecuteEnum exec, IRailsEngineContext context, Controller controller)
{
_userAddFilter.Perform(exec,context,controller);
if (Thread.CurrentPrincipal!=null && Thread.CurrentPrincipal.Identity.IsAuthenticated){
log.Debug("authenticated");
return true;
}
log.Debug("not authenticated");
controller.Redirect("intro","index");
return false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -