Ejemplo n.º 1
0
        public void Configuration(IAppBuilder app)
        {
            var applicationContext = ApplicationContext.Current;

            app.ConfigureUserManagerForUmbracoBackOffice <BackOfficeUserManager, BackOfficeIdentityUser>(
                applicationContext,
                (options, context) =>
            {
                var membershipProvider = MembershipProviderExtensions.GetUsersMembershipProvider().AsUmbracoMembershipProvider();
                var userManager        = BackOfficeUserManager.Create(options,
                                                                      applicationContext.Services.UserService,
                                                                      applicationContext.Services.ExternalLoginService,
                                                                      membershipProvider);

                // Overrides Umbraco's password checker
                var latchOperationSvc = new LatchOperationService(applicationContext.DatabaseContext.Database, applicationContext.Services.TextService, applicationContext.Services.UserService);
                userManager.BackOfficeUserPasswordChecker = new LatchLoginChecker(latchOperationSvc, applicationContext.Services.TextService, userManager.PasswordHasher);
                return(userManager);
            });

            //Ensure owin is configured for Umbraco back office authentication
            app
            .UseUmbracoBackOfficeCookieAuthentication(ApplicationContext.Current)
            .UseUmbracoBackOfficeExternalCookieAuthentication(ApplicationContext.Current);
        }
 public OperationsController()
 {
     latchOperationSvc = new LatchOperationService(
         ApplicationContext.Current.DatabaseContext.Database,
         Services.TextService,
         Services.UserService
         );
 }
        private void ConfigureUmbracoLatchEventHandlers(ApplicationContext applicationContext)
        {
            var latchOperationSvc = new LatchOperationService(applicationContext.DatabaseContext.Database, applicationContext.Services.TextService, applicationContext.Services.UserService);

            var contentChecker = new LatchContentChecker(latchOperationSvc, applicationContext.Services.TextService);

            ContentService.Publishing   += contentChecker.LatchContentPublishing;
            ContentService.UnPublishing += contentChecker.LatchContentUnPublishing;
            ContentService.Trashing     += contentChecker.LatchContentTrashing;

            var mediaChecker = new LatchMediaChecker(latchOperationSvc, applicationContext.Services.TextService);

            MediaService.Trashing += mediaChecker.LatchMediaTrashing;

            var localizationChecker = new LatchLocalizationChecker(latchOperationSvc, applicationContext.Services.TextService);

            LocalizationService.DeletingDictionaryItem += localizationChecker.LatchDictionaryItemDeleting;
        }
 public LatchLocalizationChecker(LatchOperationService latchSvc, ILocalizedTextService textService)
     : base(latchSvc, textService)
 {
 }
Ejemplo n.º 5
0
 protected LatchChecker(LatchOperationService latchOperationSvc, ILocalizedTextService textService)
 {
     this.latchOperationSvc = latchOperationSvc;
     this.textService       = textService;
 }
 public LatchLoginChecker(LatchOperationService latchOperationSvc, ILocalizedTextService textService, IPasswordHasher passwordHasher)
     : base(latchOperationSvc, textService)
 {
     this.passwordHasher = passwordHasher;
 }