1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using ProjectBase.Data.BaseDAL;
- using SIASUN.Autopilot.DAL.IDALSQL;
- using SIASUN.Autopilot.Model;
- using System.Collections.Generic;
- namespace SIASUN.Autopilot.BLL
- {
- public class BlWhite : BaseBLL<MoWhite>
- {
- private IDalWhite dalBlack;
- /// <summary>
- /// 构造函数
- /// </summary>
- public BlWhite() : base()
- {
- base.Init(this.GetType().FullName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);
- dalBlack = baseDal as IDalWhite;
- dalBlack.OnOperationLog += new OperationLogEventHandler(BlLogOperation.OnOperationLog);
- }
- /// <summary>
- /// 黑白名单验证
- /// </summary>
- /// <param name="user">用户</param>
- /// <param name="ip">本机IP地址</param>
- /// <param name="message">反馈信息</param>
- /// <returns></returns>
- //public bool VerifyBlackWhite(string userAccount, string ip, out string message)
- //{
- // try
- // {
- // List<MoBlackWhite> list = Find(string.Format(" black_UserAccount = '{0}' AND black_forbid = 0", userAccount));
- // if (list == null || list.Count == 0)
- // {
- // message = "";
- // return true;
- // }
- // foreach (MoBlackWhite item in list)
- // {
- // if (item.Type == 0) //黑名单
- // {
- // if (item.IPStart.CompareTo(ip) <= 0 && item.IPEnd.CompareTo(ip) >= 0)
- // {
- // message = "您被黑名单禁止登录!";
- // MoLogLogIn moLogIn = new MoLogLogIn
- // {
- // Account = userAccount,
- // Name = SysEnvironment.CurrentLoginName,
- // GroupId = SysEnvironment.CurrentLoginGroupId,
- // Description = "用户登录操作被黑名单禁止登录!",
- // Ip = ip,
- // Mac = SysEnvironment.Mac,
- // Time = DateTime.Now
- // };
- // BLLFactory<BlLogLogIn>.Instance.Insert(moLogIn);
- // return false;
- // }
- // }
- // if (item.Type == 1) //白名单
- // {
- // if (item.IPStart.CompareTo(ip) > 0 || item.IPEnd.CompareTo(ip) < 0)
- // {
- // message = "您被白名单禁止登录!";
- // MoLogLogIn moLogIn = new MoLogLogIn
- // {
- // Account = userAccount,
- // Name = SysEnvironment.CurrentLoginName,
- // GroupId = SysEnvironment.CurrentLoginGroupId,
- // Description = "用户登录操作被白名单禁止登录!",
- // Ip = ip,
- // Mac = SysEnvironment.Mac,
- // Time = DateTime.Now
- // };
- // BLLFactory<BlLogLogIn>.Instance.Insert(moLogIn);
- // return false;
- // }
- // }
- // }
- // message = "";
- // return true;
- // }
- // catch (Exception ex)
- // {
- // LogHelper.log.Error(string.Format("黑白名单验证出现错误:{0}", ex));
- // message = ex.ToString();
- // return false;
- // }
- //}
- }
- }
|