public override void InitController(OperationContext context)
 {
     base.InitController(context);
       _processService = context.App.GetService<ILoginProcessService>();
       _incidentLog = Context.App.GetService<IIncidentLogService>();
       _loginSettings = Context.App.GetConfig<LoginModuleSettings>();
 }
Beispiel #2
0
        public override void Init()
        {
            base.Init();
            _recaptchaService    = App.GetService <IRecaptchaService>();
            _loginLog            = App.GetService <ILoginLogService>();
            _sessionService      = App.GetService <IUserSessionService>();
            _incidentLog         = App.GetService <IIncidentLogService>();
            _notificationService = App.GetService <INotificationService>();
            // automatically create notification service if it is not found - to ease upgrading after refactoring that introduced this service (Feb 2016)
            if (_notificationService == null)
            {
                _notificationService = NotificationService.Create(App);
            }
            // Password checker
            if (_settings.PasswordChecker == null)
            {
                _settings.PasswordChecker = new PasswordStrengthChecker(App);
            }
            IEncryptionService encrService = App.GetService <IEncryptionService>();

            Util.Check(encrService != null, "Failed to get encryption service.");
            if (!string.IsNullOrWhiteSpace(_settings.EncryptionChannelName))
            {
                Util.Check(encrService.IsRegistered(_settings.EncryptionChannelName),
                           "Encryption channel '{0}' for LoginModule is not registered in EncryptedDataModule.");
            }
            //Login failed trigger
            if (_incidentLog != null && _settings.LoginFailedTriggerSettings != null)
            {
                var trigger = new LoginFailedTrigger(App, _settings.LoginFailedTriggerSettings);
                _incidentLog.AddTrigger(trigger);
            }
        }
Beispiel #3
0
        public LoggingEntityApp(string schema = "log", LogModules includeModules = LogModules.All,
                                UserSessionSettings sessionSettings = null) : base("LoggingApp", CurrentVersion)
        {
            var area = base.AddArea(schema);

            ActiveModules = includeModules;
            // DbInfo module is not shared with main app, it is local for the database
            var dbInfo = new DbInfoModule(area);

            // ErrorLog is property in EntityApp, will be set there automatically
            if (ActiveModules.IsSet(LogModules.ErrorLog))
            {
                var errLog = new ErrorLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.OperationLog))
            {
                OperationLog = new OperationLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.IncidentLog))
            {
                IncidentLog = new IncidentLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.TransactionLog))
            {
                TransactionLog = new TransactionLogModule(area, trackHostApp: false); //do not track changes for LoggingApp itself
            }
            if (ActiveModules.IsSet(LogModules.NotificationLog))
            {
                NotificationLog = new NotificationLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.LoginLog))
            {
                LoginLog = new LoginLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.DbUpgradeLog))
            {
                DbUpgradeLog = new DbUpgradeLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.UserSession))
            {
                SessionService = new UserSessionModule(area, sessionSettings);
            }
            if (ActiveModules.IsSet(LogModules.EventLog))
            {
                EventLogService = new EventLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.WebCallLog))
            {
                WebCallLog = new WebCallLogModule(area);
            }
            if (ActiveModules.IsSet(LogModules.WebClientLog))
            {
                WebClientLogService = new WebClientLogModule(area);
            }
        }
Beispiel #4
0
 public LoggingEntityApp(string schema = "log", UserSessionSettings sessionSettings = null)
     : base("LoggingApp", CurrentVersion)
 {
     var area = base.AddArea(schema);
       var errorLog = new ErrorLogModule(area);
       OperationLog = new OperationLogModule(area);
       IncidentLog = new IncidentLogModule(area);
       TransactionLog = _transactionLogModule = new TransactionLogModule(area);
       WebCallLog = new WebCallLogModule(area);
       NotificationLog = new NotificationLogModule(area);
       LoginLog = new LoginLogModule(area);
       DbModelChangeLog = new DbUpgradeLogModule(area);
       SessionService = new UserSessionModule(area, sessionSettings);
       DbInfoService = new DbInfoModule(area);
       EventLogService = new EventLogModule(area);
 }
Beispiel #5
0
        public override void Init()
        {
            base.Init();
            _timers      = App.GetService <ITimerService>();
            _errorLog    = App.GetService <IErrorLogService>();
            _incidentLog = App.GetService <IIncidentLogService>();
            _serializer  = new JsonSerializer();
            _jobNameSize = App.GetPropertySize <IJob>(j => j.Name);
            //hook to events
            // every minute we check for due job runs and start them
            _timers.Elapsed1Minute += Timers_ElapsedIMinue;
            // Every 30 minutes check for long overdue jobs for ANY server
            _timers.Elapsed30Minutes += Timers_Elapsed30Minutes;
            // Whenever job run is saved, and RunType=OnSave, we start the run in this handler
            var jobRunEntInfo = App.Model.GetEntityInfo(typeof(IJobRun));

            jobRunEntInfo.SaveEvents.SavedChanges += JobRunEntitySavedHandler;
            // On saving job schedule (CRON schedule), we automatically create the first job run
            var jobSchedEntInfo = App.Model.GetEntityInfo(typeof(IJobSchedule));

            jobSchedEntInfo.SaveEvents.SavingChanges += JobScheduleEntitySavingHandler;
        }
Beispiel #6
0
 public override void Init()
 {
     base.Init();
       _recaptchaService = App.GetService<IRecaptchaService>();
       _loginLog = App.GetService<ILoginLogService>();
       _sessionService = App.GetService<IUserSessionService>();
       _incidentLog = App.GetService<IIncidentLogService>();
       _notificationService = App.GetService<INotificationService>();
       // automatically create notification service if it is not found - to ease upgrading after refactoring that introduced this service (Feb 2016)
       if (_notificationService == null)
     _notificationService = NotificationService.Create(App);
       // Password checker
       if(_settings.PasswordChecker == null)
     _settings.PasswordChecker = new PasswordStrengthChecker(App);
       IEncryptionService encrService = App.GetService<IEncryptionService>();
       Util.Check(encrService != null, "Failed to get encryption service."); //never happens, module requires EncryptedDataModule
       if (!string.IsNullOrWhiteSpace(_settings.EncryptionChannelName))
     Util.Check(encrService.IsRegistered(_settings.EncryptionChannelName),
       "Encryption channel '{0}' for LoginModule is not registered in EncryptedDataModule.");
       //Login failed trigger
       if(_incidentLog != null && _settings.LoginFailedTriggerSettings != null) {
     var trigger = new LoginFailedTrigger(App, _settings.LoginFailedTriggerSettings);
     _incidentLog.AddTrigger(trigger);
       }
 }
Beispiel #7
0
 public override void InitController(OperationContext context) {
   base.InitController(context);
   _processService = context.App.GetService<ILoginProcessService>();
   _incidentLog = Context.App.GetService<IIncidentLogService>();
   _loginSettings = Context.App.GetConfig<LoginModuleSettings>();
 }