<commit_before>﻿using System.Collections.Generic;
using Orchard.Environment.Extensions;
using Orchard.Users.Events;
using Orchard.Workflows.Services;

namespace Orchard.Users.Handlers {
    [OrchardFeature("Orchard.Users.Workflows")]
    public class WorkflowUserEventHandler : IUserEventHandler {
        private readonly IWorkflowManager _workflowManager;

        public WorkflowUserEventHandler(IWorkflowManager workflowManager) {
            _workflowManager = workflowManager;
        }

        public void Creating(UserContext context) {
            _workflowManager.TriggerEvent("UserCreating",
                                         context.User,
                                         () => new Dictionary<string, object> {{"User", context}});
        }

        public void Created(UserContext context) {
            _workflowManager.TriggerEvent("UserCreated",
                                         context.User,
                                         () => new Dictionary<string, object> {{"User", context}});
        }

        public void LoggingIn(string userNameOrEmail, string password) {
            _workflowManager.TriggerEvent("UserLoggingIn",
                                         null,
                                         () => new Dictionary<string, object>{{"UserNameOrEmail", userNameOrEmail}, {"Password", password}});
        }

        public void LoggedIn(Security.IUser user) {
            _workflowManager.TriggerEvent("UserLoggedIn",
                                         user,<commit_msg>Add UserParameters token object (#7482)<commit_after>﻿using System.Collections.Generic;
using Orchard.Environment.Extensions;
using Orchard.Users.Events;
using Orchard.Workflows.Services;

namespace Orchard.Users.Handlers {
    [OrchardFeature("Orchard.Users.Workflows")]
    public class WorkflowUserEventHandler : IUserEventHandler {
        private readonly IWorkflowManager _workflowManager;

        public WorkflowUserEventHandler(IWorkflowManager workflowManager) {
            _workflowManager = workflowManager;
        }

        public void Creating(UserContext context) {
            _workflowManager.TriggerEvent("UserCreating",
                                         context.User,
                                         () => new Dictionary<string, object> {
                                             {"User", context.User},
                                             {"UserParameters", context.UserParameters}
                                         });
        }

        public void Created(UserContext context) {
            _workflowManager.TriggerEvent("UserCreated",
                                         context.User,
                                         () => new Dictionary<string, object> {
                                             {"User", context.User},
                                             {"UserParameters", context.UserParameters}
                                         });
        }

        public void LoggingIn(string userNameOrEmail, string password) {
            _workflowManager.TriggerEvent("UserLoggingIn",
                                         null,
                                         () => new Dictionary<string, object>{{"UserNameOrEmail", userNameOrEmail}, {"Password", password}});
        }

        public void LoggedIn(Security.IUser user) {
            _workflowManager.TriggerEvent("UserLoggedIn",
                                         user,
{'fraction_non_alphanumeric': 0.08194364577343301, 'fraction_numerical': 0.0011500862564692352, 'mean_word_length': 1.5449890270665692, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2278963', 'n_tokens_mistral': 720, 'n_tokens_neox': 689, 'n_words': 139}