コード例 #1
0
        public void LogEvent(OperationContext context, LoginEventType eventType, ILogin login = null, string notes = null, string userName = null)
        {
            var  webCtx  = context.WebContext;
            Guid?loginId = null;

            if (login != null)
            {
                loginId = login.Id;
                if (userName == null)
                {
                    userName = login.UserName;
                }
            }
            else if (context.User.Kind == UserKind.AuthenticatedUser)
            {
                loginId = context.User.UserId; //most likely the same
                if (userName == null)
                {
                    userName = context.User.UserName;
                }
            }
            var logEntry = new LoginLogEntry(context, loginId, eventType.ToString(), notes, userName);

            _backgroundSave.AddObject(logEntry);
        }
コード例 #2
0
ファイル: LoginLogModule.cs プロジェクト: yuanfei05/vita
 public void LogEvent(OperationContext context, LoginEventType eventType, ILogin login = null, string notes = null, string userName = null)
 {
     var webCtx = context.WebContext;
       Guid? loginId = null;
       if(login != null) {
     loginId = login.Id;
     if(userName == null)
       userName = login.UserName;
       }
       var logEntry = new LoginLogEntry(context, loginId, eventType.ToString(), notes, userName);
       _backgroundSave.AddObject(logEntry);
 }