Ejemplo n.º 1
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);
       }
 }
Ejemplo n.º 2
0
 public ValidationController(StarkitContext db, UserManager <User> userManager, SignInManager <User> signInManager, IRecaptchaService recaptcha)
 {
     _db            = db;
     _userManager   = userManager;
     _signInManager = signInManager;
     _recaptcha     = recaptcha;
 }
Ejemplo n.º 3
0
 public HomeController(IRecaptchaService recaptcha)
 {
     _recaptcha = recaptcha;
 }
Ejemplo n.º 4
0
 public AccountController(LdapSignInManager signInManager, IRecaptchaService recaptchaService)
 {
     this.signInManager     = signInManager;
     this._recaptchaService = recaptchaService;
 }
 public JobListingController(IEnumerable <IGenerateEmail> emailGenerators, ISendEmail sendEmail, IValidateResume resumeValidator, IRecaptchaService recaptchaService)
 {
     _emailGenerators  = emailGenerators;
     _sendEmail        = sendEmail;
     _resumeValidator  = resumeValidator;
     _recaptchaService = recaptchaService;
 }
Ejemplo n.º 6
0
 public EmailUsController(ILogger <EmailUsController> logger, IEmailService emailService, WebsiteDataContext db, IRecaptchaService reCAPTCHA)
 {
     _Logger       = logger;
     _EmailService = emailService;
     _Db           = db;
     _Recaptcha    = reCAPTCHA;
 }
Ejemplo n.º 7
0
 public LoginModel(SignInManager <GadgetCMSUser> signInManager, ILogger <LoginModel> logger, IRecaptchaService recaptcha)
 {
     _signInManager = signInManager;
     _logger        = logger;
     _recaptcha     = recaptcha;
 }
Ejemplo n.º 8
0
 public SupportController(ILogger logger, IDataSetsHelper dataSetsHelper, IRoles roles, IMailer mailer, IOptions <WebsiteConfiguration> config, IAuthentication authentication, IFileSourceHelper fileSourceHelper, IOptions <StripeConfiguration> stripeConfig, IDonationService donationService, IMembershipService membershipService, IContactService contactService, IOptions <RecaptchaConfiguration> recaptchaConfig, IRecaptchaService recaptchaService)
     : base(logger, dataSetsHelper, roles, authentication, fileSourceHelper, membershipService)
 {
     _logger           = logger;
     _mailer           = mailer;
     _donationService  = donationService;
     _contactService   = contactService;
     _recaptchaService = recaptchaService;
     _recaptchaConfig  = recaptchaConfig.Value;
     _config           = config.Value;
     _urlHelper        = new UrlHelper(System.Web.HttpContext.Current.Request.RequestContext);
 }
Ejemplo n.º 9
0
 public AdController(IRecaptchaService rcService, IAdRepository adRepository, IUserRepository userRepository)
 {
     _rcService      = rcService;
     _adRepository   = adRepository;
     _userRepository = userRepository;
 }
Ejemplo n.º 10
0
 public LoginController(ILoggerFactory loggerFactory, IRecaptchaService recaptchaService)
 {
     _logger           = loggerFactory.CreateLogger <LoginController>();
     _recaptchaService = recaptchaService;
 }
        public AnnouncementController(ApplicationContext context, IMapper mapper, IWebHostEnvironment appEnwironment, IRecaptchaService recaptcha)
        {
            db              = context;
            _mapper         = mapper ?? throw new ArgumentNullException(nameof(mapper));
            _appEnwironment = appEnwironment;
            _recaptcha      = recaptcha;

            if (!db.Announcements.Any())
            {
                db.Announcements.Add(
                    new Announcement
                {
                    OrderNumber = 1,
                    user        = new User {
                        Name = "Tom"
                    },
                    Text         = "пойду добровольно в армию!",
                    CreationDate = DateTime.Now,
                    Rating       = 3
                });
                db.SaveChanges();
            }
        }
Ejemplo n.º 12
0
 public PersonController(IRecaptchaService recaptcha, IOptions <RecaptchaOptions> recaptchaOptions)
 {
     this.recaptcha        = recaptcha as RecaptchaService;
     this.recaptchaOptions = recaptchaOptions.Value;
 }
 public ValidateRecaptchaImpl(IRecaptchaService recaptchaService)
 {
     this.recaptchaService = recaptchaService;
 }
 public IdentityController(UserManager <User> userManager, SignInManager <User> signInManager, RoleManager <IdentityRole <int> > roleManager, IRecaptchaService recaptcha, ILogger <IdentityController> logger)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _roleManager   = roleManager;
     _recaptcha     = recaptcha;
     _logger        = logger;
 }
Ejemplo n.º 15
0
        public AccountController(IRepository <User> userRepository, ILogger logger, IMailer mailer, IOptions <WebsiteConfiguration> websiteConfig, IDataSetsHelper dataSetsHelper, IRoles roles, IAccountService accountService, IAuthentication authentication, IFileSourceHelper fileSourceHelper, IFacebookService facebookService, IMembershipService membershipService, IContactService contactService, IUserService userService, IRepository <PromoCode> promoCodesRepository, IOptions <RecaptchaConfiguration> recaptchaConfig, IRecaptchaService recaptchaService)
            : base(logger, dataSetsHelper, roles, authentication, fileSourceHelper, membershipService)
        {
            _userRepository       = userRepository;
            _logger               = logger;
            _accountService       = accountService;
            _authentication       = authentication;
            _facebookService      = facebookService;
            _membershipService    = membershipService;
            _contactService       = contactService;
            _userService          = userService;
            _promoCodesRepository = promoCodesRepository;
            _recaptchaService     = recaptchaService;
            _recaptchaConfig      = recaptchaConfig.Value;

            websiteConfig.Value.RegistrationEmailTemplateText  = Globalisation.Dictionary.WelcomeEmail;
            websiteConfig.Value.PasswordResetEmailTemplateText = Globalisation.Dictionary.PasswordResetEmail;
        }
Ejemplo n.º 16
0
 public HomeController(IRecaptchaService recaptcha)
 {
     _recaptcha    = recaptcha;
     _minimumScore = 0.5;
     _errorMessage = "There was an error validating the google recaptcha response. Please try again, or contact the site owner.";
 }
Ejemplo n.º 17
0
 public ForgotPasswordModel(UserManager <ApplicationUser> userManager, IEmailService emailService, IRecaptchaService recaptchaService)
 {
     _userManager      = userManager;
     _emailService     = emailService;
     _recaptchaService = recaptchaService;
 }
Ejemplo n.º 18
0
 public HomeController(ILogger <HomeController> logger, UserManager <THUMember> userManager, SignInManager <THUMember> signInManager,
                       IKeyStorageService keyStorageService, IWebHostEnvironment hostingEnvironment, IRecaptchaService recaptchaService)
 {
     _logger                = logger;
     this.userManager       = userManager;
     this.signInManager     = signInManager;
     this.keyStorageService = keyStorageService;
     iHostingEnvironment    = hostingEnvironment;
     this._recaptchaService = recaptchaService;
 }
Ejemplo n.º 19
0
 public ValidateRecaptchaFilter(IRecaptchaService recaptcha, double minimumScore, string errorMessage)
 {
     _recaptcha    = recaptcha;
     _minimumScore = minimumScore;
     _errorMessage = errorMessage;
 }
 public CreateDoublesRegistrationCommandHandler(ILoggerFactory loggerFactory, IUnitOfWork unitOfWork, IRegistrationUnitOfWork registrationUnitOfWork, CreateDoublesRegistrationCommandValidator validator, ICompetitionRepository competitionRepository,
                                                ICompetitionRegistrationRepository competitionRegistrationRepository, IRecaptchaService recaptchaService, IRegistrationEmailManager registrationEmailManager, ICompetitionRegistrationAttemptRepository competitionRegistrationAttemptRepository,
                                                ICompetitionDateRepository competitionDateRepository)
 {
     this._logger                                   = loggerFactory.CreateLogger <CreateDoublesRegistrationCommandHandler>();
     this._validator                                = validator;
     this._unitOfWork                               = unitOfWork;
     this._registrationUnitOfWork                   = registrationUnitOfWork;
     this._competitionRepository                    = competitionRepository;
     this._competitionRegistrationRepository        = competitionRegistrationRepository;
     this._recaptchaService                         = recaptchaService;
     this._registrationEmailManager                 = registrationEmailManager;
     this._competitionRegistrationAttemptRepository = competitionRegistrationAttemptRepository;
     this._competitionDateRepository                = competitionDateRepository;
 }
 public RecaptchaMiddleware(RequestDelegate next, IRecaptchaService recaptchaService, IOptionsMonitor <RecaptchaSettings> options)
 {
     _next             = next;
     _recaptchaService = recaptchaService;
     _options          = options;
 }
Ejemplo n.º 22
0
 public AdminController(UserManager <AppUser> userManager, SignInManager <AppUser> signInManager, IUserValidator <AppUser> userValidator, IPasswordHasher <AppUser> passwordHasher, IPasswordValidator <AppUser> passwordValidator, IRecaptchaService recaptcha)
 {
     _passwordHasher    = passwordHasher;
     _passwordValidator = passwordValidator;
     _userValidator     = userValidator;
     _userManager       = userManager;
     SignInManager      = signInManager;
     _recaptcha         = recaptcha;
 }
Ejemplo n.º 23
0
 public HomeController(IRecaptchaService recaptcha)
 {
     return;
 }
Ejemplo n.º 24
0
 public AccountController(UserManager <User> userManager, RoleManager <IdentityRole> roleManager, SignInManager <User> signInManager, StarkitContext db, IHostEnvironment environment, IRecaptchaService recaptcha)
 {
     _userManager   = userManager;
     _roleManager   = roleManager;
     _signInManager = signInManager;
     _db            = db;
     _environment   = environment;
     _recaptcha     = recaptcha;
 }
Ejemplo n.º 25
0
 public AccountsController(IUserService userService, UnitOfWork unitOfWork, IRecaptchaService recaptcha) =>
 (_userService, this.unitOfWork, this.recaptcha) =
Ejemplo n.º 26
0
 public ContactsController(IRecaptchaService recaptcha)
 {
     _recaptcha = recaptcha;
 }
Ejemplo n.º 27
0
 public AccountController(SignInManager <User> signInManager, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, IRecaptchaService recaptcha, ApplicationContext context, IProfileRepository profileRepository)
 {
     this.signInManager = signInManager;
     this.userManager   = userManager;
     this.roleManager   = roleManager;
     _recaptcha         = recaptcha;
     this.context       = context;
     _profileRepository = profileRepository;
 }
 public AccountController(IRecaptchaService recaptcha)
 {
     _recaptcha = recaptcha;
 }
Ejemplo n.º 29
0
 public AccountController(UserManager <User> userManager, SignInManager <User> signInManager, IRecaptchaService recaptcha)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _recaptcha     = recaptcha;
 }
Ejemplo n.º 30
0
 public BlogPostController(IBlogManager blogManager, IHttpContextAccessor httpContextAccessor, IDasBlogSettings dasBlogSettings,
                           IMapper mapper, ICategoryManager categoryManager, IFileSystemBinaryManager binaryManager, ILogger <BlogPostController> logger,
                           IBlogPostViewModelCreator modelViewCreator, IMemoryCache memoryCache, IRecaptchaService recaptcha)
     : base(dasBlogSettings)
 {
     this.blogManager         = blogManager;
     this.categoryManager     = categoryManager;
     this.httpContextAccessor = httpContextAccessor;
     this.dasBlogSettings     = dasBlogSettings;
     this.mapper           = mapper;
     this.binaryManager    = binaryManager;
     this.logger           = logger;
     this.modelViewCreator = modelViewCreator;
     this.memoryCache      = memoryCache;
     this.recaptcha        = recaptcha;
 }
Ejemplo n.º 31
0
 public UsersController(IUserService userService, IRecaptchaService recaptchaService)
 {
     _userService      = userService;
     _recaptchaService = recaptchaService;
 }