登陆插件分享
金蝶云社区-宇
0人赞赏了该文章 474次浏览 未经作者许可,禁止转载编辑于2018年05月02日 16:48:25

[code]
[/code][code]using Kingdee.BOS.Authentication;
using Kingdee.BOS.BusinessEntity.UserManager;
using Kingdee.BOS.Core.Authentication;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;

namespace Kingdee.BOS.Business.PlugIn.Security.UserManage
{
public class LoginPolicyPlugIn : AbstractAuthPlugIn
{
///


/// MAC地址较验示例
///

///
///
public override Kingdee.BOS.Core.Authentication.AssistValidateResult AssistValidate(AssistValidateArg e)
{
try
{
if (不允许登陆)//不允许登陆
{
var msg = string.Format(Kingdee.BOS.Resource.ResManager.LoadKDString("用户【{0}】不允许在此机器登录,如需登录请联系系统管理员!", "002014000007362", Kingdee.BOS.Resource.SubSystemType.BOS), e.LoginInfo.Username);
var ret = Kingdee.BOS.Core.Authentication.ValidateResult.Failure;
return new AssistValidateResult(ret, msg);
}
else
{
return new AssistValidateResult(Kingdee.BOS.Core.Authentication.ValidateResult.Success, string.Empty);
}
}
catch (Exception ex)
{
Kingdee.BOS.Log.Logger.Error("LoginPolicyPlugIn", "error:" + ex.Message, ex);
string msg = string.Format("LoginPolicyPlugIn login Error:\r\n{0}", ex.Message);
return new AssistValidateResult(Kingdee.BOS.Core.Authentication.ValidateResult.Failure, msg);
}
}
}
}[/code]

2、注册插件