public IActionResult Configure(ConfigurationNovellModel novellModel) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods)) { return(AccessDeniedView()); } if (!ModelState.IsValid) { return(Configure()); } int activeStoreScopeConfiguration = _storeContext.ActiveStoreScopeConfiguration; _novellActiveDirectoryExternalAuthSettings.LdapPath = novellModel.LdapPath; _novellActiveDirectoryExternalAuthSettings.LdapUsername = novellModel.LdapUsername; _novellActiveDirectoryExternalAuthSettings.LdapPassword = novellModel.LdapPassword; _novellActiveDirectoryExternalAuthSettings.UseInstantLogin = novellModel.UseInstantLogin; _novellActiveDirectoryExternalAuthSettings.SearchBase = novellModel.SearchBase; _novellActiveDirectoryExternalAuthSettings.ContainerName = novellModel.ContainerName; _novellActiveDirectoryExternalAuthSettings.Domain = novellModel.Domain; _novellActiveDirectoryExternalAuthSettings.DomainDistinguishedName = novellModel.DomainDistinguishedName; _novellActiveDirectoryExternalAuthSettings.LdapServerPort = novellModel.LdapServerPort; _novellActiveDirectoryExternalAuthSettings.UseSSL = novellModel.UseSSL; int num = (_storeService.GetAllStores(true).Count > 1) ? activeStoreScopeConfiguration : 0; _settingService.SaveSetting(_novellActiveDirectoryExternalAuthSettings, num); _settingService.ClearCache(); //_cacheManager.Clear(); _customerActivityService.InsertActivity("EditNovellActiveDirectoryExternalAuthSettings", "Edit Novell Active Directory External Auth Settings", null); _notificationService.SuccessNotification(_localizationService.GetResource("Admin.Plugins.Saved")); return(Configure()); }
public IActionResult Configure() { if (!_permissionService.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods)) { return(AccessDeniedView()); } int activeStoreScopeConfiguration = _storeContext.ActiveStoreScopeConfiguration; var novellActiveDirectorySettings = _settingService.LoadSetting <NovellActiveDirectoryExternalAuthSettings>(activeStoreScopeConfiguration); ConfigurationNovellModel configurationNovellModel = new ConfigurationNovellModel { LdapPath = novellActiveDirectorySettings.LdapPath, LdapUsername = novellActiveDirectorySettings.LdapUsername, LdapPassword = novellActiveDirectorySettings.LdapPassword, UseInstantLogin = novellActiveDirectorySettings.UseInstantLogin, SearchBase = novellActiveDirectorySettings.SearchBase, ContainerName = novellActiveDirectorySettings.ContainerName, Domain = novellActiveDirectorySettings.Domain, DomainDistinguishedName = novellActiveDirectorySettings.DomainDistinguishedName, LdapServerPort = novellActiveDirectorySettings.LdapServerPort, UseSSL = novellActiveDirectorySettings.UseSSL, }; return(View("~/Plugins/ExternalAuth.NovellActiveDirectory/Views/Configure.cshtml", (object)configurationNovellModel)); }