Exemplo n.º 1
0
        public void CreateEventUserDownloadBlob(User user, Blob blob, RequestData request)
        {
            BlobEvent @event = new BlobEvent()
            {
                BlobEventId = Guid.NewGuid(),
                EventDateTime = DateTime.UtcNow,
                EventType = (int)EventType.Download,
                User = user,
                Blob = blob
            };

            CompleteBlobEvent(@event, request);

            this.context.BlobEvents.AddObject(@event);
            this.context.SaveChanges();
        }
Exemplo n.º 2
0
 public void CreateEventUserDownloadBlob(string nameIdentifier, string identityProvider, Blob blob, RequestData request)
 {
     User user = this.userService.RetrieveUserByNameIdentifier(nameIdentifier, identityProvider);
     this.CreateEventUserDownloadBlob(user, blob, request);
 }
Exemplo n.º 3
0
 public void CreateEventUserDeactivation(User user, RequestData request)
 {
     this.CreateUserEvent(user, UserEventType.Deactivation, request);
 }
Exemplo n.º 4
0
        private void CreateUserEvent(User user, UserEventType type, RequestData request)
        {
            UserEvent @event = new UserEvent()
            {
                UserEventId = Guid.NewGuid(),
                User = user,
                EventType = (int)type,
                EventDateTime = DateTime.UtcNow
            };

            CompleteUserEvent(@event, request);

            this.context.UserEvents.AddObject(@event);
            this.context.SaveChanges();
        }
Exemplo n.º 5
0
 public void CreateEventUserCreate(User user, RequestData request)
 {
     this.CreateUserEvent(user, UserEventType.Create, request);
 }
Exemplo n.º 6
0
 private static void CompleteUserEvent(UserEvent @event, RequestData request)
 {
     if (request != null)
     {
         @event.Url = request.Url;
         @event.UserAgent = request.UserAgent;
         @event.RemoteMachine = request.RemoteMachine;
         @event.SessionId = request.SessionId;
     }
 }
Exemplo n.º 7
0
        public RequestData GetRequestData()
        {
            if (HttpContext.Current == null)
            {
                return null;
            }

            HttpRequest currentRequest = HttpContext.Current.Request;

            RequestData request = new RequestData()
            {
                Url = currentRequest.RawUrl,
                UserAgent = currentRequest.UserAgent,
                RemoteMachine = string.IsNullOrEmpty(currentRequest.UserHostName) ? currentRequest.UserHostAddress : currentRequest.UserHostAddress,
                SessionId = null
            };

            return request;
        }
Exemplo n.º 8
0
 public void CreateEventUserViewBlobSet(string nameIdentifier, string identityProvider, BlobSet set, RequestData request)
 {
     User user = this.userService.RetrieveUserByNameIdentifier(nameIdentifier, identityProvider);
     this.CreateEventUserViewBlobSet(user, set, request);
 }
Exemplo n.º 9
0
        public void CreateEventUserViewBlobSet(User user, BlobSet set, RequestData request)
        {
            BlobSetEvent @event = new BlobSetEvent()
            {
                BlobSetEventId = Guid.NewGuid(),
                EventDateTime = DateTime.UtcNow,
                EventType = (int)EventType.View,
                User = user,
                BlobSet = set
            };

            CompleteBlobSetEvent(@event, request);

            this.context.BlobSetEvents.AddObject(@event);
            this.context.SaveChanges();
        }
Exemplo n.º 10
0
 public void CreateEventUserLogin(User user, RequestData request)
 {
     this.CreateUserEvent(user, UserEventType.Login, request);
 }