Example #1
0
        /// <summary>
        /// Runs based on the specified options.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <returns>
        /// The program return code
        /// </returns>
        private static int Run(Options options)
        {
            if (!options.LoadSettingsFile())
            {
                Console.Error.WriteLine(string.Format(OptionsExtensions.FileDoesNotExist, options.SettingsFile));
                return(INVALID_RUN);
            }

            string error = options.Validate();

            if (!string.IsNullOrEmpty(error))
            {
                Console.Error.WriteLine(error);
                return(INVALID_ARGUMENTS);
            }

            IServiceProvider serviceProvider = InitDependencyInjection(options);
            IEmailHandler    handler         = serviceProvider.GetRequiredService <IEmailHandler>();

            if (!handler.HandleIncomingEmail())
            {
                return(INVALID_RUN);
            }

            return(VALID_RUN);
        }
        //private static readonly byte[] KEY_64 = { 12, 16, 93, 156, 90, 4, 218, 32 };

        //private static readonly byte[] IV_64 = {2, 5, 246, 79, 36, 32, 167, 3};

        public ApplicationUserManager(IUserStore <ApplicationUser> store,
                                      IEmailHandler emailHandler)
            : base(store)
        {
            var provider = DataProtectionProvider; //new DpapiDataProtectionProvider("FileManager");

            //var dataProtectionProvider = DataProtectionProvider;

            UserTokenProvider = new DataProtectorTokenProvider <ApplicationUser>(
                provider.Create("EmailConfirmation"));
            UserValidator = new UserValidator <ApplicationUser>(this)
            {
                AllowOnlyAlphanumericUserNames = false,
                RequireUniqueEmail             = true
            };

            // Configure validation logic for passwords
            PasswordValidator = new PasswordValidator
            {
                RequiredLength          = 6,
                RequireNonLetterOrDigit = true,
                RequireDigit            = true,
                RequireLowercase        = true,
                RequireUppercase        = true,
            };

            // Configure user lockout defaults
            UserLockoutEnabledByDefault          = false;
            DefaultAccountLockoutTimeSpan        = TimeSpan.FromMinutes(5);
            MaxFailedAccessAttemptsBeforeLockout = 5;

            EmailService = new EmailService(emailHandler);
        }
Example #3
0
 public RBot(string browserName)
 {
     webBrowser   = new WebBrowser(browserName);
     emailHandler = new EmailHandler(webBrowser);
     pdfHandler   = new PDFHandler(webBrowser);
     fileHandler  = new FileHandler(webBrowser);
 }
Example #4
0
 public OrderController(IUnitOfWork unitOfWork, ShoppingCart shoppingCart, IEmailHandler emailHandler)
 {
     _shoppingCart      = shoppingCart;
     _emailHandler      = emailHandler;
     _connectionHandler = new ConnectionHandler();
     _unitOfWork        = unitOfWork;
 }
Example #5
0
 public InitializeWebHost(IDiagnosticService diagnosticService, IEmailHandler emailHandler, IIISHostingHelper iisHostingHelper, IDeploymentJobService deploymentJobService)
     : base(diagnosticService, emailHandler, iisHostingHelper, deploymentJobService)
 {
     _deploymentJobService = deploymentJobService;
     _iisHostingHelper     = iisHostingHelper;
     _diagnosticService    = diagnosticService;
 }
Example #6
0
 public UninstallJob(IDiagnosticService diagnosticService, IEmailHandler emailHandler, IIISHostingHelper iisHostingHelper, IDeploymentJobService deploymentJobService)
     : base(diagnosticService, emailHandler, iisHostingHelper, deploymentJobService)
 {
     _deploymentJobService = deploymentJobService;
     _diagnosticService    = diagnosticService;
     _iisHostingHelper     = iisHostingHelper;
 }
Example #7
0
 public MessageHandlerExecutorActor(Mapper mapper, IDictionary <string, bool> handlersSettings)
     : base("MessageHandlerExecutorActor")
 {
     _mapper        = mapper;
     _firstHandlers = ConfigureHandlerChain(handlersSettings);
     Command <ExecuteHandlersMsg>(HandleExecuteHandlersMsg);
 }
Example #8
0
 public AccountService(IUnitOfWork unitOfWork, AccountBuilder accountBuilder, AccountAdapter accountAdapter, AccountBusinessRules accountBusinessRules, IEmailHandler emailHandler)
 {
     this.unitOfWork           = unitOfWork;
     this.accountBuilder       = accountBuilder;
     this.accountAdapter       = accountAdapter;
     this.accountBusinessRules = accountBusinessRules;
     this.emailHandler         = emailHandler;
 }
Example #9
0
 protected JobMasterFile(IDiagnosticService diagnosticService, IEmailHandler emailHandler, IIISHostingHelper iisHostingHelper, IDeploymentJobService deploymentJobService)
 {
     _diagnosticService    = diagnosticService;
     _emailHandler         = emailHandler;
     _iisHostingHelper     = iisHostingHelper;
     _deploymentJobService = deploymentJobService;
     ServerId = AppSettingsReader.GetValue("ServerId", typeof(string)).ToString();
 }
Example #10
0
 public SolicitudTask(IDataHandler datahandler, IReportHandler reporthandler, IEmailHandler emailhandler, IReportConfiguration reportconfiguration, SearchCriteria filter)
 {
     _datahandler         = datahandler;
     _reporthandler       = reporthandler;
     _emailhandler        = emailhandler;
     _reportconfiguration = reportconfiguration;
     _filtercriteria      = filter;
 }
Example #11
0
 public GroupService(IMapper mapper, IUnitOfWork unitOfWork, ILogger <IGroupService> logger, IEmailHandler emailHandler, ITokenHandler tokenHandler)
 {
     _mapper       = mapper;
     _unitOfWork   = unitOfWork;
     _logger       = logger;
     _emailHandler = emailHandler;
     _tokenHandler = tokenHandler;
 }
Example #12
0
        public Status()
        {
            webBrowser   = new WebBrowser(browserName);
            emailHandler = new EmailHandler(webBrowser);
            pdfHandler   = new PDFHandler(webBrowser);
            fileHandler  = new FileHandler(webBrowser);

            InitializeComponent();
        }
 public GetTokenCommandHandler(IConnectionMultiplexer connectionMultiplexer, IBusClient busClient, IUserService userService, IEmailHandler emailHandler, IOptions <JwtOptions> jwtOptions, LocalizationService localizationService)
 {
     this._connectionMultiplexer = connectionMultiplexer;
     this._busClient             = busClient;
     this._userService           = userService;
     this._emailHandler          = emailHandler;
     this._jwtOptions            = jwtOptions.Value;
     this._localizationService   = localizationService;
 }
Example #14
0
 public HousekeeperService(
     IUnitOfWork unitOfWork,
     IStatementGenerator statementGenerator,
     IEmailHandler emailHandler,
     IXtraMessageBox messageBox)
 {
     _unitOfWork         = unitOfWork;
     _statementGenerator = statementGenerator;
     _emailHandler       = emailHandler;
     _messageBox         = messageBox;
 }
Example #15
0
 public CourierController(IDiagnosticService diagnosticService, ICourierService courierService, IUserService userService, IContactService contactService, IFranchiseeConfigurationService franchiseeConfigurationService, IEmailHandler emailHandler, IWebApiConsumeUserService webApiConsumeUserService)
     : base(diagnosticService, null)
 {
     _diagnosticService = diagnosticService;
     _courierService    = courierService;
     _userService       = userService;
     _contactService    = contactService;
     _franchiseeConfigurationService = franchiseeConfigurationService;
     _emailHandler             = emailHandler;
     _webApiConsumeUserService = webApiConsumeUserService;
 }
Example #16
0
 //Constructor
 public CustomerDetails(DAL.CRM.ICustomerDetails crmCustomerDetails,
                        Utility.IGenerator codeGenerator,
                        IResourceManagerFactory resourceManager,
                        ILogger logger,
                        IEmailHandler emailHandler = null)
 {
     this.codeGenerator      = codeGenerator;
     this.crmCustomerDetails = crmCustomerDetails;
     this.resourceManager    = resourceManager;
     this.emailHandler       = emailHandler;
     this.logger             = logger;
 }
Example #17
0
 //Constructor
 public MoveDetails(DAL.CRM.ICustomerDetails crmCustomerDetails,
                    DAL.CRM.IMoveDetails crmMoveDetails,
                    IResourceManagerFactory resourceManager,
                    IEmailHandler emailHandler,
                    ILogger logger)
 {
     this.crmCustomerDetails = crmCustomerDetails;
     this.crmMoveDetails     = crmMoveDetails;
     this.resourceManager    = resourceManager;
     this.logger             = logger;
     this.emailHandler       = emailHandler;
 }
Example #18
0
 public UserController(IAuthenticationService authenticationService, IRenderViewToString renderViewToString, IDiagnosticService diagnosticService,
                       IResizeImage resizeImage, IGridConfigService gridConfigService, IUserService userService,
                       IFranchiseeConfigurationService franchiseeConfigurationService, IWebApiConsumeUserService webApiConsumeUserService)
     : base(authenticationService, diagnosticService, userService)
 {
     _userService                    = userService;
     _gridConfigService              = gridConfigService;
     _renderViewToString             = renderViewToString;
     _franchiseeConfigurationService = franchiseeConfigurationService;
     _emailHandler                   = new EmailHandler();
     _resizeImage                    = resizeImage;
     _webApiConsumeUserService       = webApiConsumeUserService;
 }
Example #19
0
 public AuthenticationController(IAuthenticationService authenticationService,
                                 IDiagnosticService diagnosticService, IUserService userService, ICourierService courierService,
                                 IWebApiConsumeUserService webApiUserService, IFranchiseeConfigurationService franchiseeConfigurationService, IFranchiseeTenantService franchiseeTenantService)
     : base(authenticationService, diagnosticService, null)
 {
     _authenticationService          = authenticationService;
     _diagnosticService              = diagnosticService;
     _userService                    = userService;
     _webApiUserService              = webApiUserService;
     _courierService                 = courierService;
     _franchiseeConfigurationService = franchiseeConfigurationService;
     _franchiseeTenantService        = franchiseeTenantService;
     _emailHandler                   = new EmailHandler();
 }
Example #20
0
 public CommonController(IAuthenticationService authenticationService,
                         IDiagnosticService diagnosticService, ITempUploadFileService tempUploadFileService, ISystemEventService systemEventService,
                         IGoogleService googleService, IFranchiseeConfigurationService franchiseeConfigurationService, IEmailHandler emailHandler,
                         IStaticValueService staticValueService)
     : base(authenticationService, diagnosticService, null)
 {
     _authenticationService          = authenticationService;
     _diagnosticService              = diagnosticService;
     _tempUploadFileService          = tempUploadFileService;
     _systemEventService             = systemEventService;
     _staticValueService             = staticValueService;
     _tempUploadFileService.FilePath = "/Content/Upload/";
     _googleService = googleService;
     _franchiseeConfigurationService = franchiseeConfigurationService;
     _emailHandler = emailHandler;
 }
Example #21
0
 //Constructor
 public EstimateDetails(DAL.CRM.ICustomerDetails crmCustomerDetails,
                        DAL.CRM.IEstimateDetails crmEstimateDetails,
                        DAL.CRM.IMoveDetails crmMoveDetails,
                        IEmailHandler emailHandler,
                        ILogger logger,
                        IResourceManagerFactory resourceManager,
                        ISharepointConsumer sharepointConsumer)
 {
     this.crmCustomerDetails = crmCustomerDetails;
     this.crmEstimateDetails = crmEstimateDetails;
     this.crmMoveDetails     = crmMoveDetails;
     this.resourceManager    = resourceManager;
     this.emailHandler       = emailHandler;
     this.logger             = logger;
     this.sharepointConsumer = sharepointConsumer;
 }
Example #22
0
        public ReportController(ISystemPrintPdfService systemPrintPdfService,
                                IEmailHandler emailHandler,
                                IAuthenticationService authenticationService, IRequestService requestService)
        {
            _systemPrintPdfService = systemPrintPdfService;
            _emailHandler          = emailHandler;
            _requestService        = requestService;

            _savedPath = ConfigurationManager.AppSettings["PlaceFileDownloadTemp"];
            if (string.IsNullOrEmpty(_savedPath))
            {
                throw new Exception("Missing config place contain file upload temp [PlaceFileDownloadTemp] in web.config");
            }
            _localPath = System.Web.HttpContext.Current.Server.MapPath(_savedPath);
            if (!Directory.Exists(_localPath))
            {
                Directory.CreateDirectory(_localPath);
            }
        }
Example #23
0
 public FranchiseeConfigurationController(IAuthenticationService authenticationService, IDiagnosticService diagnosticService,
                                          IResizeImage resizeImage, IGridConfigService gridConfigService, IFranchiseeConfigurationService franchiseeConfigurationService,
                                          IFranchiseeTenantService franchiseeTenantService, IUserService userService, IWebApiPaymentService webApiPaymentService,
                                          IWebApiConsumeUserService webApiUserService, IEmailHandler emailHandler, IContactService contactService, ILocationService locationService,
                                          ISystemConfigurationService systemConfigurationService)
     : base(authenticationService, diagnosticService, franchiseeConfigurationService)
 {
     _resizeImage = resizeImage;
     _franchiseeConfigurationService = franchiseeConfigurationService;
     _gridConfigService          = gridConfigService;
     _webApiUserService          = webApiUserService;
     _diagnosticService          = diagnosticService;
     _userService                = userService;
     _webApiPaymentService       = webApiPaymentService;
     _emailHandler               = emailHandler;
     _contactService             = contactService;
     _locationService            = locationService;
     _systemConfigurationService = systemConfigurationService;
 }
Example #24
0
 public AccountService(IUnitOfWork unitOfWork,
                       AccountMapper accountMapper,
                       AccountBusinessRules accountBusinessRules,
                       IEmailHandler emailHandler,
                       IMemoryCache cache,
                       IConfiguration configuration,
                       ISubUserClient subUserClient,
                       CreateSubUserRequestMapper createSubUserRequestMapper,
                       FetchSubUsersForBusinessUserRequestMapper fetchSubUsersForBusinessUserRequestMapper)
 {
     this.unitOfWork           = unitOfWork;
     this.accountMapper        = accountMapper;
     this.accountBusinessRules = accountBusinessRules;
     this.emailHandler         = emailHandler;
     this.cache         = cache;
     this.configuration = configuration;
     this.subUserClient = subUserClient;
     this.createSubUserRequestMapper = createSubUserRequestMapper;
     this.fetchSubUsersForBusinessUserRequestMapper = fetchSubUsersForBusinessUserRequestMapper;
 }
 public AccountController(CustomUserManager userManager, SignInManager <CustomUser> signInManager, IEmailHandler emailHandler)
 {
     this._userManager   = userManager;
     this._signInManager = signInManager;
     this.EmailHandler   = emailHandler;
 }
        public AutomatorConfig(Configuration ini, string manDictFilename)
        {
            try
            {
                //declares section
                var sectionEmailAccount     = ini["EmailAccount"];
                var sectionExecutioner      = ini["Executioner"];
                var sectionMailBoxAutoReply = ini["MailBoxAutoReply"];
                var sectionReport           = ini["Report"];
                var sectionRetry            = ini["Retry"];
                var sectionPolicy           = ini["Policy"];


                var emailAuth   = sectionEmailAccount["Authentication"].StringValue.Split(':');
                var executioner = sectionExecutioner["Authentication"].StringValue;
                //set mailbox auto reply
                SetMailBoxAutoReply             = sectionMailBoxAutoReply["SetMailBoxAutoReply"].BoolValue;
                AutoReplyString                 = sectionMailBoxAutoReply["AutoReplyString"].StringValue;
                AutoReplyStringWithContactToken = sectionMailBoxAutoReply["AutoReplyStringWithContactToken"].StringValue;
                //report
                SendReport = sectionReport["SendReport"].BoolValue;
                //email account
                //SenderEmailSuffix = nini.Configs["EmailAccount"].GetString("SenderEmailSuffix"),
                EmailHandler          = new EmailHandler(emailAuth.First(), emailAuth.Last());
                ResignFolderName      = sectionEmailAccount["ResignFolderName"].StringValue;
                ProcessedFolderName   = sectionEmailAccount["ProcessedFolderName"].StringValue;
                MoveToProcessedFolder = sectionEmailAccount["MoveToProcessedFolder"].BoolValue;
                ReadEmailRetry        = sectionRetry["ReadEmailRetry"].IntValue;
                ReportCC        = sectionReport["ReportCC"].StringValue.Split(',');
                ReportReceiver  = sectionReport["ReportReceiver"].StringValue.Split(',');
                SendReportRetry = sectionRetry["SendReportRetry"].IntValue;

                //exp: luu nhat hong:[email protected],vo ya phuong khanh:vo.phuong-khanh@hd... *case insenstive
                AcceptedResignSenders = SplitToTuple(sectionEmailAccount["AcceptedResignSenders"].StringValue);
                //db adapter
                //Adapter = new DbAdapter($@"{Program.AssemblyDirectory}\db.dat"), //not configureable
                //Executioner
                var manDict = GetManDict(manDictFilename);
                Executioner = executioner == string.Empty ?
                              (IExecutioner) new MockExecutioner()
                {
                    ManagerDictionary = manDict
                } :
                new Executioner(executioner.Split(':').First(), executioner.Split(':').Last())
                {
                    ManagerDictionary = manDict
                };
                //Policy
                DeleteAfter = sectionPolicy["DeleteAccountAfter"].IntValue;

                //set auto reply flag & content to Executioner
                if (SetMailBoxAutoReply)
                {
                    if (string.IsNullOrEmpty(AutoReplyString) || string.IsNullOrEmpty(AutoReplyStringWithContactToken))
                    {
                        throw new ArgumentException("auto reply strings must be set. when AutoReply is true");
                    }

                    Executioner.SetMailBoxAutoReply        = true;
                    Executioner.AutoReplyString            = AutoReplyString;
                    Executioner.AutoReplyStringWithContact = AutoReplyStringWithContactToken;
                }
                //set report sender account
                var reportAuth = sectionReport["Authentication"].StringValue;
                if (!string.IsNullOrEmpty(reportAuth))
                {
                    EmailHandler.ReportSenderUsername = reportAuth.Split(':').First();
                    EmailHandler.ReportSenderPassword = reportAuth.Split(':').Last();
                }
            }
            catch (NullReferenceException)
            {
                //wrap exception
                Console.WriteLine("invalid config!");
                Console.ReadLine();
                throw new ArgumentException("invalid config");
            }
        }
 public GenericEventService(IComponentContext container, IEmailHandler emailHandler)
 {
     _container = container;
     _emailHandler = emailHandler;
 }
 public EmailService(IConfiguration configuration, IEmailHandler emailHandler)
 {
     _configuration = configuration;
     _emailHandler  = emailHandler;
 }
Example #29
0
 public EmailCommandProcessor(IEmailHandler emailHandler)
 {
     _emailHandler = emailHandler;
 }
Example #30
0
 public CopySource(IDiagnosticService diagnosticService, IEmailHandler emailHandler, IIISHostingHelper iisHostingHelper, IDeploymentJobService deploymentJobService)
     : base(diagnosticService, emailHandler, iisHostingHelper, deploymentJobService)
 {
     _deploymentJobService = deploymentJobService;
     _diagnosticService = diagnosticService;
 }
 public EmailSender(IEmailHandler emailHandler)
 {
     _emailHandler = emailHandler;
 }
 public void Setup()
 {
     _emailHandler = Container.Resolve<IEmailHandler>();
 }
Example #33
0
 public UserService(IUserRepo repo, ITokenGenerator tokenGenerator, IEmailHandler emailHandler)
 {
     this.userRepo       = repo;
     this.tokenGenerator = tokenGenerator;
     this.emailHandler   = emailHandler;
 }